summaryrefslogtreecommitdiffstats
path: root/mobile/android/components/extensions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /mobile/android/components/extensions
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/components/extensions')
-rw-r--r--mobile/android/components/extensions/ext-android.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/mobile/android/components/extensions/ext-android.js b/mobile/android/components/extensions/ext-android.js
index 4524c4529b..13f91fb617 100644
--- a/mobile/android/components/extensions/ext-android.js
+++ b/mobile/android/components/extensions/ext-android.js
@@ -129,8 +129,7 @@ class WindowTracker extends WindowTrackerBase {
getCurrentWindow(context) {
// In GeckoView the popup is on a separate window so getCurrentWindow for
// the popup should return whatever is the topWindow.
- // TODO: Bug 1651506 use context?.viewType === "popup" instead
- if (context?.currentWindow?.moduleManager.settings.isPopup) {
+ if (context?.viewType === "popup") {
return this.topWindow;
}
return super.getCurrentWindow(context);
@@ -283,6 +282,18 @@ class TabTracker extends TabTrackerBase {
};
}
+ getBrowserDataForContext(context) {
+ if (["tab", "background"].includes(context.viewType)) {
+ return this.getBrowserData(context.xulBrowser);
+ } else if (context.viewType === "popup") {
+ const chromeWindow = windowTracker.getCurrentWindow(context);
+ const windowId = chromeWindow ? windowTracker.getId(chromeWindow) : -1;
+ return { tabId: -1, windowId };
+ }
+
+ return { tabId: -1, windowId: -1 };
+ }
+
get activeTab() {
const window = windowTracker.topWindow;
if (window) {
@@ -467,8 +478,7 @@ class Window extends WindowBase {
isCurrentFor(context) {
// In GeckoView the popup is on a separate window so the current window for
// the popup is whatever is the topWindow.
- // TODO: Bug 1651506 use context?.viewType === "popup" instead
- if (context?.currentWindow?.moduleManager.settings.isPopup) {
+ if (context?.viewType === "popup") {
return mobileWindowTracker.topWindow == this.window;
}
return super.isCurrentFor(context);