diff options
Diffstat (limited to 'devtools/shared/webconsole/test/helper_serviceworker.js')
-rw-r--r-- | devtools/shared/webconsole/test/helper_serviceworker.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/devtools/shared/webconsole/test/helper_serviceworker.js b/devtools/shared/webconsole/test/helper_serviceworker.js new file mode 100644 index 000000000..633f3e09b --- /dev/null +++ b/devtools/shared/webconsole/test/helper_serviceworker.js @@ -0,0 +1,19 @@ +console.log("script evaluation"); + +addEventListener("install", function (evt) { + console.log("install event"); +}); + +addEventListener("activate", function (evt) { + console.log("activate event"); +}); + +addEventListener("fetch", function (evt) { + console.log("fetch event: " + evt.request.url); + evt.respondWith(new Response("Hello world")); +}); + +addEventListener("message", function (evt) { + console.log("message event: " + evt.data.message); + evt.source.postMessage({ type: "PONG" }); +}); |