Closed Bug 1092444 Opened 10 years ago Closed 10 years ago

[e10s] Add shim support for sandboxes with expanded principals

Categories

(Firefox :: Extension Compatibility, defect)

34 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 36

People

(Reporter: billm, Assigned: billm)

Details

Attachments

(2 files)

Greasemonkey sometimes creates sandboxes with "expanded principals". See here:
https://developer.mozilla.org/en-US/docs/Components.utils.Sandbox#The_Expanded_Principal

We need to support these in the shims in order for certain greasemonkey scripts to work. This patch does that.
Attachment #8515393 - Flags: review?(mconley)
Attached patch sandbox-ep-testSplinter Review
Here is a test.
Attachment #8515394 - Flags: review?(mconley)
Comment on attachment 8515393 [details] [diff] [review]
greasemonkey-ep-sandbox

Review of attachment 8515393 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/addoncompat/RemoteAddonsParent.jsm
@@ +648,5 @@
> +      let chromeGlobal = chromeGlobalForContentWindow(principals);
> +      return SandboxParent.makeContentSandbox(chromeGlobal, principals, ...rest);
> +    } else if (principals &&
> +               typeof(principals) == "object" &&
> +               "every" in principals &&

Duck-typing gives me the willies. :/
Attachment #8515393 - Flags: review?(mconley) → review+
Comment on attachment 8515394 [details] [diff] [review]
sandbox-ep-test

Review of attachment 8515394 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/addoncompat/tests/addon/bootstrap.js
@@ +85,2 @@
>          loadWithRemoveCount++;
>          is(event.target.documentURI, url1, "only fire for first url");

How was this passing before? Was it?
Attachment #8515394 - Flags: review?(mconley) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/ab201881acaf

(In reply to Mike Conley (:mconley) - Needinfo me! from comment #3)
> Comment on attachment 8515394 [details] [diff] [review]
> sandbox-ep-test
> 
> Review of attachment 8515394 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: toolkit/components/addoncompat/tests/addon/bootstrap.js
> @@ +85,2 @@
> >          loadWithRemoveCount++;
> >          is(event.target.documentURI, url1, "only fire for first url");
> 
> How was this passing before? Was it?

Well, it threw an exception. Since it was from within an event handler, it was ignored. I'm not sure how the test harness normally deals with that sort of thing.
https://hg.mozilla.org/mozilla-central/rev/ab201881acaf
https://hg.mozilla.org/mozilla-central/rev/9a819db6a34a
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: