how I can change default icon in chrome extension?

Viewed 33471

Here I am working with chrome extension development.

my manifest.json page as show

{
"name": "DemoExtension",
  "version": "1.0",
  "description": "Official addon from demeo",
  "browser_action": {
    "default_icon": "star-on.png",
    "popup": "shopcmp.htm"  
  },
  "permissions": [
    "tabs"    
  ],
  "background_page": "background.html"   
}

Here I want to change my default icon image at runtime.

4 Answers

with the new manifest v3 the standard for changing an icon at runtime is now

chrome.action.setIcon()

if you want every page has its own icon status, use chrome.pageAction.

Related