From b52b6dfb21b4c403501cd7a53dd1a2d9910bdcf5 Mon Sep 17 00:00:00 2001 From: Harry Twyford Date: Tue, 11 Feb 2020 09:49:11 +0000 Subject: [PATCH] Bug 1608336 - Disable Touch Bar for non-chrome windows. r=mikedeboer Differential Revision: https://phabricator.services.mozilla.com/D62259 --HG-- extra : moz-landing-system : lando --- browser/components/touchbar/MacTouchBar.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/browser/components/touchbar/MacTouchBar.js b/browser/components/touchbar/MacTouchBar.js index 3f437d798c82..8c6b270f6b89 100644 --- a/browser/components/touchbar/MacTouchBar.js +++ b/browser/components/touchbar/MacTouchBar.js @@ -294,6 +294,16 @@ class TouchBarHelper { Ci.nsIMutableArray ); + let window = TouchBarHelper.window; + if ( + !window || + !window.isChromeWindow || + window.document.documentElement.getAttribute("windowtype") != + "navigator:browser" + ) { + return layoutItems; + } + // Every input must be updated at least once so that all assets (titles, // icons) are loaded. We keep track of which inputs haven't updated and // run an update on them ASAP.