Upload files to "/"
parent
2e6eff91cb
commit
cd325fceaf
|
|
@ -0,0 +1,19 @@
|
||||||
|
chrome.runtime.onInstalled.addListener(() => {
|
||||||
|
chrome.contextMenus.create({
|
||||||
|
id: 'openInMantis',
|
||||||
|
title: 'Open in Mantis',
|
||||||
|
contexts: ['selection']
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.contextMenus.onClicked.addListener((info) => {
|
||||||
|
if (info.menuItemId === 'openInMantis') {
|
||||||
|
let selectedText = info.selectionText;
|
||||||
|
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 });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"manifest_version": 3,
|
||||||
|
"name": "Open in Mantis",
|
||||||
|
"version": "1.0",
|
||||||
|
"permissions": ["contextMenus"],
|
||||||
|
"background": {
|
||||||
|
"service_worker": "background.js"
|
||||||
|
},
|
||||||
|
"description": "Open selected number in Mantis"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue