Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /secure-contexts/detached-iframe.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>Window.isSecureContext after its iframe is removed</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<body>
<script>
test(() => {
assert_false(self.isSecureContext, "An http: page is not a secure context");
const iframe = document.body.appendChild(document.createElement("iframe"));
const iframeWindow = iframe.contentWindow;
assert_false(iframeWindow.isSecureContext, "Before removal");
iframe.remove();
assert_false(iframeWindow.isSecureContext, "After removal");
}, "Removing an iframe does not make its window a secure context");
</script>