I made an add-on for chrome, the functionality is to change the color of the div "textarea_simulator" from the page link , just for doing the test I'm playing with that div but I can not change the color, this is my code js.
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript({
code: 'document.getElementById(textarea_simulator).style.backgroundColor="red"'
});
});
//author -- rn3w
and the manifest.json file is:
{
"name": "cambio del color",
"description": "cambio de color",
"version": "1.0",
"permissions": [
"activeTab"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"browser_action": {
"default_title": "cambiar la vista en chrome "
},
"manifest_version": 2
}
//author ---rn3w---
I did the test to change the color of the background I did the test with google, with this version of my code and it works.
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript({
code: 'document.body.style.backgroundColor="blue"'
});
});
//author -- rn3w