chorme extension context menu, not working
so i'm trying to build a simple extension that adds an option to the menu
when you right click a link, i wrote the "code" that reEdit the link but
for some reason i dont even see the option when i right click a link. i
have tried everything(i have to admit i dont have a any experience with
javaScript or chrome extensions)
here is my manifest code:
{
"name": "EditURL",
"description": "editing URL in SERET website",
"version": "0.7",
"permissions": ["contextMenus"],
"background": {
"persistent": true,
"scripts": ["sample.js"]
},
"manifest_version": 2
}
and js code:
function killAdd(info)
{
var domain = info.selectionText;
var index = domain.lastIndexOf(":");
domain = domain.substring(index - 4);
chrome.tabs.create({url: domain})
}
chrome.contextMenus.create({title: "Addkill", contexts: ["link"], onclick:
function KillAdd(onClickData)});
any ideas???
No comments:
Post a Comment