diff --git a/Fox.ci_Chrome_Extension/src/js/contextmenu.js b/Fox.ci_Chrome_Extension/src/js/contextmenu.js new file mode 100755 index 0000000..0d22e70 --- /dev/null +++ b/Fox.ci_Chrome_Extension/src/js/contextmenu.js @@ -0,0 +1,15 @@ +chrome.contextMenus.onClicked.addListener(function(info, tab) { + switch(info.menuItemId) { + case "shortenLink": + shortenURL(info.linkUrl, tab.id); + break; + case "shortenFile": + shortenURL(info.srcUrl, tab.id); + break; + } +}); + +chrome.runtime.onInstalled.addListener(function() { + chrome.contextMenus.create({"title": "Shorten link to this file with fox.ci", "contexts": ["image", "video", "audio"], "id": "shortenFile"}); + chrome.contextMenus.create({"title": "Shorten link with fox.ci", "contexts": ["link"], "id": "shortenLink"}); +});