Resetting action.setIcon to manifest icon

Viewed 17

How can we reset the global icon to the manifest icon?

In Firefox, browserAction.setIcon() or action.setIcon():

If each one of imageData and path is one of undefined, null or empty object:

  • ...
  • ...
  • Otherwise, the global icon will be reset to the manifest icon.
browser.browserAction.setIcon({});

However, in Chrome action.setIcon()

Either the path or the imageData property must be specified.

chrome.browserAction.setIcon({});

// Uncaught TypeError: Cannot read properties of undefined (reading 'setIcon')

Is including the path to the manifest icon the only way? e.g.

chrome.browserAction.setIcon({path: '/path/icon.png'});
0 Answers
Related