summaryrefslogtreecommitdiffstats
path: root/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/shared/webconsole/test/chrome/helper_serviceworker.js')
-rw-r--r--devtools/shared/webconsole/test/chrome/helper_serviceworker.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/devtools/shared/webconsole/test/chrome/helper_serviceworker.js b/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
new file mode 100644
index 0000000000..5f0f520819
--- /dev/null
+++ b/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
@@ -0,0 +1,21 @@
+"use strict";
+
+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" });
+});