Still, there is a solution. We make a GET request, using history.replaceState() hide its parameters and write the query string. We retrieve it through history.state .
// addEventListener() - для Firefox document.addEventListener('DOMContentLoaded', function() { var query = history.state; if(query === null) { history.replaceState(query, 'Page title', './url'); query = location.search; // Исправление для Chrome (если нужно оставить старый заголовок) document.title += '_'; document.title = document.title.substring(0, document.title.length - 1); } }
True, there is a nuance with the processing of parameters - after the page is updated, they will not be available to the server, but JavaScript will be known. In addition, the native history.replaceState() creates a new entry in the browser history, and not very beautiful (at the moment neither Chrome nor Firefox support writing the second parameter - the title) - instead of the name a new URL is written.
Apparently, correctly replaceState() works only in history.js .
In addition, there is a duplication of browser history (if we write the same page names). Moreover, one link in the history will contain parameters, and the other will not.
As one more way, you can suggest sending the user to an intermediate page with indication of parameters in a GET request. From there we redirect using <meta http-equiv="refresh" ...> it to the desired page, but without parameters. And already on it we look at HTTP Referrer. The advantage of this method - Referrer is available to both the server and the client (JavaScript). Minus - its relatively low support. Firefox, as far as it was possible to understand from experiments, does not send it at all, and it also writes the address of the page with redirection into history, unlike Chrome.