// META: script=/common/get-host-info.sub.js // Test that the initial about:blank gets the about base URL // from the entry global object. async function withIframe(src, cb) { const ifr = document.createElement("iframe"); ifr.src = src; document.body.append(ifr); cb(ifr); ifr.remove(); } async function withWindow(src, cb) { const w = window.open(src); cb(w); w.close(); } // Need a trailing '/' for equality checks const REMOTE_ORIGIN = new URL("/", get_host_info().REMOTE_ORIGIN).href; async function withWindowOpenerNotInitiator(src, cb) { window.deferredIframeWindow = Promise.withResolvers(); // Create an iframe with a different base URL. // If it opens a window with window.top being the opener, // the base URL should come from the initiator, i.e. this iframe. const ifr = document.createElement("iframe"); ifr.srcdoc = `