summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/message_posting_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/serviceworkers/test/message_posting_worker.js')
-rw-r--r--dom/serviceworkers/test/message_posting_worker.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/serviceworkers/test/message_posting_worker.js b/dom/serviceworkers/test/message_posting_worker.js
new file mode 100644
index 0000000000..5fcd0a741e
--- /dev/null
+++ b/dom/serviceworkers/test/message_posting_worker.js
@@ -0,0 +1,8 @@
+onmessage = function (e) {
+ self.clients.matchAll().then(function (res) {
+ if (!res.length) {
+ dump("ERROR: no clients are currently controlled.\n");
+ }
+ res[0].postMessage(e.data);
+ });
+};