mirror of
https://github.com/gamaio/lobli.git
synced 2025-01-05 08:42:40 +00:00
e395ac49e8
Untested with the API
16 lines
561 B
JavaScript
16 lines
561 B
JavaScript
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 lob.li", "contexts": ["image", "video", "audio"], "id": "shortenFile"});
|
|
chrome.contextMenus.create({"title": "Shorten link with lob.li", "contexts": ["link"], "id": "shortenLink"});
|
|
});
|