On 12/02/2014 14:30, Boris Zbarsky wrote:
On 2/12/14 8:44 AM, Girish Sharma wrote:
I want to track the creation and removal of docshells from a top level
content docshell. Is it possible ?

There are no built-in facilities for this right now, as far as I can
tell.  You could simply add something....

One option would be to watch window creation for things being added, I
guess, and pagehide for things being removed.  But going from a pagehide
event to "what is being removed?" is not trivial..

To observe changes in windows, I add a load and unload event on the
chromeEventHandler of the top level content docshell like [1].

Yeah, that won't work.  pageshow/pagehide would at least fire
consistently, but they represent _pages_, not docshells.

-Boris

Dumb question: Could you listen for dom-window-destroyed and toplevel-window-ready, and figure out from the args which one was a toplevel-of-type docshell, and/or which ones are descendants of the top-level-content docshell you're interested in, or is there some reason that wouldn't work?

~ Gijs
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to