Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <html>
2 <body>
3 <a id='link' target='_blank' href="http://example.com">Click me</a>
5 <script>
6 function clickLink() {
7 // See testcase in bug 666604.
8 var e = document.createEvent("MouseEvent");
9 e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
10 false, false, false, false, 0, null);
11 document.getElementById('link').dispatchEvent(e);
12 }
14 addEventListener('load', function() { setTimeout(clickLink, 0) });
15 </script>
17 </body>
18 </html>