diff --git a/fetch/metadata/resources/serviceworker-accessors-frame.html b/fetch/metadata/resources/serviceworker-accessors-frame.html new file mode 100644 index 000000000000000..98798025005497f --- /dev/null +++ b/fetch/metadata/resources/serviceworker-accessors-frame.html @@ -0,0 +1,3 @@ + + +Page Title diff --git a/fetch/metadata/resources/serviceworker-accessors.sw.js b/fetch/metadata/resources/serviceworker-accessors.sw.js new file mode 100644 index 000000000000000..36c55a778600f48 --- /dev/null +++ b/fetch/metadata/resources/serviceworker-accessors.sw.js @@ -0,0 +1,14 @@ +addEventListener("fetch", event => { + event.waitUntil(async function () { + if (!event.clientId) return; + const client = await clients.get(event.clientId); + if (!client) return; + + client.postMessage({ + "dest": event.request.headers.get("sec-fetch-dest"), + "mode": event.request.headers.get("sec-fetch-mode"), + "site": event.request.headers.get("sec-fetch-site"), + "user": event.request.headers.get("sec-fetch-user") + }); + }()); +}); diff --git a/fetch/metadata/serviceworker-accessors.https.sub.html b/fetch/metadata/serviceworker-accessors.https.sub.html new file mode 100644 index 000000000000000..6788135f863f109 --- /dev/null +++ b/fetch/metadata/serviceworker-accessors.https.sub.html @@ -0,0 +1,45 @@ + + + + + + + + +