Closed Bug 1074093 Opened 11 years ago Closed 11 years ago

wrappedJSObject inconsistent property permissions

Categories

(Firefox :: Untriaged, defect)

35 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: atiware, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:35.0) Gecko/20100101 Firefox/35.0 Build ID: 20140928030206 Steps to reproduce: the following extension code stopped working with Nightly. //------------------------------------------------ in extension code: function doSomethingOnPageLoad(event) { //listens to DOMContentLoaded event if (!event) return; var doc = event.originalTarget; //document //... test document, etc.. var win = doc.defaultView; //window win.wrappedJSObject.unique_var_name_for_the_extension={ __exposedProps__: { foo: "r" }, foo: 'bar' } } //---------------------------------------------- in website js code: function is_foo_of_extension_ok() { if ('unique_var_name_for_the_extension' in window) { var extension_data=window.unique_var_name_for_the_extension; if ((extension_data) && (typeof extension_data == 'object')) { if ('foo' in extension_data) { if (extension_data.foo=='bar') { //Error: Permission denied to access property 'foo' return true; } } } } return false; } Actual results: it throws the following exception: Error: Permission denied to access property 'foo' Expected results: when the browser returns true for the ('foo' in object) test, it should allow to access the property
Atilla, do you know when this broke? Bobby, any ideas, looking at the code snippets?
Flags: needinfo?(bobbyholley)
Flags: needinfo?(atiware)
i discovered a mistake in my bugreport, unfortunately the line number was off by one, the exception is thrown at the ('foo' in window) test. sorry for that. so the title of the bugreport is incorrect. it should be something like: wrappedJSObject stopped working with e10s the correct code snippet: //---------------------------------------------- in website js code: function is_foo_of_extension_ok() { if ('unique_var_name_for_the_extension' in window) { var extension_data=window.unique_var_name_for_the_extension; if ((extension_data) && (typeof extension_data == 'object')) { if ('foo' in extension_data) { //Error: Permission denied to access property 'foo' if (extension_data.foo=='bar') { return true; } } } } return false; } when i deactivate e10s 'foo' is accessible again. do you still need the regresswindow?
Using __exposedProps__ over CPOWs is not supported, which is (I'm guessing) what's happening here. You should use a frame script in the child process to set the property, and use Cu.cloneInto() rather than __exposedProps__.
Flags: needinfo?(bobbyholley)
Resolving as invalid per comment 3/2
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Flags: needinfo?(atiware)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.