remove id from path to menu

This commit is contained in:
dragonwocky 2021-10-08 12:31:18 +11:00
parent c83003cfac
commit a8ed96e09b
2 changed files with 3 additions and 7 deletions

View File

@ -16,7 +16,7 @@
"browser_action": {}, "browser_action": {},
"background": { "scripts": ["worker.js"] }, "background": { "scripts": ["worker.js"] },
"options_ui": { "options_ui": {
"page": "repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html", "page": "repo/menu/menu.html",
"open_in_tab": true "open_in_tab": true
}, },
"web_accessible_resources": ["env/*", "api/*", "dep/*", "media/*", "repo/*"], "web_accessible_resources": ["env/*", "api/*", "dep/*", "media/*", "repo/*"],

View File

@ -8,9 +8,7 @@
async function focusMenu() { async function focusMenu() {
chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => { chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => {
const url = chrome.runtime.getURL( const url = chrome.runtime.getURL('repo/menu/menu.html'),
'repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html'
),
menu = tabs.find((tab) => tab.url.startsWith(url)); menu = tabs.find((tab) => tab.url.startsWith(url));
if (menu) { if (menu) {
chrome.tabs.highlight({ 'tabs': menu.index }); chrome.tabs.highlight({ 'tabs': menu.index });
@ -34,9 +32,7 @@ async function focusNotion() {
async function reload() { async function reload() {
chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => { chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT }, (tabs) => {
const menu = chrome.runtime.getURL( const menu = chrome.runtime.getURL('repo/menu/menu.html');
'repo/menu@a6621988-551d-495a-97d8-3c568bca2e9e/menu.html'
);
tabs.forEach((tab) => { tabs.forEach((tab) => {
const url = new URL(tab.url), const url = new URL(tab.url),
matches = matches =