Skip to content

Commit a27fbf3

Browse files
committed
Fix tabs preferences not disabling in Firefox 147
1 parent 952e5b4 commit a27fbf3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

native/userchrome/profile/chrome/pwa/content/preferences.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
/* Hide the default browser box */
99
/* Not needed because PWAsForFirefox browser installation is not supposed to be made default */
10-
#defaultBrowserBox {
10+
#defaultBrowserBox,
11+
setting-control:has(> #alwaysCheckDefault),
12+
setting-control:has(> #isDefaultPane),
13+
setting-control:has(> #isNotDefaultPane) {
1114
display: none;
1215
}
1316

native/userchrome/profile/chrome/pwa/content/preferences.sys.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ class PwaPreferences {
163163

164164
handleTabsModePreferenceSwitch (onLoad = false) {
165165
function setTabsSectionDisabled (disabled) {
166-
document.querySelector('[data-l10n-id="tabs-group-header"]').closest('groupbox').childNodes.forEach(elem => elem.disabled = disabled);
166+
// Disable the original tabs section
167+
document.querySelector('[data-l10n-id="tabs-group-header"]')?.closest('groupbox').childNodes.forEach(elem => elem.disabled = disabled);
168+
169+
// Disable the new declarative tabs section
170+
document.querySelectorAll('setting-group[groupid="tabs"] moz-checkbox')?.forEach(elem => elem.disabled = disabled);
171+
172+
// Disable the new tab launch type option
167173
document.querySelector('#launchTypeNewTab').disabled = disabled;
168174
}
169175

0 commit comments

Comments
 (0)