2012-08-14 18:58:01 +04:00
|
|
|
<html>
|
|
|
|
<body>
|
2018-11-28 15:42:57 +03:00
|
|
|
<a id='link' target='_blank' href="http://example.com" rel="opener">Click me</a>
|
2012-08-14 18:58:01 +04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function clickLink() {
|
|
|
|
// See testcase in bug 666604.
|
|
|
|
var e = document.createEvent("MouseEvent");
|
|
|
|
e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
|
|
|
|
false, false, false, false, 0, null);
|
2019-03-19 23:56:10 +03:00
|
|
|
document.getElementById("link").dispatchEvent(e);
|
2012-08-14 18:58:01 +04:00
|
|
|
}
|
|
|
|
|
2019-03-19 23:56:10 +03:00
|
|
|
addEventListener("load", function() { setTimeout(clickLink, 0); });
|
2012-08-14 18:58:01 +04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|