feat: add option to disable close button on tabs

(cherry picked from commit ff68d8fd9ff678e6cf7efb6d662728b223322ba4)
This commit is contained in:
Alex Kontos
2024-03-28 15:57:56 +00:00
parent ce2d0a248e
commit da60e2f549
3 changed files with 16 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ pref("app.update.url.override", "", sticky); // Override URL for application upd
// Defines browser behavior on startup and general UI settings. // Defines browser behavior on startup and general UI settings.
pref("browser.startup.page", 3); // 0=blank, 1=home, 2=last visited page, 3=resume previous session. pref("browser.startup.page", 3); // 0=blank, 1=home, 2=last visited page, 3=resume previous session.
pref("browser.privateTab.showNewTabButton", false); // Show new private tab button next to existing new tab buttons pref("browser.privateTab.showNewTabButton", false); // Show new private tab button next to existing new tab buttons
pref("browser.tabs.closeButtons", false); // Hide close button on tabs
pref("browser.tabs.pinnedIconOnly", true); // Pinned tabs show only an icon, no text. pref("browser.tabs.pinnedIconOnly", true); // Pinned tabs show only an icon, no text.
pref("browser.tabs.warnOnClose", true); // Warn user when attempting to close multiple tabs. pref("browser.tabs.warnOnClose", true); // Warn user when attempting to close multiple tabs.
// Stores the state of toolbar customizations (e.g., button placements). // Stores the state of toolbar customizations (e.g., button placements).

View File

@@ -90,6 +90,15 @@ export const WaterfoxGlue = {
lazy.BrowserUtils.registerOrUnregisterSheet(uri, !isEnabled); 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) { async getChromeManifest(manifest) {

View File

@@ -181,3 +181,9 @@
#preferences-body .main-content { #preferences-body .main-content {
overflow-x: hidden !important; overflow-x: hidden !important;
} }
@supports -moz-bool-pref("browser.tabs.closeButtons") {
.tab-close-button {
display: none !important
}
}