summaryrefslogtreecommitdiffstats
path: root/browser/components/extensions/parent/ext-browser.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/extensions/parent/ext-browser.js')
-rw-r--r--browser/components/extensions/parent/ext-browser.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/browser/components/extensions/parent/ext-browser.js b/browser/components/extensions/parent/ext-browser.js
index d2f72d4f46..e7a516dcd3 100644
--- a/browser/components/extensions/parent/ext-browser.js
+++ b/browser/components/extensions/parent/ext-browser.js
@@ -82,7 +82,7 @@ global.openOptionsPage = extension => {
extension.id
)}/preferences`;
- return window.BrowserOpenAddonsMgr(viewId);
+ return window.BrowserAddonUI.openAddonsMgr(viewId);
};
global.makeWidgetId = id => {
@@ -709,6 +709,23 @@ class TabTracker extends TabTrackerBase {
};
}
+ getBrowserDataForContext(context) {
+ if (["tab", "background"].includes(context.viewType)) {
+ return this.getBrowserData(context.xulBrowser);
+ } else if (["popup", "sidebar"].includes(context.viewType)) {
+ // popups and sidebars are nested inside a browser element
+ // (with url "chrome://browser/content/webext-panels.xhtml")
+ // and so we look for the corresponding topChromeWindow to
+ // determine the windowId the panel belongs to.
+ const chromeWindow =
+ context.xulBrowser?.ownerGlobal?.browsingContext?.topChromeWindow;
+ const windowId = chromeWindow ? windowTracker.getId(chromeWindow) : -1;
+ return { tabId: -1, windowId };
+ }
+
+ return { tabId: -1, windowId: -1 };
+ }
+
get activeTab() {
let window = windowTracker.topWindow;
if (window && window.gBrowser) {