[英]I need to get a handle on the window object in firefox 3.6 extension before any code is executed
从ff 3.6插件开始,我想在页面上的任何JS运行之前每次创建一个新的窗口对象时都得到通知-我尝试了“ load”事件,但似乎为时已晚,时间我得到对象的句柄,并且需要在运行任何JS之前进入,请问有人有什么想法吗?
You need to listen for the content-document-global-created
notification, that's exactly what you are asking for - a window has been set up but no JavaScript code had a chance to execute yet. 您需要侦听content-document-global-created
通知,这正是您所要的-已设置了一个窗口,但尚未执行任何JavaScript代码。 This is supported starting with Firefox 3.6.6. 从Firefox 3.6.6开始支持此功能。
You need to use nsIObserverService and register your observer for this topic. 您需要使用nsIObserverService并注册该主题的观察者。 When your observer is called the subject will be the newly created window. 调用观察者时,主题将是新创建的窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.