I want to change the text for the browserAction icon but I can’t get it to work.
content_script.js
browser.browserAction.setBadgeText({text: "Hello"});
Can someone help me out?
Thanks
I want to change the text for the browserAction icon but I can’t get it to work.
content_script.js
browser.browserAction.setBadgeText({text: "Hello"});
Can someone help me out?
Thanks
You can not access the browserAction API from content scripts:
Here is a very simple way to accomplish what you need.
extension.zip (11.9 KB)
As you can see inside the code, you need to send a message (via browser.runtime.sendMessage) from your content script to your background page to access the browserAction API.
Thanks for the help! I got it working!
The extentsion.zip was really helpful.