summaryrefslogtreecommitdiff
path: root/src/content/content.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/content.js')
-rw-r--r--src/content/content.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/content/content.js b/src/content/content.js
index eb4fcdd..e73feb6 100644
--- a/src/content/content.js
+++ b/src/content/content.js
@@ -85,13 +85,13 @@ ns.on("capabilities", () => {
if (!ns.canScript) {
- if (!!navigator.serviceWorker.controller) {
+ if ("serviceWorker" in navigator && navigator.serviceWorker.controller) {
addEventListener("beforescriptexecute", e => e.preventDefault());
- (async () => {
- for (let r of await navigator.serviceWorker.getRegistrations()) {
- await r.unregister();
- }
- })();
+ (async () => {
+ for (let r of await navigator.serviceWorker.getRegistrations()) {
+ await r.unregister();
+ }
+ })();
}
if (document.readyState !== "loading") onScriptDisabled();