Replace deprecated extension.getURL() with runtime.getURL().

This commit is contained in:
hackademix 2021-06-19 00:28:44 +02:00
parent eb9f53e2b8
commit 984e68e3cf
5 changed files with 6 additions and 6 deletions

View File

@ -221,7 +221,7 @@ var Settings = {
async reloadOptionsUI() { async reloadOptionsUI() {
try { 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.runtime.getManifest().options_ui.page) })
) { ) {
browser.tabs.reload(t.id); browser.tabs.reload(t.id);

View File

@ -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 popupFor = tabId => `${popupURL}#tab${tabId}`;
let ctxMenuId = "noscript-ctx-menu"; let ctxMenuId = "noscript-ctx-menu";

@ -1 +1 @@
Subproject commit 8eee9f97d98b7622b3f7ee018e87701b9d6d7825 Subproject commit d55eab823474e56b3da2e84203a1c6a0f7515ebf

View File

@ -29,7 +29,7 @@ var Prompts = (() => {
this.close(); this.close();
let {width, height} = data.features; let {width, height} = data.features;
let options = { let options = {
url: browser.extension.getURL("ui/prompt.html"), url: browser.runtime.getURL("ui/prompt.html"),
type: "panel", type: "panel",
width, width,
height, height,

View File

@ -97,7 +97,7 @@ addEventListener("unload", e => {
let handlers = { let handlers = {
"options": e => { "options": e => {
if (UA.mobile) { // Fenix fails on openOptionsPage 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 { } else {
browser.runtime.openOptionsPage(); browser.runtime.openOptionsPage();
} }
@ -255,7 +255,7 @@ addEventListener("unload", e => {
pendingReload(sitesUI.anyPermissionsChanged()); pendingReload(sitesUI.anyPermissionsChanged());
if (optionsClosed) return; if (optionsClosed) return;
browser.tabs.query({ browser.tabs.query({
url: browser.extension.getURL( url: browser.runtime.getURL(
browser.runtime.getManifest().options_ui.page) browser.runtime.getManifest().options_ui.page)
}).then(tabs => { }).then(tabs => {
browser.tabs.remove(tabs.map(t => t.id)); browser.tabs.remove(tabs.map(t => t.id));