2012-08-14 18:58:01 +04:00
|
|
|
/* Any copyright is dedicated to the public domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
// Bug 764718 - Test that clicking a link with _target=blank works.
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2013-03-28 23:51:10 +04:00
|
|
|
browserElementTestHelpers.setEnabledPref(true);
|
|
|
|
browserElementTestHelpers.addPermission();
|
2012-08-14 18:58:01 +04:00
|
|
|
|
|
|
|
function runTest() {
|
|
|
|
var iframe = document.createElement('iframe');
|
2014-10-31 05:39:15 +03:00
|
|
|
iframe.setAttribute('mozbrowser', 'true');
|
2012-08-14 18:58:01 +04:00
|
|
|
|
|
|
|
iframe.addEventListener('mozbrowseropenwindow', function(e) {
|
|
|
|
is(e.detail.url, 'http://example.com/');
|
2013-09-10 08:18:46 +04:00
|
|
|
e.preventDefault();
|
2012-08-14 18:58:01 +04:00
|
|
|
SimpleTest.finish();
|
|
|
|
});
|
|
|
|
|
|
|
|
iframe.src = "file_browserElement_TargetBlank.html";
|
|
|
|
document.body.appendChild(iframe);
|
|
|
|
}
|
|
|
|
|
2013-03-28 23:51:10 +04:00
|
|
|
addEventListener('testready', runTest);
|