javascript - Troubleshoot Chrome Search Extension -


i've been trying make basic chrome extension search wayback machine based off link. i'm trying set when right-click link, context menu has 'go wayback machine' option. have:

manifest.json:

{   "name" : "archive right click",   "manifest_version" : 2,   "version" : "1.0",   "description" : "adds go archive right-click context menu.",   "icons" : {     "16" : "icon-16.png",     "48" : "icon-48.png"   },   "browser_action" : {     "default_icon": "icon-16.png",     "default_title" : "go archive"   },   "permissions" : [     "tabs",     "contextmenus"   ],   "background" : {     "scripts" : ["script.js"]   } } 

script.js:

function searcharchive(info,tab) {     var url = info.linkurl;     var archiveurl = "https://web.archive.org/web/*/" + url;     chrome.tabs.create({         url : archiveurl,     }); }  chrome.contextmenus.create(     {         "context" : ["link"],         "title" : "open link in archive",         "onclick" : searcharchive     }); 

the problem doesn't show in context menu let alone open tab want.

let me know useful tutorials on chrome extensions. haven't been able find beginner resource provides examples.

you should change context contexts in script.js

function searcharchive(info,tab) {     var url = info.linkurl;     var archiveurl = "https://web.archive.org/web/*/" + url;     chrome.tabs.create({         url : archiveurl,     }); }  chrome.contextmenus.create({     "contexts" : ["link"]     "title" : "open link in archive",     "onclick" : searcharchive }); 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -