How are chrome extensions made | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок

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 - avatar
1 ответ
+ 5
1. Simple behavior is implemented by incorporating appropriate keys in a JSON file named manifest.json 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: }); }); Reference :
10th Dec 2019, 3:40 AM
Gordon - avatar