From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- dom/serviceworkers/test/fetch/plugin/plugins.html | 43 +++++++++++++++++++++++ dom/serviceworkers/test/fetch/plugin/worker.js | 15 ++++++++ 2 files changed, 58 insertions(+) create mode 100644 dom/serviceworkers/test/fetch/plugin/plugins.html create mode 100644 dom/serviceworkers/test/fetch/plugin/worker.js (limited to 'dom/serviceworkers/test/fetch/plugin') diff --git a/dom/serviceworkers/test/fetch/plugin/plugins.html b/dom/serviceworkers/test/fetch/plugin/plugins.html new file mode 100644 index 0000000000..b268f6d99e --- /dev/null +++ b/dom/serviceworkers/test/fetch/plugin/plugins.html @@ -0,0 +1,43 @@ + + diff --git a/dom/serviceworkers/test/fetch/plugin/worker.js b/dom/serviceworkers/test/fetch/plugin/worker.js new file mode 100644 index 0000000000..9849c9e0d5 --- /dev/null +++ b/dom/serviceworkers/test/fetch/plugin/worker.js @@ -0,0 +1,15 @@ +self.addEventListener("fetch", function (event) { + var resource = event.request.url.split("/").pop(); + event.waitUntil( + clients.matchAll().then(clients => { + clients.forEach(client => { + if (client.url.includes("plugins.html")) { + client.postMessage({ + destination: event.request.destination, + resource, + }); + } + }); + }) + ); +}); -- cgit v1.2.3