开发者

Firing contextmenu event in Firefox AddOn gives different Elements (XPCNativeWrapper vs. XULElement)?

Executing this JavaScript:

window.addEventListener("contextmenu", function(e) { afunction(e); }, true);

function updateReflectMenu(anEvent) {
  var elemUnderMouse = anEvent.target;
  alert(elemUnderMouse);
}

within an AddOn in Firefox 3.5 gives me something like:

[object XPCNativeWr开发者_运维知识库apper [object HTMLSpanElement]]
Exactly what I'm looking for. Executed with Firefox 1.5 or 2.x I get:
[object XULElement]
Unfortunately I was unable to find any information about that! Any help is much appreciated.


anEvent.originalTarget

https://developer.mozilla.org/en/DOM/event.originalTarget

tested with FF 1.5, 2.0 and 3.5!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜