chrome.browserAction.setIcon()` Is not not persistent after tab reload?

125 views
Skip to first unread message

Muhammad Arsalan

unread,
Jun 23, 2021, 3:08:07 PM6/23/21
to Chromium-dev

When extension toolbar icon set via chrome.pageAction.setIcon() the icon reverted to default after tab reload (F5)

In the documentation it says:

If you want to create an icon that isn't always active, use a page action instead of a browser action.

Which suggests that the icon supposed to be persistent.. Am I missing something?

Sample extension:

manifest.json

{ "background": { "persistent": true, "scripts": [ "background.js" ] }, "browser_action": {}, "manifest_version": 2, "name": "test", "permissions": [ "tabs" ], "version": "0.0.1" } background.js chrome.tabs.getSelected( tab => {   chrome.browserAction.setIcon({     path: "data:image/bmp;base64,Qk0eAAAAAAAAABoAAAAMAAAAAQABAAEAGAAAAP8A", //red square icon     tabId: tab.id   }); });
Reply all
Reply to author
Forward
0 new messages