On Wed, Feb 12, 2014 at 8:14 PM, Gijs Kruitbosch
<gijskruitbo...@gmail.com>wrote:

> 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?
>
>
dom-window-destroyed is similar to unload event on docshell so it will
work. But toplevel-window-ready only tells me when a top level window is
added. What about any newly added iframes inside that window ?

Also, my main motive is to get hold of window objects, so no of checking
with docshells I believe .

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



-- 
Girish Sharma
B.Tech(H), Civil Engineering,
Indian Institute of Technology, Kharagpur
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to