Closed Bug 1228943 Opened 9 years ago Closed 9 years ago

Cannot Clone an Object from Observer in e10s

Categories

(Firefox :: Extension Compatibility, defect)

44 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: ido.y, Unassigned)

Details

Attachments

(1 file)

11.82 KB, application/x-xpinstall
Details
Attached file clone.xpi
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

Steps to reproduce:

tried to use cloneInto from observer into the window


Actual results:

i'm getting a clone of empty object without its properties


Expected results:

the extension should be fully cloned in the window
Summary: Cannot Cloning an Object from Observer in e10s → Cannot Clone an Object from Observer in e10s
Attachment #8693468 - Attachment mime type: application/zip → application/x-xpinstall
How does work your add-on? Any more details about steps to reproduce?
Flags: needinfo?(ido.y)
Hi Loic,

i'm trying to create an extension that listen to document create event (by observer)
while this event is triggered i want to inject an object on the window
after that i'm reading an external file using XHR which use the var that i created on the window
the thing is that i'm getting a permissions denied from the external file

this extension worked in the previous versions,
using the cloneInto

but with multiprocess there is a problem
the cloned object is empty on the page content
Flags: needinfo?(ido.y)
You're attempting to clone a JS object into a CPOW for a window in the child process. I wouldn't expect this to work and I doubt it is something we'd want to fix. You need to use frame scripts in order to be running in the child process to clone an object from there.

Gabor, do you want to confirm that that isn't something we want to fix?
Component: Add-ons Manager → Extension Compatibility
Flags: needinfo?(gkrizsanits)
Product: Toolkit → Firefox
I saw that the "Test_From_Obersver_With_Clone_1" did cloned correctly (it is a simple string)
and this issue happen only when I tried to clone an object ("Test_From_Obersver_With_Clone_2")
(In reply to Dave Townsend [:mossop] from comment #3)
> Gabor, do you want to confirm that that isn't something we want to fix?

You are right. If one wants to clone cross processes nsIMessageManager already covers that pretty well.
The example here uses cloneFunctions: true. I don't think we want to support that. In some case one can use a CPOW for that (target window must be same origin) but even then it would not be a suggested thing to do (CPOWs are temporary and can slow down the browser). So yeah, either frame or process scripts are the way to go.

(In reply to ido.y from comment #4)
> I saw that the "Test_From_Obersver_With_Clone_1" did cloned correctly (it is
> a simple string)
> and this issue happen only when I tried to clone an object
> ("Test_From_Obersver_With_Clone_2")

I don't think it does what you think it does. In fact this function should just throw if the target scope is a CPOW.
Flags: needinfo?(gkrizsanits)
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: