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?
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. 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? 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? Thanks, --Nathan On Sun, Dec 21, 2008 at 10:02 PM, John J Barton <[email protected]> wrote: > > Nathan, panel data is per web page (tab). Each web page has a Firebug > 'context', each panel has a different data set for each context. So > your questions don't make sense, see below: > > On Dec 21, 8:59 am, "Nathan Mische" <[email protected]> wrote: >> I've been looking at the Firebug code and I'm not sure this is >> possible, but I thought I'd ask here. >> >> Is there any way to tell if a panel is being initialized in a new tab? > > Panels are initialized when Firebug starts (or on demand, but not per > page). A context is initialized a three different points, initContext > (no data yet), loadedContext( load event arrived), showContext > (firebug is shown to user). Beware that showContext can precede > loadContext. > > The image under "Study the HTML for the panel" on > http://getfirebug.com/chromebug/usingChromebug/t1/index.html > shows the HTML for the panels. You can see multiple panels and > contexts. Firebug just actives the right one as you navigate Firebug > panels or Firefox tabs. > >> I have some panel state information that I would like to clear out >> when the panel is opened in a new tab. > > If the page is opened then the context is initialized and the panel is > empty. Nothing to clear out. You can use destroyContext module event > to clear the corresponding panel info or save some state. > >> I do not want to clear out the >> panel state if the panel is initialized in the same tab. > > This does not make sense because the tabs are not connected to > anything other than the tab bar. So a panel is not initialized with a > tab. When you load a new page, or navigate within a site from page to > page, the window inside the tab is deleted, gone, not around. Then a > new window arrives, fills with the new content, and sits in the tab. > There is no "same tab". The destroyContext/initContext pair have > persistentState you can use to store info by URL. > > Or at least this is how I understand it. > >> >> Thanks, >> >> --Nathan > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
statedemo.xpi
Description: application/xpinstall
