Skip to content

Truly independent web browser

1.1 KB
Raw Blame
<!DOCTYPE html>
<script src="../../include.js"></script>
<script>
    // A document with an opaque origin is in an agent cluster of its own, hosted with the agent cluster of the
    // navigation's initiator origin unless it is sandboxed content: a data: URL iframe and a sandboxed about:blank
    // iframe stay with their parent.
    promiseTest(async () => {
        const dataIframe = document.createElement("iframe");
        const dataLoaded = new Promise(resolve => dataIframe.addEventListener("load", resolve, { once: true }));
        dataIframe.src = "data:text/html,<p>data</p>";
        document.body.appendChild(dataIframe);

        const sandboxedIframe = document.createElement("iframe");
        sandboxedIframe.sandbox = "";
        const sandboxedLoaded = new Promise(resolve => sandboxedIframe.addEventListener("load", resolve, { once: true }));
        sandboxedIframe.src = "about:blank";
        document.body.appendChild(sandboxedIframe);

        await Promise.all([dataLoaded, sandboxedLoaded]);
        println(internals.dumpSiteIsolationProcessTree().trimEnd());
    });
</script>