-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Description
The spec for history.go() at https://html.spec.whatwg.org/multipage/browsers.html#dom-history-go says:
When the go(delta) method is invoked, if delta is zero, the user agent must act as if the location.reload() method was called instead.
This is ambiguous as to which location should be used, the one for the window whose history is being accessed, or the current document. Unfortunately, different browsers behave differently, as shown by:
<html>
<body>
<iframe id="child"></iframe>
</body>
<script>
var child = document.getElementById("child");
setTimeout(function () { console.log("Finished."); }, 1000);
child.contentWindow.history.go(0);
</script>
</html>Under FF, this will loop forever reloading (because the main document is reloaded) whereas in Chrome it will terminate (because the child is reloaded).