Skip to content

Instantly share code, notes, and snippets.

@Yogu
Last active August 26, 2015 21:43
Show Gist options
  • Save Yogu/3144d4de476518927afb to your computer and use it in GitHub Desktop.
Save Yogu/3144d4de476518927afb to your computer and use it in GitHub Desktop.
<script>
window.onbeforeunload = function() {
return "confirm";
}
var i = 0;
setInterval(function() {
document.getElementById('display').innerHTML = i++;
}, 100);
</script>
<h1>Demonstration of a Firefox bug</h1>
<ol>
<li>Hit F5 to refresh the page, but do not click anything on the confirmation dialog. <em>The timer will have stopped, but this is probably intended.</em></li>
<li>Change to a different tab and back. <em>The dialog will be gone</em></li>
<li>Hit F5 again, but confirm the reload this time</li>
<li><em>The timer will not start again, even after pressing Ctrl+F5</em></li>
</ol>
<div id="display"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment