diff --git a/MantisHelperPlugin/background.js b/MantisHelperPlugin/background.js index 6dea0da..1f0e8d7 100644 --- a/MantisHelperPlugin/background.js +++ b/MantisHelperPlugin/background.js @@ -12,8 +12,10 @@ chrome.contextMenus.onClicked.addListener((info) => { if (selectedText.startsWith('#')) { selectedText = selectedText.substring(1); } - const fixedUrl = 'https://ot.syncore.at/view.php?id='; - const completeUrl = `${fixedUrl}${selectedText}`; - chrome.tabs.create({ url: completeUrl }); + chrome.storage.sync.get(['customUrl'], (result) => { + const fixedUrl = result.customUrl || 'https://example.com/view.php?id='; + const completeUrl = `${fixedUrl}${selectedText}`; + chrome.tabs.create({ url: completeUrl }); + }); } }); diff --git a/MantisHelperPlugin/manifest.json b/MantisHelperPlugin/manifest.json index 2740094..5f29ef1 100644 --- a/MantisHelperPlugin/manifest.json +++ b/MantisHelperPlugin/manifest.json @@ -2,9 +2,10 @@ "manifest_version": 3, "name": "Open in Mantis", "version": "1.0", - "permissions": ["contextMenus"], + "permissions": ["contextMenus", "storage"], "background": { "service_worker": "background.js" }, - "description": "Open selected number in Mantis" + "description": "Open selected number in Mantis", + "options_page": "options.html" } diff --git a/MantisHelperPlugin/options.html b/MantisHelperPlugin/options.html new file mode 100644 index 0000000..b1c44ac --- /dev/null +++ b/MantisHelperPlugin/options.html @@ -0,0 +1,14 @@ + + +
+