Closed Bug 478529 Opened 15 years ago Closed 14 years ago

XPCNativeWrapper does not support expando properties

Categories

(Firefox :: Extension Compatibility, defect)

3.6 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: godmar, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.04 (hardy) Firefox/3.0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.04 (hardy) Firefox/3.0.6

https://developer.mozilla.org/es/XPCNativeWrapper#Setting_.22expando.22_properties_on_XPCNativeWrapper states that:

"It is possible to set "expando" properties (properties with names that don't correspond to IDL-defined properties) on XPCNativeWrapper objects. If this is done, then chrome will be able to see these expando properties"

This does not appear to be true.


Reproducible: Always

Steps to Reproduce:
1. Visit any webpage
2. Open the Console with Ctrl-Shift-J
3. Copy and paste the following line:

var safewin = new XPCNativeWrapper(window); var sandbox = new Components.utils.Sandbox(safewin); sandbox.window = safewin; sandbox.document = safewin.document; var code = "document.expando = 'Hello'; document.body.expando = 'World'; window.alert(document.expando + ' ' + document.body.expando);"; Components.utils.evalInSandbox(code, sandbox);

4. Hit "Evaluate"
Actual Results:  
"Hello undefined"

Expected Results:  
"Hello World"

This problems make it impossible to use any JavaScript library (such as jQuery!) that uses 'expando' properties within a Sandbox in which window is XPCNative-wrapper, thus preventing the use of jQuery in Greasemonkey and other extensions that manipulate the DOM.
This bug was reported using Firefox 3.0 or older, which is no longer supported. The bug has also not been changed in over 500 days and is still in UNCO.
Reporter, please retest this bug in Firefox 3.6.10 or later using a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles. If you still see this problem, please update the bug. If you no longer see the bug, please set the resolution to RESOLVED, WORKSFORME.

This is a mass search of unconfirmed bugs that have no activity on them, so if you feel a bug was marked in error, just remove the CLOSEME comment in the whiteboard within the next month.
Whiteboard: [CLOSEME 2010-11-15]
The bug persists in 3.6.

It prevents jQuery's .data() feature from working when run inside XPCNativeWrapper.
Version: unspecified → 3.6 Branch
Whiteboard: [CLOSEME 2010-11-15]
Godmar, when I tun the comment 0 code in a current trunk nightly I get "Hello World"....
Well that's wonderful. Then close the bug. Will the fix make it into a 3.6 line or will it be in 4.x?
The latter.

Resolving worksforme, but I'd appreciate it if you would test it on your end too once Firefox 4 beta 7 is out!  Please reopen if the problem is still present,
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.