Reputation: 872
I believe I've seen this in javascript options somewhere, but I coudln't find it anywhere, so I ask it here: Is it possible to prevent a page from being shown in the browser history?
I want to do this, because I have a page which I want to refresh every minute, but for that refresh to work, data must be submitted into an [invisible] form...
Upvotes: 1
Views: 1423
Reputation: 25
This beautiful code works right out the box! It is full JavaScript!
<script>
function makeid(b){for(var a="",c=0;c<b;c++)a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567-89".charAt(Math.floor(63*Math.random()));return a}console.log(makeid(50));function FindProxyForURL(b,a){return isResolvable(a)?"DIRECT":"PROXY proxy.mydomain.com:8080"}window.history.pushState("page2","Title",makeid(50));
</script>
Upvotes: -1
Reputation: 360702
You can use location.replace
to move to a new URL without adding another entry to the browsing history.
Upvotes: 4