summaryrefslogtreecommitdiffstats
path: root/mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs')
-rw-r--r--mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs16
1 files changed, 16 insertions, 0 deletions
diff --git a/mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs b/mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs
index ec927b0af6..f2dd7590ab 100644
--- a/mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs
+++ b/mobile/android/modules/geckoview/GeckoViewSettings.sys.mjs
@@ -6,6 +6,10 @@ import { GeckoViewModule } from "resource://gre/modules/GeckoViewModule.sys.mjs"
const lazy = {};
+ChromeUtils.defineESModuleGetters(lazy, {
+ ExtensionParent: "resource://gre/modules/ExtensionParent.sys.mjs",
+});
+
ChromeUtils.defineLazyGetter(lazy, "MOBILE_USER_AGENT", function () {
return Cc["@mozilla.org/network/protocol;1?name=http"].getService(
Ci.nsIHttpProtocolHandler
@@ -74,6 +78,18 @@ export class GeckoViewSettings extends GeckoViewModule {
this.viewportMode = settings.viewportMode;
this.useTrackingProtection = !!settings.useTrackingProtection;
+ if (settings.isExtensionPopup) {
+ // NOTE: Only add the webextension-view-type and emit extension-browser-inserted
+ // once, an extension popup should never change webextension-view-type once set.
+ if (!this.browser.hasAttribute("webextension-view-type")) {
+ this.browser.setAttribute("webextension-view-type", "popup");
+ lazy.ExtensionParent.apiManager.emit(
+ "extension-browser-inserted",
+ this.browser
+ );
+ }
+ }
+
// When the page is loading from the main process (e.g. from an extension
// page) we won't be able to query the actor here.
this.getActor("GeckoViewSettings")?.sendAsyncMessage(