Created
February 28, 2015 18:59
-
-
Save bwrrp/3a16b3511e7a92fc3e3b to your computer and use it in GitHub Desktop.
Reproducible case for Firefox window.open / window.location error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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