---------
An nsISupports version of the global object to be filtered. A null glob
matches all hooks. This attribute must be QI'able to the
(non-scriptable) nsIScriptGlobalObject interface.
The jsdIService caches this value internally, so if it changes you must
swap the filter with itself using jsdIService::swapFilters.
attribute nsISupports globalObject
---------
Up to now I have always set "null" since I have no idea what a
nsIScriptGlobalObject could be or how to get one. Maybe that is best,
maybe not?
jjb
From memory and with no verification, you can get one from a jsdcontext
(assuming it has a "normal" global object, such as a window).
~ Gijs
nsIScriptGlobalObject is (as the name suggests) the C++ interface representing
a JS global object. In Firefox, there are a few types of global objects: windows
(which implement nsIScriptGlobalObject) which represent the global object
for windows and iframes, a bunch of XBL related global objects and backstage
passes, which are the global objects for JS components (you probably would
only ever see these in ChromeBug).
From the description (I haven't looked at the implementation) it seems like if
you wanted to only listen to events for a specific frame or displayed
document, you'd set this property to that window's global object.
--
Blake Kaplan
Ok that's great hint. Sounds like this object might be the object at the
oldest scope of a given call frame? That is what I use in Chromebug to
define the context (metadata grouping).
>
> From the description (I haven't looked at the implementation) it seems like if
> you wanted to only listen to events for a specific frame or displayed
> document, you'd set this property to that window's global object.
That has great potential if true. A big problem with the jsdIFilter is
dynamics and non-uniqueness of URLs. I actually gave up (again) on
jsdIFilter because the bookkeeping was just too much. When a script
comes in to Firebug after a being compiled I have to set a breakpoint on
it (at PC=0) to figure out which window it comes from. So if I use the
jsdIFilter to block all, I have to allow this new script URL, then take
it off when my break point hits. Or not if it is in my window. And so on.
If I could filter by window and use urlPattern *, maybe it feasible to
use jsdIFilter.
jjb