I use content script in my Chrome extension. content scripts are injected at "document_start".
window.onload = function() {console.log("window onload event fired.");}
I run the above code in content script, but when I load a page, the onload event is not fired.
Is there anything wrong?
Check with this Code
if (window.attachEvent) {window.attachEvent('onload', your_function);}
else if (window.addEventListener) {window.addEventListener('load', your_function, false);}
else {document.addEventListener('load', your_function, false);}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With