On May 29, 8:22 pm, Peter Valdemar Mørch <[email protected]> wrote:
> Hi John and list,
>
> Thank you for your speedy reply. And thanks for your snippet!
>
> On May 1, 5:11 pm, John J Barton <[email protected]> wrote:
>
> > To get the context for |controlledWindow| use
> > Firebug.TabWatcher.getContextByWindow(controlledWindow); then pass the
> > result context object to Firebug.Console.logFormatted.
>
> Just to be sure: It looks like it is Firebug.TabWatcher in 1.8, but
> just plain TabWatcher in 1.6 and 1.7, right?
We removed all globals other than "Firebug" in 1.8.
> I'm using this:
>
> getFirebugContext: function(window) {
To avoid confusing myself I always us "win" rather than "window". The
latter hides the global window property and errors can result in
searching for 'window'.
> var tabWatcher;
> if (typeof(Firebug) == 'object' &&
> typeof(Firebug.TabWatcher) == 'object') {
> // This is for later releases
> tabWatcher = Firebug.TabWatcher;
> } else if (typeof(TabWatcher) == 'object') {
> // This is for 1.6
> tabWatcher = TabWatcher;
> }
> if (typeof tabWatcher != 'undefined') {
> return tabWatcher.getContextByWindow(window);
> } else {
> return null;
> }
> },
>
> This way it'll work regardless of what version (>=1.6) of Firebug is
> installed, or even if it isn't installed at all. Can anybody see bugs
> or uncovered corner cases here?
>
> Peter
--
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en.