How are chrome extensions made | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

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 -:

9th Dec 2019, 11:46 PM
Ginfio
Ginfio - avatar
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
10th Dec 2019, 3:40 AM
Gordon
Gordon - avatar