How to implement “DOM Ready” event in a GreaseMonkey script?

后端 未结 3 1256
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-12 14:01

I\'m trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires.

I\'m using FireFox 2.0.0.16 / GreaseMon

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-12 14:28

    GreaseMonkey scripts are themselves executed on DOMContentLoaded, so it's unnecessary to add a load event handler - just have your script do whatever it needs to to immediately.

    http://wiki.greasespot.net/DOMContentLoaded

提交回复
热议问题