commit 5ca469ab2cf2fc07e41a7b47fded1bd7f5df1ea0
parent 9f9deb6f26a1ee9ff39466371e8b5aff85ec5634
Author: Duncan McIntosh <dmcintosh@mozilla.com>
Date: Thu, 9 Oct 2025 21:59:45 +0000
Bug 1986557 - Part 2: Initialize Taskbar Tabs when showing the page action. r=nrishel
This currently ensures that telemetry is sent. In future, it'll reduce the
impact of checking whether the current tab is a Taskbar Tab.
Differential Revision: https://phabricator.services.mozilla.com/D266730
Diffstat:
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/browser/components/taskbartabs/TaskbarTabsPageAction.sys.mjs b/browser/components/taskbartabs/TaskbarTabsPageAction.sys.mjs
@@ -126,12 +126,23 @@ function initVisibilityChanges(aWindow, aElement) {
// Filled in at the end; memoized to avoid performance failures.
let isTaskbarTabsEnabled = false;
- const shouldHide = aLocation =>
- !(
- aLocation instanceof Ci.nsIURL &&
- aLocation.scheme.startsWith("http") &&
- isTaskbarTabsEnabled
+ const shouldHide = aLocation => {
+ if (!isTaskbarTabsEnabled) {
+ return true;
+ }
+
+ // Forcefully initialize Taskbar Tabs. At some point, this will also affect
+ // the page action; in the meantime, ensures that telemetry info is
+ // prepared whenever the pref is enabled.
+ //
+ // This is a promise, but we don't care when it finishes. It's a no-op if
+ // TaskbarTabs already initialized.
+ lazy.TaskbarTabs.waitUntilReady();
+
+ return (
+ !(aLocation instanceof Ci.nsIURL) && !aLocation.scheme.startsWith("http")
);
+ };
aWindow.gBrowser.addProgressListener({
onLocationChange(aWebProgress, aRequest, aLocation) {