Here is my very simple window
http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_10_test01_en.xul
Best regards
Christophe Charron
> _______________________________________________
> dev-tech-xul mailing list
> dev-te...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-xul
>
--
>: ~
ok but then what event must I listen and on wich objet must I do
listen ? I tried on the window_content of the window contained in the
iframe but it doesn't seem to work.
> On 8/13/07, Christophe Charron <christophe.charron....@gmail.com> wrote:
>
>
>
>
>
> > Hi,
> > because a context menu on a texbox, in a remote application, always
> > throws an exception, i'd like to disable it. No problem with a simple
> > window, I just have to do
> > window._content.addEventListener('contextmenu',function) (see here
>
> >http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_19...
> > )
> > But impossible to manage it when a window contains an iframe that
> > contains a window itself. It works (??) the first time but a soon as i
> > load an other window in the frame, it doesn't work anymore.
> > Is it possible to do it?
> > Am I doing something wrong ?
>
> > Here is my very simple window
>
> >http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_10...
>
> > Best regards
> > Christophe Charron
>
> > _______________________________________________
> > dev-tech-xul mailing list
> > dev-tech-...@lists.mozilla.org
> >https://lists.mozilla.org/listinfo/dev-tech-xul
>
> --
>
> >: ~
>because a context menu on a texbox, in a remote application, always throws an exception, i'd like to disable it. No problem with a simple window, I just have to do window._content.addEventListener('contextmenu',function) (see here http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_19_test01.xul)
>But impossible to manage it when a window contains an iframe that contains a window itself. It works (??) the first time but a soon as i load an other window in the frame, it doesn't work anymore.
>
>
There are two issues here.
The first is that an event listener added to a frame only listens to
events in that frame, not in subframes.
The second is that when you load a document into a frame all of its
event listeners are removed.
As you seem to be writing an extension the solution is to add your event
listener to the tabbrowser rather than the content window. The
tabbrowser is special in that it can listen to all events in all frames
in all tabs.
--
Warning: May contain traces of nuts.
All codes can be seen here :
http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_10_test01_en.xul
>On the frame i do "onload="event.stopPropagation();""
>
>
Load events aren't supposed to bubble, although old versions may still
have that bug.
>No, i'm not writing an extension but a remote app.
>
>
You confused me because window._content makes no sense for a remote app
(it's the same as window.top).
In this case, you have to add load event listeners to all your frames so
that when a document loads you can add all your other event listeners to
their windows. (Of course this doesn't really help in the case of
subframes...)
What's an old version ? I'm using 2.0.0.6 !!!
>
> >No, i'm not writing an extension but a remote app.
>
> You confused me because window._content makes no sense for a remote app
> (it's the same as window.top).
>
> In this case, you have to add load event listeners to all your frames so
> that when a document loads you can add all your other event listeners to
> their windows. (Of course this doesn't really help in the case of
> subframes...)
>
I tried, here
http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_13_test01_en.xul
but it doesn't seem to work !
>On 14 août, 10:31, Neil <n...@parkwaycc.co.uk> wrote:
>
>
>>In this case, you have to add load event listeners to all your frames so that when a document loads you can add all your other event listeners to their windows.
>>
>I tried, here
>http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_13_test01_en.xul
>but it doesn't seem to work !
>
>
You didn't add the other event listeners to the window, you added it to
the frame element (which doesn't work). Try fa_aay(window.toto); instead.
http://test03.christophe-charron.org/public/xul/2007_08_09/2007_08_14_test01_en.xul
A very very big thanks.
Best regards,
Christophe