@@ -35,16 +35,10 @@ export const TaskbarTabsPageAction = {
3535 * @param {DOMWindow } aWindow - The browser window.
3636 */
3737 init ( aWindow ) {
38- let taskbarTabsEnabled = lazy . TaskbarTabsUtils . isEnabled ( ) ;
3938 let isPopupWindow = ! aWindow . toolbar . visible ;
4039 let isPrivate = lazy . PrivateBrowsingUtils . isWindowPrivate ( aWindow ) ;
4140
42- if (
43- ! taskbarTabsEnabled ||
44- isPopupWindow ||
45- isPrivate ||
46- AppConstants . platform != "win"
47- ) {
41+ if ( isPopupWindow || isPrivate || AppConstants . platform != "win" ) {
4842 lazy . logConsole . info ( "Not initializing Taskbar Tabs Page Action." ) ;
4943 return ;
5044 }
@@ -131,7 +125,8 @@ export const TaskbarTabsPageAction = {
131125 * @param {Element } aElement - The element that makes up the page action.
132126 */
133127function initVisibilityChanges ( aWindow , aElement ) {
134- const shouldHide = aLocation => ! aLocation . scheme . startsWith ( "http" ) ;
128+ const shouldHide = aLocation =>
129+ ! ( aLocation . scheme . startsWith ( "http" ) && lazy . TaskbarTabsUtils . isEnabled ( ) ) ;
135130 aElement . hidden = shouldHide ( aWindow . gBrowser . currentURI ) ;
136131
137132 aWindow . gBrowser . addProgressListener ( {
@@ -141,4 +136,13 @@ function initVisibilityChanges(aWindow, aElement) {
141136 }
142137 } ,
143138 } ) ;
139+
140+ const observer = ( ) => {
141+ aElement . hidden = shouldHide ( aWindow . gBrowser . currentURI ) ;
142+ } ;
143+
144+ Services . prefs . addObserver ( "browser.taskbarTabs.enabled" , observer ) ;
145+ aWindow . addEventListener ( "unload" , function ( ) {
146+ Services . prefs . removeObserver ( "browser.taskbarTabs.enabled" , observer ) ;
147+ } ) ;
144148}
0 commit comments