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-default-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Browsing context - Default name</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="/common/blank.html" style="display:none"></iframe>
<object id="obj" type="text/html" data="about:blank"></object>
<embed id="embedded" type="image/svg+xml" src="/images/green.svg" width="0" height="0" />
<script>
test(t => {
assert_equals(window.frames[0].name, "");
assert_equals(document.getElementById("embedded").name, "");
assert_equals(window["obj"].name, "");
}, "A embedded browsing context has empty-string default name");
test(t => {
var win = window.open("about:blank", "_blank");
assert_equals(win.name, "");
win.close();
}, "A browsing context which is opened by window.open() method with '_blank' parameter has empty-string default name");
</script>