Why doesn't document.addEventListener('load', function) work in a greasemonkey script?

前端 未结 5 1566
粉色の甜心
粉色の甜心 2020-12-05 22:32

It doesn\'t give an error, and I put a console.log(\'loaded userscript wifi-autologin\'), the console.log works, but the intended effect of the doc

5条回答
  •  执念已碎
    2020-12-05 23:06

    According to HTML living standard specification, the load event is

    Fired at the Window when the document has finished loading; fired at an element containing a resource (e.g. img, embed) when its resource has finished loading

    I.e. load event is not fired on document object.

    Credit: Why does document.addEventListener(‘load’, handler) not work?

提交回复
热议问题