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 --- .../test/match_all_properties_worker.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dom/serviceworkers/test/match_all_properties_worker.js (limited to 'dom/serviceworkers/test/match_all_properties_worker.js') diff --git a/dom/serviceworkers/test/match_all_properties_worker.js b/dom/serviceworkers/test/match_all_properties_worker.js new file mode 100644 index 0000000000..f07a44e233 --- /dev/null +++ b/dom/serviceworkers/test/match_all_properties_worker.js @@ -0,0 +1,27 @@ +onfetch = function (e) { + if (/\/clientId$/.test(e.request.url)) { + e.respondWith(new Response(e.clientId)); + } +}; + +onmessage = function (e) { + dump("MatchAllPropertiesWorker:" + e.data + "\n"); + self.clients.matchAll().then(function (res) { + if (!res.length) { + dump("ERROR: no clients are currently controlled.\n"); + } + + for (i = 0; i < res.length; i++) { + client = res[i]; + response = { + type: client.type, + id: client.id, + url: client.url, + visibilityState: client.visibilityState, + focused: client.focused, + frameType: client.frameType, + }; + client.postMessage(response); + } + }); +}; -- cgit v1.2.3