Bug Tracker

Opened 11 years ago

Closed 9 years ago

#4151 closed enhancement (wontfix)

Use in Environments that Don't Support Expandos

Reported by: john Owned by:
Priority: major Milestone:
Component: core Version: 1.3.1
Keywords: needsreview Cc:
Blocked by: Blocking:

Description

From the jquery-dev list:

does anybody have any experience/success with running jQuery inside a Mozilla Firefox sandbox, in which the global window object is a deep XPCNativeWrapper of the underlying DOM?

In this environment, 'expando' properties - e.g., properties not defined by W3C DOM may be added only to 'window' and 'document', but not to any other DOM element. For example, the following code:

document.expando = 'Hello'; document.body.expando = 'World'; alert(document.expando + ' ' + document.body.expando);

would alert 'Hello undefined'.

Is it possible to use jQuery if DOM elements do not support expando properties?

Change History (4)

comment:1 Changed 10 years ago by yehuda

Milestone: 1.3.21.3.3

comment:2 Changed 10 years ago by yacoob

This feature is relevant for anyone that wants to write Greasemonkey script including jQuery.

As of 1.3.2, the support seems to be partial. Inside a GM script, I was able to set an event handler via .focus(function() {...}) but I wasn't able to trigger an event via .focus(). I've ended up using dispatchEvent() for triggering an event:

var evt = document.createEvent("HTMLEvents"); evt.initEvent('focus', true, true); $('div#bla')[0].dispatchEvent(evt);

comment:3 Changed 9 years ago by dmethvin

Keywords: needsreview added
Milestone: 1.4
Status: newopen

comment:4 Changed 9 years ago by john

Resolution: wontfix
Status: openclosed

I don't think that this is something that we're going to be able to reasonably implement - expandos are a rather critical part of having jQuery work with DOM nodes.

Note: See TracTickets for help on using tickets.