How to dynamically set icons #1791
-
Hello 👋🏽 Have some questions for ya'll around dynamically setting icons 🙏🏽 ContextIm trying to change my extension icon when a user is not logged in so its a indication to them they need to log in. Im also using https://wxt.dev/auto-icons for my icons Question
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
As far as I've discovered, browsers use a 48px icon for the action icon. chrome.action.setIcon({ path: '/icons/48.png' }); Each other icon could be placed in the chrome.action.setIcon({ path: '/images/logged-out.png' }); |
Beta Was this translation helpful? Give feedback.
As far as I've discovered, browsers use a 48px icon for the action icon.
Once you have it auto-icon'ed, you can access it by the
/icons/48.png
path with the following call:Each other icon could be placed in the
public
dir, e.g.public/images/logged-out.png
, then the following code will change the action button icon: