I wanna create a chrome extension that when you click it that you open my website. But how?
I tried searching on google but this is all what I could create:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png"
chrome.tabs.create({'url': chrome.extension.getURL('popup.html')}, function(tab) {
// Tab opened.
});
},
"permissions": [
"http://api.flickr.com/"
]
}
But this doesn’t seem to work.
The bit of code,
cannot be used directly in the manifest. If you look at the documentation for how to use browser actions, the correct way of handling the click event is to put something like this in the JavaScript on your background page:
From your manifest, it looks like you don’t have a background page. Simply create an HTML file with some JavaScript in it, and reference it in the manifest like so: