Add testcase for #2311

This commit is contained in:
Florian Bruhin 2017-02-17 21:32:40 +01:00
parent a767e33f15
commit 6ac7e61e0e

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<!--
Some pages (*cough* Reddit *cough*) insert a target=_blank *after* a link was
clicked, which is early enough for the browser to try and open a new tab, but
too late for hints to notice. This means the page won't be opened at all when
javascript-can-open-windows is false.
-->
<html>
<head>
<meta charset="utf-8">
<title>Link where we insert target=_blank via JS</title>
<script type="text/javascript">
function setup_event_listener() {
var elem = document.getElementById('link');
elem.addEventListener('click', function() {
elem.target = '_blank';
});
}
</script>
</head>
<body onload="setup_event_listener()">
<a href="/data/hello.txt" id="link">Follow me!</a>
</body>
</html>