javascript - window onload event not fired in chrome content script -


i use content script in chrome extension. content scripts injected @ "document_start".

window.onload = function() {console.log("window onload event fired.");} 

i run above code in content script, when load page, onload event not fired.
is there wrong?

check 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);} 

Comments