Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/windows/browsing-context-names/choose-_blank-002.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>Link with target=_blank, rel=noreferrer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<div id="log"></div>
<a href="resources/report-has-opener.html" rel="noreferrer" target="_blank">Link</a>
<script>
var prefixedStorage;
setup (() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
var a = document.getElementsByTagName('a')[0];
a.href = prefixedStorage.url(a.href);
prefixedStorage.onSet('hasOpener', t.step_func_done(e => {
assert_equals(e.newValue, 'false');
}));
a.click();
}, 'Context for opened noreferrer link targeted to "_blank" should not have opener reference');
</script>