Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
How are chrome extensions made
I was just reading articles, and watching videos about how to make chrome extensions. But one thing I donāt understand is... Like... letās say this extension changes the color of buttons on your website. Do we get the element (the button), doc.getElem...(ābuttonā), then add css to it or JS, Orr ... How does it work I donāt understand -:
1 Resposta
+ 5
1. Simple behavior is implemented by incorporating appropriate keys in a JSON file named manifest.json
https://developer.chrome.com/extensions
2. For complex behavior, use BrowserAction API.
2.1 You can execute JavaScript scripts in this way:
"background": {
"scripts": ["background.js"]
}
// background.js
chrome.extension.onMessage.addListener(function(message, sender) {
chrome.browserAction.setBadgeBackgroundColor({
color: 'red',
tabId: sender.tab.id
});
});
Reference :
https://stackoverflow.com/questions/13564277/chrome-extension-change-address-bar-button-background-color-at-runtime