I know that the manifest file allow only 1 icon, but can I update the icon on different urls?
For example show a red icon in Google, and on youtube it has another icon. Is that possible? Can I update the icon in js, if not in the manifest file?
I know that the manifest file allow only 1 icon, but can I update the icon on different urls?
For example show a red icon in Google, and on youtube it has another icon. Is that possible? Can I update the icon in js, if not in the manifest file?
This is easy to find in the documentation:
chrome.pageAction.setIcon(object details, function callback)
Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
You need to pass a Tab ID to it, e.g.
chrome.pageAction.setIcon({tabId: id, path: 'icon.png'});
For more options, see the above documentation link.
The answers given are correct, a Chrome extension is allowed one of either a PageAction button or a BrowserAction button.
But that is not true for Firefox extensions, which allow one page_ction button (a.k.a. address bar button) and one browser_action button (a.k.a. toolbar button).