testing/web-platform/tests/html/user-activation/resources/child-one.html
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 14 Jul 2025 05:41:12 +0000 (12 hours ago)
changeset 796406 1e02bb4c2af2efa34f8335befa373d2b39383b02
parent 519942 e85c5c0f555e483cb89fba0b12be66f786c520b3
permissions -rw-r--r--
Bug 1973726 - Set DOM file path for webkitRelativePath. r=sefeng,geckoview-reviewers,webidl,smaug,ohall Actually, there is no way to set webkitRelativePath from JavaScript. Since GeckoView's folder picker handles virtual file data, we need to set relative path from JavaScript directly. A content URI of System storage document provider only allow file data access from file/folder picker, so there is no way to test it on geckoivew-junit. Also, after landing bug 1591640, GVE always crash when using folder picker. So this includes a fix for it. Differential Revision: https://phabricator.services.mozilla.com/D255615
<!DOCTYPE html>
<body style="background: yellow;">
  <script>
    window.top.postMessage(JSON.stringify({
        "type": "child-one-loaded",
        "isActive": navigator.userActivation.isActive,
        "hasBeenActive": navigator.userActivation.hasBeenActive
    }), "*");

    window.addEventListener("click", event => {
        window.top.postMessage(JSON.stringify({
            "type": "child-one-clicked",
            "isActive": navigator.userActivation.isActive,
            "hasBeenActive": navigator.userActivation.hasBeenActive
        }), "*");
    });

    window.addEventListener("message", event => {
        var msg = JSON.parse(event.data);
        if (msg.type == "report") {
            window.top.postMessage(JSON.stringify({
                "type": "child-one-report",
                "isActive": navigator.userActivation.isActive,
                "hasBeenActive": navigator.userActivation.hasBeenActive
            }), "*");
        }
    });
  </script>
</body>