I'm having trouble getting a simple google extension to work. The manifest file looks like this:
{
"background": {"scripts": ["background.js"]},
"browser_action": {
"default_icon": "icon-128.png",
"default_title": "Lookup"
},
"name": "Lookup",
"description": "Does stuff",
"homepage_url": "http://www.artifacting.com",
"icons": {
"16": "icon-16.png",
"48": "icon-48.png",
"128": "icon-128.png" },
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"version": "0.1",
"manifest_version": 2
}
my background.js simply points to my bookmarklet.js
background.js:
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"})
});
bookmarklet.js
setTimeout('x99.focus()',300);var re=/([/-]|li[er]n=)(d{2,3}[dX])/i;if(re.test(location.href)==true){var isbn=RegExp.$2;var x99=window.open('http://catalog.mywebsite.org/search/searchresults.aspx?ctx=1.1033.0.0.6&type=Keyword&term='+lookup,'Lookup','scrollbars=1,resizable=1,top=0,left=0,location=1,width=800,height=600');x99.focus();}
I'm unsure why when i click on the extension an new window isn't opening up. I'm pretty sure that the setTimeout command isn't working with the chrome exstensions but I'm not sure how to rewrite it correctly. Thanks for your help.