Error in adding eventListener to XUL element - Mozilla
This is a discussion on Error in adding eventListener to XUL element - Mozilla ; Greetings, to everybody
Guys, i've got question concerning event listeners in Netscape 8.
I use one extenstion for couple of Gecko browsers: Mozilla Suite 1.7.x,
Netscape 7.x, Firefox 1.x, Firefox 1.5.x and Netscape 8.x
I have such a line in ...
-
Error in adding eventListener to XUL element
Greetings, to everybody
Guys, i've got question concerning event listeners in Netscape 8.
I use one extenstion for couple of Gecko browsers: Mozilla Suite 1.7.x,
Netscape 7.x, Firefox 1.x, Firefox 1.5.x and Netscape 8.x
I have such a line in my XUL overlay:
window.document.getElementById("security-button").addEventListener("mouseover",
myExt_padlock, true);
it works fine in all browsers except Netscape 8.
In JS console i got error message -
"window.document.getElementById("security-button") has no attributes"
is there any way to solve it?
i guess, that adding attribute for onmouseover to the xul element is
solution, but i don't think that's it right solution, as i may rewrite
someone else's attribute.
P.S. thanx for attention.
--
With Best Regards,
Anatoly Kaverin,
Mozilla/Firefox VEngine team
Comodo CA Limited
http://www.vengine.com http://www.comodo.com
a.kaverin@gmail.com
MSN: tolikk@hotmail.com
-
Re: Error in adding eventListener to XUL element
Anatoly Kaverin wrote:
> Guys, i've got question concerning event listeners in Netscape 8.
>
> I use one extenstion for couple of Gecko browsers: Mozilla Suite 1.7.x,
> Netscape 7.x, Firefox 1.x, Firefox 1.5.x and Netscape 8.x
>
> I have such a line in my XUL overlay:
> window.document.getElementById("security-button").addEventListener("mouseover",
> myExt_padlock, true);
>
> it works fine in all browsers except Netscape 8.
> In JS console i got error message -
> "window.document.getElementById("security-button") has no attributes"
That means that the XUL element you're trying to add your listener to doesn't
exist. The solution is to find what in NS8 you _are_ trying to add to.
> i guess, that adding attribute for onmouseover to the xul element is
> solution
Again, the problem is that there is no XUL element, not that addEventListener is
failing.
-Boris
-
Re: Error in adding eventListener to XUL element
On Fri, 3 Feb 2006 17:15:13 +0200, Anatoly Kaverin wrote:
> I use one extenstion for couple of Gecko browsers: Mozilla Suite 1.7.x,
> Netscape 7.x, Firefox 1.x, Firefox 1.5.x and Netscape 8.x
> I have such a line in my XUL overlay:
> window.document.getElementById("security-button").addEventListener("mouseover",
> myExt_padlock, true);
> it works fine in all browsers except Netscape 8.
> In JS console i got error message -
> "window.document.getElementById("security-button") has no attributes"
In NS8, the netscape developers moved the security button to an overlay:
chrome://browser/content/statusbarOverlay.xul
Are you putting your code in an onload eventlistener? Not all overlays may
have loaded if you call your code from directly inside your overlay.
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]When uncertain, or in doubt, run in circles and scream: HEEELLLPP!
* TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
On Fri, 03 Feb 2006 10:57:23 -0600, Boris Zbarsky wrote:
> Anatoly Kaverin wrote:
>> it works fine in all browsers except Netscape 8.
>> In JS console i got error message -
>> "window.document.getElementById("security-button") has no attributes"
> That means that the XUL element you're trying to add your listener to doesn't
> exist. The solution is to find what in NS8 you _are_ trying to add to.
If it doesn't exist in NS8, why does it show up in the NS8 DOM Inspector
when I use the find by id search function?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Today is the tomorrow you worried about yesterday.
* TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
Philip Chee wrote:
> If it doesn't exist in NS8, why does it show up in the NS8 DOM Inspector
> when I use the find by id search function?
That sounds like the code is just running before the overlay loads, then.
Though note that search by id searches subdocuments in Inspector.... and
searches inside XBL bindings too.
-Boris
-
Re: Error in adding eventListener to XUL element
On Fri, 03 Feb 2006 15:36:56 -0600, Boris Zbarsky wrote:
> Philip Chee wrote:
> That sounds like the code is just running before the overlay loads, then.
I ran into a similar problem with Seamonkey. navigator.xul loads overlays
which load other overlays which load even more overlays. I think this
structure dates back to the Netscape days. What *were* they smoking in those
days ?!?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Gee! Slow day on the nets ... only 10,100 messages to read!
* TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
Philip Chee wrote:
>On Fri, 03 Feb 2006 15:36:56 -0600, Boris Zbarsky wrote:
>
>
>>That sounds like the code is just running before the overlay loads, then.
>>
>>
>I ran into a similar problem with Seamonkey. navigator.xul loads overlays which load other overlays which load even more overlays. I think this structure dates back to the Netscape days. What *were* they smoking in those days ?!?
>
>
It's called modularity.
Both navigator.xul and viewSource.xul use navigatorOverlay.xul
mailNavigatorOverlay.xul used to be part of mail.
navExtraOverlay.xul was probably a placeholder for some Netscape stuff.
linkToolbarOverlay.xul was an extension.
The other overlays also get reused.
--
Warning: May contain traces of nuts.
-
Re: Error in adding eventListener to XUL element
On Sat, 04 Feb 2006 22:07:29 +0000, Neil wrote:
> It's called modularity.
> Both navigator.xul and viewSource.xul use navigatorOverlay.xul
> mailNavigatorOverlay.xul used to be part of mail.
And I have to admit that this is bloody useful in some cases. For example I
was able to reuse the contextarea menu overlay in my port of the firefox
web-panels.xul which means that (a) I don't have to re-invent the wheel, and
(b) I don't have to maintain/support a home-grown context menu.
On the gripping hand, sometimes I need to scrounge through LXR to find which
overlay some elementID is coming from. And of course the original poster's
problem of scripts running before all overlays are loaded. Is there an
"onoverlaysloaded" event by any chance?
> navExtraOverlay.xul was probably a placeholder for some Netscape stuff.
I see a bunch of *Extra* stuff in the Seamonkey .jar files. Most of them
appear to be stub placeholders. Now that Netscape is basing their browsers
on firefox/aviary, are there any plans to stop building Seamonkey with all
this crud?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Go ahead, back up to the RAM disk. I dare you!
* TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
Philip Chee aber hob zu reden an und schrieb:
> I see a bunch of *Extra* stuff in the Seamonkey .jar files. Most of them
> appear to be stub placeholders. Now that Netscape is basing their browsers
> on firefox/aviary, are there any plans to stop building Seamonkey with all
> this crud?
If you find something specific that's just Netscape stubs that aren't
used anymore, file a bug...
Karsten
--
Feel free to correct my English. 
-
Mnenhy mailnews sidebar (was: Error in adding eventListener to XULelement)
On Sun, 05 Feb 2006 15:31:39 +0100, Karsten Düsterloh wrote:
.....snip....
By the way, if the Mnenhy mailnews sidebar is enabled, then the DOM
Inspector doesn't show any pane content. The statusbar abutts directly on
the toolbox. In the DOM view there is nothing between and
. If I disable the Mnenhy mailnews sidebar then the DOM Inspector
displays stuff as normal.
This makes extension problems rather difficult to diagnose but I finally
managed to get xSidebar to cooperate with Mnenhy.
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
-
Re: Mnenhy mailnews sidebar
Philip Chee aber hob zu reden an und schrieb:
> By the way, if the Mnenhy mailnews sidebar is enabled, then the DOM
> Inspector doesn't show any pane content. The statusbar abutts directly on
> the toolbox. In the DOM view there is nothing between and
> . If I disable the Mnenhy mailnews sidebar then the DOM Inspector
> displays stuff as normal.
This is a known bug in Mnenhy 0.7.3 in connection with the old 3pane
window (mail3PaneWindowVertLayout.xul). As a workaround, use
messenger.xul by setting the pref mail.pane_config to 0 and change
View->Layout to suite your needs again.
It'll be fixed in the next Mnenhy update.
Karsten
--
Feel free to correct my English. 
-
Re: Mnenhy mailnews sidebar
On 06/02/2006 06:49, Karsten Düsterloh wrote:
> Philip Chee aber hob zu reden an und schrieb:
>> By the way, if the Mnenhy mailnews sidebar is enabled, then the DOM
>> Inspector doesn't show any pane content. The statusbar abutts directly on
>> the toolbox. In the DOM view there is nothing between and
>> . If I disable the Mnenhy mailnews sidebar then the DOM Inspector
>> displays stuff as normal.
> This is a known bug in Mnenhy 0.7.3 in connection with the old 3pane
> window (mail3PaneWindowVertLayout.xul). As a workaround, use
> messenger.xul by setting the pref mail.pane_config to 0 and change
> View->Layout to suite your needs again.
> It'll be fixed in the next Mnenhy update.
Current settings:
mail.pane_config = 0
mail.pane_config.dynamic = 0
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Nothing is so simple that it can't get screwed up.
* TagZilla 0.059
-
Re: Mnenhy mailnews sidebar
On Sun, 05 Feb 2006 23:49:11 +0100, Karsten Düsterloh wrote:
> Philip Chee aber hob zu reden an und schrieb:
>> By the way, if the Mnenhy mailnews sidebar is enabled, then the DOM
>> Inspector doesn't show any pane content. The statusbar abutts directly on
>> the toolbox. In the DOM view there is nothing between and
>> . If I disable the Mnenhy mailnews sidebar then the DOM Inspector
>> displays stuff as normal.
> This is a known bug in Mnenhy 0.7.3 in connection with the old 3pane
> window (mail3PaneWindowVertLayout.xul). As a workaround, use
> messenger.xul by setting the pref mail.pane_config to 0 and change
> View->Layout to suite your needs again.
> It'll be fixed in the next Mnenhy update.
Just to clarify. The actual mailnews window works fine. It's only when
trying to look at it inside the DOM Inspector when the pane content doesn't
show up. Is mailnews not picking up the prefs when inside DOMI? Should I
file a DOMI bug?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]ROM wasn't built in a day.
* TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
i use that code directly in my Overlay.xul:
window.document.getElementById("security-button").addEventListener("mouseover",
myExt_padlock, true);
so, pls, tell me is there any possibility to add eventlistener to padlock ?
--
With Best Regards,
Anatoly Kaverin,
Mozilla/Firefox VEngine team
Comodo CA Limited
http://www.vengine.com http://www.comodo.com
a.kaverin@gmail.com
MSN: tolikk@hotmail.com
"Philip Chee" ???????/???????? ? ???????? ?????????:
news:g5CdnRa_RfeDOX7eRVn-qw@mozilla.org...
> On Fri, 3 Feb 2006 17:15:13 +0200, Anatoly Kaverin wrote:
>
>> I use one extenstion for couple of Gecko browsers: Mozilla Suite 1.7.x,
>> Netscape 7.x, Firefox 1.x, Firefox 1.5.x and Netscape 8.x
>
>> I have such a line in my XUL overlay:
>> window.document.getElementById("security-button").addEventListener("mouseover",
>> myExt_padlock, true);
>
>> it works fine in all browsers except Netscape 8.
>> In JS console i got error message -
>> "window.document.getElementById("security-button") has no attributes"
>
> In NS8, the netscape developers moved the security button to an overlay:
> chrome://browser/content/statusbarOverlay.xul
>
> Are you putting your code in an onload eventlistener? Not all overlays may
> have loaded if you call your code from directly inside your overlay.
>
> Phil
> --
> Philip Chee ,
> http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
> Guard us from the she-wolf and the wolf, and guard us from the thief,
> oh Night, and so be good for us to pass.
> [ ]When uncertain, or in doubt, run in circles and scream: HEEELLLPP!
> * TagZilla 0.059
-
Re: Error in adding eventListener to XUL element
Philip Chee wrote:
>On the gripping hand, sometimes I need to scrounge through LXR to find which overlay some elementID is coming from. And of course the original poster's problem of scripts running before all overlays are loaded. Is there an "onoverlaysloaded" event by any chance?
>
The standard load event suffices, no?
--
Warning: May contain traces of nuts.
-
Re: Error in adding eventListener to XUL element
Anatoly Kaverin wrote:
> i use that code directly in my Overlay.xul:
> window.document.getElementById("security-button").addEventListener("mouseover",
> myExt_padlock, true);
>
> so, pls, tell me is there any possibility to add eventlistener to padlock ?
Like Philip said, put that in an onload handler.
-Boris
-
Re: Error in adding eventListener to XUL element
On Mon, 06 Feb 2006 09:50:30 +0000, Neil wrote:
> Philip Chee wrote:
> The standard load event suffices, no?
I wasn't sure. Is this guaranteed?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]I'm lost, but I'm still making pretty good time!
* TagZilla 0.059
-
Re: Mnenhy mailnews sidebar
[mozilla.dev.tech.xul skipped]
Philip Chee aber hob zu reden an und schrieb:
> Just to clarify. The actual mailnews window works fine. It's only when
> trying to look at it inside the DOM Inspector when the pane content doesn't
> show up. Is mailnews not picking up the prefs when inside DOMI? Should I
> file a DOMI bug?
Hm, this works for me - between toolbox and statusbar is a hbox with id
mnenhyMailContent...
Karsten
--
Feel free to correct my English. 
-
Re: Mnenhy mailnews sidebar
On Tue, 07 Feb 2006 00:26:43 +0100, Karsten Düsterloh wrote:
> [mozilla.dev.tech.xul skipped]
> Philip Chee aber hob zu reden an und schrieb:
>> Just to clarify. The actual mailnews window works fine. It's only when
>> trying to look at it inside the DOM Inspector when the pane content doesn't
>> show up. Is mailnews not picking up the prefs when inside DOMI? Should I
>> file a DOMI bug?
> Hm, this works for me - between toolbox and statusbar is a hbox with id
> mnenhyMailContent...
Hm, are you using Mnenhy-0.7.3 or your latest dev. build?
Phil
--
Philip Chee ,
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]If At First You Don't Succeed Ignore The Docs
* TagZilla 0.059
-
Re: Mnenhy mailnews sidebar
Philip Chee aber hob zu reden an und schrieb:
>> Hm, this works for me - between toolbox and statusbar is a hbox with id
>> mnenhyMailContent...
>
> Hm, are you using Mnenhy-0.7.3 or your latest dev. build?
Regular SM 1.0 with Mnenhy-0.7.3 on Win2k, just like my User-Agent
header says. I usually only use sufficiently stable versions of
SM/Mnenhy for mail and news, development happens in custom debug builds
and different profiles. Mnenhy development builds have build ids like
x.y.z.10325 (i.e. the last number is >= 10000), denoting a build after
x.y.z.0, but before x.y.(z+1).0.
Which address is shown in DOMI's urlbar?
Should be ...
Karsten
--
Feel free to correct my English. 