2014-08-19 00:50:30 +00:00
|
|
|
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"});
|
|
|
|
});
|
2014-12-09 20:38:55 +00:00
|
|
|
|
|
|
|
chrome.runtime.onStartup.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"});
|
|
|
|
});
|