Bug 1389718 fix receiving a message in proxy sandbox when running OOP, r?kmag draft
authorShane Caraveo <scaraveo@mozilla.com>
Thu, 24 Aug 2017 12:49:56 -0700
changeset 652409 07beefdb3054edc8eecac322944b9d48da3760e9
parent 652136 892c8916ba32b7733e06bfbfdd4083ffae3ca028
child 728080 059b2d3592523a145f5e015561038e0ac05e5dac
push id76047
push usermixedpuppy@gmail.com
push dateThu, 24 Aug 2017 19:50:16 +0000
reviewerskmag
bugs1389718
milestone57.0a1
Bug 1389718 fix receiving a message in proxy sandbox when running OOP, r?kmag MozReview-Commit-ID: xgHIph36SG
toolkit/components/extensions/ExtensionParent.jsm
toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -219,24 +219,24 @@ ProxyMessenger = {
     }
 
     let promise1 = MessageChannel.sendMessage(receiverMM, messageName, data, {
       sender,
       recipient,
       responseType,
     });
 
-    if (!extension.isEmbedded || !extension.remote) {
+    if (!(extension.isEmbedded || recipient.toProxyScript) || !extension.remote) {
       return promise1;
     }
 
-    // If we have a remote, embedded extension, the legacy side is
-    // running in a different process than the WebExtension side.
-    // As a result, we need to dispatch the message to both the parent
-    // and extension processes, and manually merge the results.
+    // If we have a proxy script sandbox or a remote, embedded extension, where
+    // the legacy side is running in a different process than the WebExtension
+    // side. As a result, we need to dispatch the message to both the parent and
+    // extension processes, and manually merge the results.
     let promise2 = MessageChannel.sendMessage(Services.ppmm.getChildAt(0), messageName, data, {
       sender,
       recipient,
       responseType,
     });
 
     let result = undefined;
     let failures = 0;
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
@@ -64,8 +64,9 @@ skip-if = os == "android"
 [test_ext_storage_sync_crypto.js]
 skip-if = os == "android"
 [test_ext_storage_telemetry.js]
 skip-if = os == "android" # checking for telemetry needs to be updated: 1384923
 [test_ext_topSites.js]
 skip-if = os == "android"
 [test_native_messaging.js]
 skip-if = os == "android"
+[test_proxy_scripts.js]
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -47,12 +47,10 @@ tags = webextensions in-process-webexten
 [test_ext_unknown_permissions.js]
 [test_locale_converter.js]
 [test_locale_data.js]
 
 [test_ext_permissions.js]
 skip-if = os == "android" # Bug 1350559
 [test_ext_runtime_sendMessage_args.js]
 
-[test_proxy_scripts.js]
-
 [include:xpcshell-common.ini]
 [include:xpcshell-content.ini]