Skip to content

Instantly share code, notes, and snippets.

@bwrrp
Created February 28, 2015 18:59
Show Gist options
  • Save bwrrp/3a16b3511e7a92fc3e3b to your computer and use it in GitHub Desktop.
Save bwrrp/3a16b3511e7a92fc3e3b to your computer and use it in GitHub Desktop.
Reproducible case for Firefox window.open / window.location error.
<!doctype html>
<html>
<body>
<script>
try {
location.replace(location.href + '#/route'); // crash
//location.href += '#/route'; // crash
//location.href = 'http://www.mozilla.org/'; // allowed
//location.hash = '#/route'; // allowed
} catch (error) {
document.body.innerHTML += error.toString();
}
</script>
</body>
</html>
<!doctype html>
<html>
<body>
<button id="meep">Meep</button>
<script>
meep.addEventListener('click', function () {
var w = window.open();
//var w = window.open('about:blank');
setTimeout(function () {
w.location.replace('in-window.html');
}, 0);
}, false);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment