Skip to content

Truly independent web browser

594 B
Raw Blame
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
    const runTest = id => {
        return new Promise(resolve => {
            window.onmessage = e => {
                let target = window.open("", `test-${id}`);

                println(`${id}: Target matches source: ${target === e.source}`);
                e.source.close();

                resolve();
            };

            window.open("../../data/window-opener-post-message.html", `test-${id}`);
        });
    };

    promiseTest(async () => {
        await runTest(1);
        await runTest(2);
    });
</script>