From 1cdd76d8fc7094661243d0e6e448a0a325bba0ee Mon Sep 17 00:00:00 2001 From: Giteadmin Date: Sun, 10 Sep 2023 18:11:07 +0200 Subject: [PATCH] Delete background.js --- background.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 background.js diff --git a/background.js b/background.js deleted file mode 100644 index c9fc69d..0000000 --- a/background.js +++ /dev/null @@ -1,20 +0,0 @@ -browser.runtime.onInstalled.addListener(() => { - browser.contextMenus.create({ - id: 'openInMantis', - title: 'Open in Mantis', - contexts: ['selection'] - }); -}); - -browser.contextMenus.onClicked.addListener(async (info) => { - if (info.menuItemId === 'openInMantis') { - let selectedText = info.selectionText; - if (selectedText.startsWith('#')) { - selectedText = selectedText.substring(1); - } - const result = await browser.storage.sync.get(['customUrl']); - const fixedUrl = result.customUrl || 'https://example.com/view.php?id='; - const completeUrl = `${fixedUrl}${selectedText}`; - await browser.tabs.create({ url: completeUrl }); - } -});