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 }); - } -});