Got it. So it doesn't sound like it is possible to maintain context
state. For example if I set context.stateDemo.variables that will be
gone with the next window load. Is that correct?

Thanks again,

--Nathan

On Tue, Dec 23, 2008 at 12:35 AM, John J Barton
<[email protected]> wrote:
>
>
>
> On Dec 22, 6:30 pm, "Nathan Mische" <[email protected]> wrote:
>> Hi John,
>>
>> First, thanks for the feedback. I _think_ I'm starting to make sense
>> of the panel/context relationship. So there is only one panel shared
>> across all tabs?
>
> Ok let me try. Firefox tabs are just bins, they have no significance
> for Firebug. Firebug works off "windows" but that is so hard to talk
> about since there are so many meanings for windows. The top level js
> javascript scope 'window' is implemented in FF as nsIDOMWindow, that
> is what Firebug tracks.  Each top has a context, containing all that
> Firebug knows about the page. When you reload or navigate to a new
> URL, you get a new window in the same tab.  Firebug does not know how
> the old window from the tab is connected to the new window in the tab.
> It just starts working on the new window.
>
> Maybe I am making too much of "tab" here, but in the long run you are
> better off not thinking about tabs. Its all about 'window'.
>
> For each context Firebug has a set of panels. So every window that
> Firebug is active on has a context and thus a set of panel values used
> to show results to the user.
>
>>
>> Maybe if I provide an example and explanation of what I'm trying to
>> accomplish you can point in me the right direction.
>>
>> Take the attached sample extension. You can add variable names which
>> are then added to the panel as an array (panel.variables). (The point
>> is these variables names are passed to the web application and echoed
>> back to the user, but I've left all of that out for this example.) I
>> can see that this array is available on the panel across all contexts.
>
> Sure because you attached the variables to the panel not the context.
>
>> What I'd like to do is have the user be able to define a different set
>> of variables for each Firefox tab, so they can look at one set of
>> variables in one tab and another set in a different Firefox tab. Does
>> that make sense?
>
> Well except for that 'tab' thing again ;-).
>
> If you want different values in different windows, then use the
> context, eg context.stateDemo.variables.
>
>>
>> I'm seeing that the panel's initialize method is called for each page
>> load/context intialization. I was hoping there may be some way to
>> determine which Firebug tab the panel was being initialized in, maybe
>> by looking at the context, and reset the panel.variables variable
>> accordingly? I guess at that point I would have no way to restore it
>> to its previous state? Maybe I should be storing this info on the
>> context? If so how is that state maintained from page to page?
>
> Yes, exactly.
>
> jjb
>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to