Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/browsing-the-web/navigating-across-documents/refresh/javascript.window.html - WPT Dashboard Interop Dashboard
async_test(t => {
const frame = document.createElement("iframe");
t.add_cleanup(() => frame.remove());
const path = "resources/javascript.asis";
frame.src = path;
frame.onload = t.step_func(() => {
assert_equals(frame.contentWindow.location.href, new URL(path, self.location).href);
assert_equals(frame.contentWindow.x, 1);
t.step_timeout(() => {
assert_equals(frame.contentWindow.x, 1);
t.done();
}, 100);
});
document.body.appendChild(frame);
}, "Refresh to a javascript: URL should not work");