Re:HTML5: Changing the browser-URL without refreshing page
by kiwidrew on Wednesday July 21, 2010 @04:02PM
(#1536364)
If you change the window.history.pushState() call to window.history.replaceState(), it doesn't add bazillions of entries to your history, which makes it slightly more practical.
javascript:var dashes = ""; var num = 20; while(--num) dashes += "-"; setInterval(function() { window.history.replaceState("", "", dashes.slice(0, num % 20) + "foo" + dashes.slice(num % 20)); num++;}, 500)
Re:HTML5: Changing the browser-URL without refreshing page
by ben_alman on Thursday July 22, 2010 @10:58AM
(#1538308)
Ok, here's a first pass... http://jsfiddle.net/cowboy/FB9Nd/show/
Re:HTML5: Changing the browser-URL without refreshing page
by e1ven on Wednesday July 21, 2010 @12:48PM
(#1535711)
That is simultaneously one of the cooler, and more horrifying things I have seen.
With Great Power, comes great potential for horrible, horrible abuse.
Re:HTML5: Changing the browser-URL without refreshing page
by j79 on Wednesday July 21, 2010 @08:49PM
(#1537001)
Absolutely. I was thinking this could be "abused" in the same way that animated status bars were in the 90s.
Of course, I had to try it out...
javascript:var s=[119,101,108,99,111,109,101,45,116,111,45,104,97,99,107,101,114,45,110,101,119,115];var c=1;var mod=s.length+1;setInterval(function(){window.history.replaceState("","", setString())}, 200);function setString(){var n="";if(!(c % mod)){c=1}else{c++}for(i=0;i<s.length;i++){n+=String.fromCharCode(s[i]-(s[i]==45||i!=c-1?0:32))}return n+".aspx!!!"};
Re:HTML5: Changing the browser-URL without refreshing page
by kristofferR on Wednesday July 21, 2010 @01:58PM
(#1535930)
Damn, that is annoying! It totally screws up the back button functionality in Safari:
Re:HTML5: Changing the browser-URL without refreshing page
by sorbus on Wednesday July 21, 2010 @03:14PM
(#1536205)
That's sort of the point, isn't it? As it's continuously changing the URL ... I could see this used to make it difficult or impossible for people to leave sites, except by closing the window.
Re:HTML5: Changing the browser-URL without refreshing page
by mrkurt on Wednesday July 21, 2010 @08:13PM
(#1536938)
Haha, indeed! (Don't click this if you care about your history) http://kurtly.tumblr.com/sticky-history
javascript:var dashes = ""; var num = 20; while(--num) dashes += "-"; setInterval(function() { window.history.pushState("", "", dashes.slice(0, num % 20) + "foo" + dashes.slice(num % 20)); num++;}, 500)