Add testcase for #2311
This commit is contained in:
parent
a767e33f15
commit
6ac7e61e0e
28
tests/end2end/data/hints/html/target_blank_js.html
Normal file
28
tests/end2end/data/hints/html/target_blank_js.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user