Skip to content

Commit

Permalink
Add option to disable close button on tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlex94 committed Apr 16, 2024
1 parent 662120e commit 96074df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions waterfox/browser/app/profile/00-waterfox.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pref("browser.closeShortcut.disabled", false);

// Extensibles prefs
pref("browser.tabs.duplicateTab", true);
pref("browser.tabs.closeButtons", false);
pref("browser.tabs.copyurl", true);
pref("browser.tabs.copyallurls", false);
pref("browser.tabs.copyurl.activetab", false);
Expand Down
9 changes: 9 additions & 0 deletions waterfox/browser/components/WaterfoxGlue.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ export const WaterfoxGlue = {
lazy.BrowserUtils.registerOrUnregisterSheet(uri, !isEnabled);
}
);
this.styleSheetChanges = lazy.PrefUtils.addObserver(
"browser.tabs.closeButtons",
() => {
// Pref being true actually means we need to unload the sheet, so invert.
const uri = "chrome://browser/skin/waterfox/general.css";
lazy.BrowserUtils.unregisterStylesheet(uri);
lazy.BrowserUtils.registerStylesheet(uri);
}
)
},

async getChromeManifest(manifest) {
Expand Down
6 changes: 6 additions & 0 deletions waterfox/browser/themes/waterfox/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,10 @@
/* Prevent any horizontal scrolling on about:preferences */
#preferences-body .main-content {
overflow-x: hidden !important;
}

@supports -moz-bool-pref("browser.tabs.closeButtons") {
.tab-close-button {
display: none !important
}
}

0 comments on commit 96074df

Please sign in to comment.