From 984e68e3cf2dc3c9446b608484c4c1bab6f544a6 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sat, 19 Jun 2021 00:28:44 +0200 Subject: [PATCH] Replace deprecated extension.getURL() with runtime.getURL(). --- src/bg/Settings.js | 2 +- src/bg/main.js | 2 +- src/nscl | 2 +- src/ui/Prompts.js | 2 +- src/ui/popup.js | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bg/Settings.js b/src/bg/Settings.js index 8c42626..e03c396 100644 --- a/src/bg/Settings.js +++ b/src/bg/Settings.js @@ -221,7 +221,7 @@ var Settings = { async reloadOptionsUI() { try { - for (let t of await browser.tabs.query({url: browser.extension.getURL( + for (let t of await browser.tabs.query({url: browser.runtime.getURL( browser.runtime.getManifest().options_ui.page) }) ) { browser.tabs.reload(t.id); diff --git a/src/bg/main.js b/src/bg/main.js index eb62a05..d589387 100644 --- a/src/bg/main.js +++ b/src/bg/main.js @@ -28,7 +28,7 @@ }); } } - let popupURL = browser.extension.getURL("/ui/popup.html"); + let popupURL = browser.runtime.getURL("/ui/popup.html"); let popupFor = tabId => `${popupURL}#tab${tabId}`; let ctxMenuId = "noscript-ctx-menu"; diff --git a/src/nscl b/src/nscl index 8eee9f9..d55eab8 160000 --- a/src/nscl +++ b/src/nscl @@ -1 +1 @@ -Subproject commit 8eee9f97d98b7622b3f7ee018e87701b9d6d7825 +Subproject commit d55eab823474e56b3da2e84203a1c6a0f7515ebf diff --git a/src/ui/Prompts.js b/src/ui/Prompts.js index f4103cb..e811e0e 100644 --- a/src/ui/Prompts.js +++ b/src/ui/Prompts.js @@ -29,7 +29,7 @@ var Prompts = (() => { this.close(); let {width, height} = data.features; let options = { - url: browser.extension.getURL("ui/prompt.html"), + url: browser.runtime.getURL("ui/prompt.html"), type: "panel", width, height, diff --git a/src/ui/popup.js b/src/ui/popup.js index 934b4c1..e750cff 100644 --- a/src/ui/popup.js +++ b/src/ui/popup.js @@ -97,7 +97,7 @@ addEventListener("unload", e => { let handlers = { "options": e => { if (UA.mobile) { // Fenix fails on openOptionsPage - browser.tabs.create({url: browser.extension.getURL("/ui/options.html")}); + browser.tabs.create({url: browser.runtime.getURL("/ui/options.html")}); } else { browser.runtime.openOptionsPage(); } @@ -255,7 +255,7 @@ addEventListener("unload", e => { pendingReload(sitesUI.anyPermissionsChanged()); if (optionsClosed) return; browser.tabs.query({ - url: browser.extension.getURL( + url: browser.runtime.getURL( browser.runtime.getManifest().options_ui.page) }).then(tabs => { browser.tabs.remove(tabs.map(t => t.id));