This is my content.js file:
Code Block function runOnStart() { document.addEventListener('DOMContentLoaded', function(e) { document.body.style.background = "rgb(20, 20, 20)"; document.html.style.background = "rgb(20, 20, 20)"; var divElements = document.body.getElementsByTagName('div'); for(var i = 0; i < divElements.length; i++) { let elem = divElements[i]; elem.style.background = "rgba(255, 255, 255, 0.05)"; } }); } runOnStart();
If I take the code outside of the event listener, it runs fine, but a lot of the elements haven't loaded in yet so it doesn't work as it should.
The function is definitely running, but the event listener simply doesn't work. I appreciate any help you can give!