commit 2be355c689d5f12f51b7ac63af0d6bc6955301ef
parent f6f9ce3e625c0cb0fefd214afa033aa7a0718830
Author: Henrik Skupin <mail@hskupin.info>
Date: Thu, 18 Dec 2025 12:29:33 +0000
Bug 1944570 - [remote] Allow loading the MessageHandlerFrameActor for chrome scope. r=Sasha
Differential Revision: https://phabricator.services.mozilla.com/D276801
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/remote/shared/messagehandler/test/browser/browser.toml b/remote/shared/messagehandler/test/browser/browser.toml
@@ -34,6 +34,9 @@ prefs = ["remote.messagehandler.modulecache.useBrowserTestRoot=true"]
["browser_session_data.js"]
["browser_session_data_browser_element.js"]
+skip-if = [
+ "true", # Bug 1713440
+]
["browser_session_data_constructor_race.js"]
diff --git a/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs b/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameActor.sys.mjs
@@ -8,6 +8,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
ActorManagerParent: "resource://gre/modules/ActorManagerParent.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
+ RemoteAgent: "chrome://remote/content/components/RemoteAgent.sys.mjs",
});
ChromeUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
@@ -27,9 +28,17 @@ const FRAME_ACTOR_CONFIG = {
},
},
allFrames: true,
- messageManagerGroups: ["browsers"],
};
+// Bug 1713440: Workaround until the MessageHandler
+// supports chrome browsing contexts.
+if (lazy.RemoteAgent.allowSystemAccess) {
+ FRAME_ACTOR_CONFIG.includeChrome = true;
+} else {
+ // Without system access limit loading the actor for content browsers only.
+ FRAME_ACTOR_CONFIG.messageManagerGroups = ["browsers"];
+}
+
/**
* MessageHandlerFrameActor exposes a simple registration helper to lazily
* register MessageHandlerFrame JSWindow actors.