diff options
Diffstat (limited to 'dom/workers/test/serviceworkers/claim_fetch_worker.js')
-rw-r--r-- | dom/workers/test/serviceworkers/claim_fetch_worker.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/workers/test/serviceworkers/claim_fetch_worker.js b/dom/workers/test/serviceworkers/claim_fetch_worker.js new file mode 100644 index 000000000..ea62c37b8 --- /dev/null +++ b/dom/workers/test/serviceworkers/claim_fetch_worker.js @@ -0,0 +1,12 @@ +onfetch = function(e) { + if (e.request.url.indexOf("service_worker_controlled") >= 0) { + // pass through + e.respondWith(fetch(e.request)); + } else { + e.respondWith(new Response("Fetch was intercepted")); + } +} + +onmessage = function(e) { + clients.claim(); +} |