summaryrefslogtreecommitdiffstats
path: root/dom/indexedDB/test/service_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/indexedDB/test/service_worker.js')
-rw-r--r--dom/indexedDB/test/service_worker.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/dom/indexedDB/test/service_worker.js b/dom/indexedDB/test/service_worker.js
new file mode 100644
index 000000000..eb8fd7f66
--- /dev/null
+++ b/dom/indexedDB/test/service_worker.js
@@ -0,0 +1,10 @@
+onmessage = function(e) {
+ self.clients.matchAll().then(function(res) {
+ if (!res.length) {
+ dump("Error: no clients are currently controlled.\n");
+ return;
+ }
+ res[0].postMessage(indexedDB ? { available: true } :
+ { available: false });
+ });
+};