I need to get a handle on the window object in firefox 3.6 extension before any code is executed
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.
精彩评论