From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../test/serviceworkers/fetch/plugin/plugins.html | 43 ++++++++++++++++++++++ .../test/serviceworkers/fetch/plugin/worker.js | 14 +++++++ 2 files changed, 57 insertions(+) create mode 100644 dom/workers/test/serviceworkers/fetch/plugin/plugins.html create mode 100644 dom/workers/test/serviceworkers/fetch/plugin/worker.js (limited to 'dom/workers/test/serviceworkers/fetch/plugin') diff --git a/dom/workers/test/serviceworkers/fetch/plugin/plugins.html b/dom/workers/test/serviceworkers/fetch/plugin/plugins.html new file mode 100644 index 000000000..78e31b3c2 --- /dev/null +++ b/dom/workers/test/serviceworkers/fetch/plugin/plugins.html @@ -0,0 +1,43 @@ + + diff --git a/dom/workers/test/serviceworkers/fetch/plugin/worker.js b/dom/workers/test/serviceworkers/fetch/plugin/worker.js new file mode 100644 index 000000000..e97d06205 --- /dev/null +++ b/dom/workers/test/serviceworkers/fetch/plugin/worker.js @@ -0,0 +1,14 @@ +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({context: event.request.context, + resource: resource}); + } + }); + }) + ); +}); -- cgit v1.2.3