I am developing a Google Chrome extension that changes its icon depending on your IP localization. I am having problems updating after changing the extension icon.
The icon actually changes thanks to this command from my file background.js.
chrome.browserAction.setIcon ( { path: 'france.png' } );
Unfortunately, the command setIconseems asynchronous. Changing the icon actually appears a few seconds after changing the code. Is there a way to get chrome to update badges?
Many chrome extensions seem to be able to control this, but I could not figure out how they handle this.
More details:
To make it clearer, I deleted all my code javascriptfrom different files except the line setIcon. Here is the manifest line that declares my files javascript.
"background": { "scripts": [ "jquery.min.js", "popup.js", "background.js"] },
popup.js:
background.js: :
console.log ("I'm background script");
chrome.browserAction.setIcon({path: 'france.png'});
. Chrome html background.js. , .
, , .
- , , , , .