diff options
Diffstat (limited to 'devtools/client/application/test/browser/resources/service-workers/simple.html')
-rw-r--r-- | devtools/client/application/test/browser/resources/service-workers/simple.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/devtools/client/application/test/browser/resources/service-workers/simple.html b/devtools/client/application/test/browser/resources/service-workers/simple.html new file mode 100644 index 0000000000..88dc00aff0 --- /dev/null +++ b/devtools/client/application/test/browser/resources/service-workers/simple.html @@ -0,0 +1,32 @@ +<!-- Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ --> +<!DOCTYPE HTML> +<html> +<head> + <meta charset="UTF-8"> + <title>Service worker test</title> +</head> +<body> +<script type="text/javascript"> +"use strict"; + +let registration; + +const registerServiceWorker = async function() { + try { + registration = await navigator.serviceWorker.register("empty-sw.js"); + dump("Empty service worker registered\n"); + } catch (e) { + dump("Empty service worker not registered: " + e + "\n"); + } +}; + +// Helper called from head.js to unregister the service worker. +window.getRegistration = function() { + return registration; +}; +// Register the service worker. +registerServiceWorker(); +</script> +</body> +</html> |