Closed djl closed 13 years ago
I noticed this weirdness too but was hoping everything would just work... I guess not. Can you provide a minimal snippet of code that fails due to this so I can try a few things out? Thanks.
Sure. Here's the snippet that tipped me off:
document.onkeydown = null;
Strange thing is if I just do alert(document);
it shows [object HTMLDocument]
:-/
This also works:
document.onclick = function() {
alert('click');
}
(I am on version 0.9 which just got approved yesterday)
Well I'm lost. I'm also on 0.9 and doing alert(document);
shows this for every page:
I'll keep looking into what's going on. It'll probably be a problem on my side.
oh now that is really weird :(
oh wait, what version of Firefox are you on? Mac?
Oooh, I do get that with Firefox 5... I was testing on Aurora... INTERESTING!
I'm on Firefox 5.0.1, OS X.
Aha! It doesn't happen on Aurora. Maybe it was an upstream problem?
Ninja edit: you're too quick for me!
Hi guys,
I have the same problem with FF 5 on Mac with the following snippet:
$("select").change(function(){
window.location = "http://google.com"
});
I also get the XrayWrapper object instead of the normal:
Any ideas how to fix this?
I experimented a little but wasn't able to get the object out of the wrapper. I'll try to find help.
It unwraps and exposes the real object
var realObject= XPCNativeWrapper.unwrap(wrappedObject);
Thanks @skarootz, I'll give that a try!
@skarootz That doesn't seem to be working for me.
alert(document);
alert(XPCNativeWrapper.unwrap(document));
shows [object XrayWrapper [object HTMLDocument]]
in both cases :(
Not sure about the reason, I found that solution when I was trying to access a DOM Object from a greasemonkey script (firefox 4).
On Fri, Jul 22, 2011 at 8:44 AM, rlr < reply@reply.github.com>wrote:
@skarootz That doesn't seem to be working for me.
alert(document); alert(XPCNativeWrapper.unwrap(document));
shows
[object XrayWrapper [object HTMLDocument]]
in both cases :(Reply to this email directly or view it on GitHub: https://github.com/rlr/dotjs-addon/issues/8#issuecomment-1631788
Jaime Hablutzel - 9-9956-3299
(tildes omitidas intencionalmente)
Hi guys,
I have found documentation about this on https://developer.mozilla.org/en/XPCNativeWrapper.
Now, I got console.log working in a quick example, needs to be wrapped in a check of course
// Normally, you can access console.log just like this
window.console.log("this should not work");
// But now we need a work around
_window = new XPCNativeWrapper(content, "window");
_window = _window.wrappedJSObject
_window.console.log("this should work");
_window.console.log(_window.location.hostname);
Hope we can narrow this down to a fix :)
Yay, thanks @yvesvanbroekhoven! I think that fixes it ^^
While jumping between Chrome and Firefox I noticed that some custom JS scripts I run were not working correctly in Firefox.
Turns out the
document
element isn't actually a realdocument
object. Instead of returning the expectedHTMLDocument
object, it returns[object XrayWrapper [object HTMLDocument]]
.Is there any way to have
document
refer to the realHTMLDocument
object?