1
I’m starting to work with extensions in Google Chrome and after some time reading tutorials I so far could not access anything in the DOM of the page. I need to modify the CSS of the page or run some script within it. Could someone pass me some example?
I’m looking for something like that:
index.html
<html>
<head>
<title>teste de extensão</title>
</head>
<body>
<button id="btn1" onclick="fundoAzul()">fundo azul</button>
<br>
<button id="btn1" onclick="fundoVermelho()">fundo vermelho</button>
<script>
function fundoAzul(){
document.querySelector('body').style.background = 'blue';
};
function fundoVermelho(){
document.querySelector('body').style.background = 'red';
};
</script>
</body>
</html>
In the tutorials I saw, one of them showed me how to make a alert
(I can’t remember which one now) but mine alert
was executed within the extension and not on the current page.
dude, fantastic this really now worked! now I can create my extension without fear of being happy rsrs, thank you
– LeandroLuk