开发者

I need to get a handle on the window object in firefox 3.6 extension before any code is executed

开发者 https://www.devze.com 2023-04-05 20:25 出处:网络
from a ff 3.6 plugin I want to get notified every time a new window object is created before any JS on the page has run - I tried the \"load\" event but it seems to be too late, some JavaScript has al

from a ff 3.6 plugin I want to get notified every time a new window object is created before any JS on the page has run - I tried the "load" event but it seems to be too late, some JavaScript has already been executed by the time I get a handle on the object and I need to be in before any JS is run, does anyone have any ideas please开发者_如何学编程?


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. This is supported starting with Firefox 3.6.6.

You need to use nsIObserverService and register your observer for this topic. When your observer is called the subject will be the newly created window.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号