firefox: port to native vertical tabs

it's not perfect; i can hopefully tweak this more

but committing this now because firefox is insanely fragile about these preferences and i don't know that i could recreate these withoput another hour of testing
This commit is contained in:
2024-12-01 20:51:45 +00:00
parent f1242d28d4
commit 047dc0bd21
2 changed files with 47 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ in
enable = lib.mkDefault false; enable = lib.mkDefault false;
}; };
sidebery = { sidebery = {
enable = lib.mkDefault true; enable = lib.mkDefault false; # firefox 133+ has native vertical tabs (about:config `sidebar.*`)
}; };
sponsorblock = { sponsorblock = {
enable = lib.mkDefault true; enable = lib.mkDefault true;

View File

@@ -204,11 +204,22 @@ in
# N.B.: `overrides.cfg` might be librewolf-specific -- not supported by mainline firefox. # N.B.: `overrides.cfg` might be librewolf-specific -- not supported by mainline firefox.
# firefox does support per-profile `user.js` files which have similar functionality. # firefox does support per-profile `user.js` files which have similar functionality.
# actually, i think this can be expressed in a firefox-compatible manner:
# - <https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig>
fs.".mozilla/firefox/firefox.overrides.cfg".symlink.text = '' fs.".mozilla/firefox/firefox.overrides.cfg".symlink.text = ''
// DEFAULT OPTION VALUES: <https://searchfox.org/mozilla-central/source/modules/libpref/init/all.js>
// common tweaks: <https://librewolf.net/docs/settings/>
//
// use `pref(...)` to force a preference // use `pref(...)` to force a preference
// use `defaultPref(...)` to allow runtime reconfiguration // use `defaultPref(...)` to allow runtime reconfiguration
// use `lockPref(...)` to prevent the preferences from being changed at runtime (incl preventing firefox from updating them itself)
// discover preference names via the `about:config` page // discover preference names via the `about:config` page
// // N.B.: supported option values appear to be:
// - string
// - bool
// - number
// anything else (e.g. arrays, objects) MUST be represented as strings (use backticks for multiline/raw strings)
// if we can't query the revocation status of a SSL cert because the issuer is offline, // if we can't query the revocation status of a SSL cert because the issuer is offline,
// treat it as unrevoked. // treat it as unrevoked.
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do> // see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
@@ -219,6 +230,9 @@ in
// DISABLE DNS OVER HTTPS; use the system resolver. // DISABLE DNS OVER HTTPS; use the system resolver.
defaultPref("network.trr.mode", 5); defaultPref("network.trr.mode", 5);
// enable webGL
defaultPref("webgl.disabled", false);
// scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html> // scrollbar configuration, see: <https://artemis.sh/2023/10/12/scrollbars.html>
// style=4 gives rectangular scrollbars // style=4 gives rectangular scrollbars
// could also enable "always show scrollbars" in about:preferences -- not sure what the actual pref name for that is // could also enable "always show scrollbars" in about:preferences -- not sure what the actual pref name for that is
@@ -239,8 +253,34 @@ in
defaultPref("widget.use-xdg-desktop-portal.open-uri", 1); defaultPref("widget.use-xdg-desktop-portal.open-uri", 1);
defaultPref("browser.toolbars.bookmarks.visibility", "never"); defaultPref("browser.toolbars.bookmarks.visibility", "never");
// enable vertical tab view, like Sidebery (but loses the top-window horizontal tabs)
// defaultPref("browser.toolbarbuttons.introduced.sidebar-button", true);
defaultPref("sidebar.animation.enable", false);
defaultPref("sidebar.backupState", `{"width":"","command":"","expanded":true,"hidden":false}`);
defaultPref("sidebar.main.tools", "history");
defaultPref("sidebar.revamp", true);
defaultPref("sidebar.verticalTabs", true);
// vvv default is for tabs button to toggle tab icons v.s. tab icons + description.
// "hide-sidebar" => toggle between tab icons + description and NO visibility at all.
defaultPref("sidebar.visibility", "hide-sidebar");
// configure which extensions are visible by default (TODO: requires a lot of trial and error) // configure which extensions are visible by default (TODO: requires a lot of trial and error)
// defaultPref("browser.uiCustomization.state", ...); // defaultPref("browser.uiCustomization.state", ...);
// defaultPref("browser.uiCustomization.horizontalTabStrip", ["firefox-view-button","tabbrowser-tabs","new-tab-button","alltabs-button"]);
defaultPref("browser.uiCustomization.state", `{"placements":{
"widget-overflow-fixed-list":[],
"unified-extensions-area":["browserpass_maximbaz_com-browser-action","magnolia_12_34-browser-action"],
"nav-bar":["firefox-view-button","new-tab-button","alltabs-button","unified-extensions-button","urlbar-container","forward-button","back-button","ublock0_raymondhill_net-browser-action","sponsorblocker_ajay_app-browser-action","sidebar-button"],
"toolbar-menubar":["menubar-items"],
"TabsToolbar":[],
"vertical-tabs":["tabbrowser-tabs"],"PersonalToolbar":["import-button","personal-bookmarks"]},
"seen":["save-to-pocket-button","developer-button","browserpass_maximbaz_com-browser-action","magnolia_12_34-browser-action","ublock0_raymondhill_net-browser-action","sponsorblocker_ajay_app-browser-action"],
"dirtyAreaCache":["nav-bar","TabsToolbar","vertical-tabs","PersonalToolbar","unified-extensions-area","toolbar-menubar"],
"currentVersion":20,
"newElementCount":0
}`);
defaultPref("browser.uiCustomization.horizontalTabstrip", `["firefox-view-button","tabbrowser-tabs"]`);
// auto-open specific URI schemes without prompting: // auto-open specific URI schemes without prompting:
defaultPref("network.protocol-handler.external.xdg-open", true); // for firefox-xdg-open extension defaultPref("network.protocol-handler.external.xdg-open", true); // for firefox-xdg-open extension
@@ -253,10 +293,15 @@ in
// - type `w thing` into the URL bar to search "thing" on Wikipedia. // - type `w thing` into the URL bar to search "thing" on Wikipedia.
// - to add a search shortcut: right-click any search box => "Add a keyword for this search". // - to add a search shortcut: right-click any search box => "Add a keyword for this search".
// - to update the static bookmarks, export via Hamburger => bookmarks => manage bookmarks => Import and Backup => Export Bookmarks To HTML // - to update the static bookmarks, export via Hamburger => bookmarks => manage bookmarks => Import and Backup => Export Bookmarks To HTML
defaultPref("browser.bookmarks.addedImportButton", true);
defaultPref("browser.places.importBookmarksHTML", true); defaultPref("browser.places.importBookmarksHTML", true);
defaultPref("browser.bookmarks.file", "~/.mozilla/firefox/bookmarks.html"); defaultPref("browser.bookmarks.file", "~/.mozilla/firefox/bookmarks.html");
defaultPref("browser.startup.homepage", "https://uninsane.org/places"); defaultPref("browser.startup.homepage", "https://uninsane.org/places");
// browser.engagement.sidebar-button.has-used
// browser.migration.version = 150
''; '';
fs.".mozilla/firefox/bookmarks.html".symlink.target = ./bookmarks.html; fs.".mozilla/firefox/bookmarks.html".symlink.target = ./bookmarks.html;