I'm working on building my first Google Chrome extension but have run into a problem.
I simply want the extension to make a popup window when an icon is clicked. This window will itself display a canvas thats color will change, to green, when a button is clicked.
I've tested my code on websites such as Codepen and it works fine but not when I actually run it in Chrome.
All of my extension's files are in the same folder.
Here is my HTML:
<!doctype html>
<html>
<head> <script src="popup.js"> </script> </head>
<canvas id="canvs" style="border: 2px solid black"></canvas>
<input type = "button" value = "color" onclick="colorChange()">
</html>
JavaScript (popup.js):
function colorChange(){
var can = document.getElementById("canvs");
can.style.backgroundColor = "green";
}
Any help would be appreciated, thanks!