From 7fb023b9505a06bba88504b1db4fa0d22e4236fd Mon Sep 17 00:00:00 2001 From: Tanvir Date: Fri, 12 Jul 2024 22:06:44 +0600 Subject: [PATCH 1/2] remove tabbar import --- chrome/userChrome.css | 1 - 1 file changed, 1 deletion(-) diff --git a/chrome/userChrome.css b/chrome/userChrome.css index 919ddc1..a43f29b 100644 --- a/chrome/userChrome.css +++ b/chrome/userChrome.css @@ -1,6 +1,5 @@ @import "browser/icons.css"; @import "bar/buttons.css"; -@import "bar/tabbar.css"; @import "bar/toolbar.css"; @import "bar/sidebar.css"; @import "bar/urlbar.css"; From c984d37c23fa3b85a01fc65fc2139022746df0ca Mon Sep 17 00:00:00 2001 From: Tanvir Date: Fri, 12 Jul 2024 22:19:16 +0600 Subject: [PATCH 2/2] init support for window control buttons at the bottom --- chrome/bar/toolbar.css | 316 +++++++++++++++----- misc/screenshots/window-control-buttons.png | Bin 0 -> 1947 bytes readme.md | 169 +---------- 3 files changed, 253 insertions(+), 232 deletions(-) create mode 100755 misc/screenshots/window-control-buttons.png diff --git a/chrome/bar/toolbar.css b/chrome/bar/toolbar.css index 28b8ffd..2c9d831 100644 --- a/chrome/bar/toolbar.css +++ b/chrome/bar/toolbar.css @@ -1,37 +1,163 @@ -/* Based on: */ -/* Move the main toolbar (#nav-bar) to the bottom */ +/* Based on: */ + +/* Necessary to make themeing to work */ +#navigator-toolbox { + --toolbar-bgcolor: rgba(32, 32, 32, 0); +} + +/* Fix private browsing indicator icon in private browsing mode */ +#private-browsing-indicator-with-label > label { + visibility: collapse !important; +} + +#private-browsing-indicator-with-label { + visibility: visible !important; + z-index: 1 !important; + margin-top: 4px !important; + margin-right: 5px !important; + transform: scale(0.9) !important; +} + +/* Space reserved for window controls (Windows 10/11) */ +:root:is([tabsintitlebar], [sizemode="fullscreen"]) { + --uc-window-control-width: 140px; + --uc-window-drag-space-pre: 30px; + --uc-window-drag-space-post: -30px; +} + +:root:is([tabsintitlebar][sizemode="maximized"], [sizemode="fullscreen"]) { + --uc-window-drag-space-pre: 0px; +} + +@media (-moz-platform: windows-win7), (-moz-platform: windows-win8) { + :root:is([tabsintitlebar], [sizemode="fullscreen"]) { + --uc-window-control-width: 105px; + } +} + +@media (-moz-gtk-csd-available) { + :root:is([tabsintitlebar], [sizemode="fullscreen"]) { + --uc-window-control-width: 84px; + } +} + +@media (-moz-platform: macos) { + :root:is([tabsintitlebar], [sizemode="fullscreen"]) { + --uc-window-control-width: 72px; + } +} + +.titlebar-buttonbox, +#window-controls { + color: var(--toolbar-color); +} + +:root[sizemode="fullscreen"] .titlebar-buttonbox-container { + display: none; +} + +:root[sizemode="fullscreen"] #navigator-toolbox { + position: relative; +} + +:root[sizemode="fullscreen"] + #TabsToolbar + > .titlebar-buttonbox-container:last-child, +:root[sizemode="fullscreen"] #window-controls { + position: absolute; + display: flex; + top: 0; + right: 0; + height: 40px; +} + +:root[sizemode="fullscreen"] + #TabsToolbar + > .titlebar-buttonbox-container:last-child, +:root[uidensity="compact"][sizemode="fullscreen"] #window-controls { + height: 32px; +} + +#nav-bar { + border-inline: var(--uc-window-drag-space-pre, 0px) solid transparent; + border-inline-style: solid !important; + border-right-width: calc( + var(--uc-window-control-width, 0px) / 3 + + var(--uc-window-drag-space-post, 0px) + ); + margin-right: var(--uc-window-control-width) !important; + background-clip: border-box !important; + z-index: 100 !important; +} + +/* Rules for window controls on left layout */ +@media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"), + (-moz-gtk-csd-reversed-placement), + (-moz-platform: macos) { + :root[tabsintitlebar="true"] #nav-bar { + border-inline-width: calc( + var(--uc-window-control-width, 0px) + + var(--uc-window-drag-space-post, 0px) + ) + var(--uc-window-drag-space-pre, 0px); + } + + :root[sizemode="fullscreen"] + #TabsToolbar + > .titlebar-buttonbox-container:last-child, + :root[sizemode="fullscreen"] #window-controls { + right: unset; + } +} + +@media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled") { + .titlebar-buttonbox-container { + order: -1 !important; + } + + .titlebar-buttonbox { + flex-direction: row-reverse; + } +} + @-moz-document url(chrome://browser/content/browser.xhtml) { - :root:not([inFullscreen]) { - --uc-bottom-toolbar-height: calc(40px + var(--toolbarbutton-outer-padding)); + #titlebar { + -moz-appearance: none !important; } - :root[uidensity="compact"]:not([inFullscreen]) { - --uc-bottom-toolbar-height: calc(32px + var(--toolbarbutton-outer-padding)); + #navigator-toolbox > div { + display: contents; } + .global-notificationbox, + #mainPopupSet, #browser, - #customization-container { - margin-bottom: var(--uc-bottom-toolbar-height, 0px); + #customization-container, + #tab-notification-deck { + order: -1; } - #nav-bar { - position: fixed !important; - bottom: 0px; - /* For some reason -webkit-box behaves internally like -moz-box, - but can be used with fixed position. - display: flex would work too but it breaks extension menus. */ - display: -webkit-box; - width: 100%; - z-index: 1; + /* Remove the next row if you want tabs to be the top-most row */ + #titlebar { + order: 2; } - #nav-bar-customization-target { - -webkit-box-flex: 1; + + #toolbar-menubar { + position: fixed; + display: flex; + width: 100vw; + top: 0px; + -moz-window-dragging: drag; } - /* Fix panels sizing */ - .panel-viewstack { - max-height: unset !important; + /* Remove bottom border that won't do anything useful when at bottom of the window */ + #navigator-toolbox { + border-bottom: none !important; + } + + #toolbar-menubar > spacer { + flex-grow: 1; } #urlbar[breakout][breakout-extend] { @@ -44,6 +170,104 @@ .urlbarView-body-inner { border-top-style: none !important; } + + #toolbar-menubar > .titlebar-buttonbox-container { + order: 1000; + } + + /* Fix panels sizing */ + .panel-viewstack { + max-height: unset !important; + } + + /* Fullscreen mode support */ + #navigator-toolbox[inFullscreen] { + margin-top: 0 !important; + } + + #navigator-toolbox[inFullscreen][style*="margin-top"] { + visibility: collapse; + } + + #fullscr-toggler { + bottom: 0; + top: unset !important; + } + + #navigator-toolbox { + bottom: 0px; + transform-origin: bottom; + } + + #main-window > body > box { + margin-top: 0 !important; + } + + #toolbar-menubar { + z-index: 1; + background-color: var(--lwt-accent-color, #202020); + } + + :root[BookmarksToolbarOverlapsBrowser] #navigator-toolbox { + margin-block: calc(-1 * var(--bookmarks-toolbar-height)) 0 !important; + } + + :root[BookmarksToolbarOverlapsBrowser] .newTabBrowserPanel { + padding-block: 0 var(--bookmarks-toolbar-height) !important; + } + + #toolbar-menubar #menubar-items { + padding-left: 10px !important; + } + + #toolbar-menubar { + background: transparent !important; + position: static; + display: flex; + margin-top: 0px !important; + } + + #titlebar { + flex-direction: column-reverse; + } +} + +.titlebar-buttonbox { + z-index: 10000 !important; +} + +/* Hide everything except the window controls on tab bar */ +#TabsToolbar tab, +#TabsToolbar-customization-target, +#firefox-view-button, +.tabs-alltabs-button { + visibility: hidden !important; + background: transparent !important; +} + +#TabsToolbar .titlebar-buttonbox-container { + margin-top: 4px !important; + margin-bottom: 0px !important; +} + +#nav-bar { + margin-left: 30px !important; + /* margin-right: 10px !important; */ + margin-bottom: -36px !important; +} + +#PersonalToolbar { + background: transparent !important; + order: -1; +} + +/* fix issue with bottom of window getting cut off when going into new tab */ +:root[BookmarksToolbarOverlapsBrowser] .newTabBrowserPanel { + margin-top: -28px !important; +} + +:root[BookmarksToolbarOverlapsBrowser] #sidebar-box { + margin-top: -28px !important; } /* Show bookmarks toolbar when urlbar is focused */ @@ -70,51 +294,3 @@ visibility: visible; transition: opacity 0.4s ease-in-out, visibility 0s linear 0.3s; } - -/* Based on: */ - -/* Auto Hide Toolbar */ -/* Breaks on Firefox 113.0+ */ -/* -#navigator-toolbox-background { - height: 0 !important; -} - -#titlebar { - display: none !important; -} - -.titlebar-buttonbox-container { - display: none !important; -} - -#navigator-toolbox:not(:hover) { - --is-bar-visible: hidden; - opacity: 0 !important; - height: 10px; - transition: height 300ms ease-in-out, opacity 300ms ease-in-out; -} - -#navigator-toolbox { - position: relative; - z-index: 1; - overflow: var(--is-bar-visible); -} - -#navigator-toolbox:hover { - height: 40px; - opacity: 1 !important; - transition: opacity 200ms ease-in-out; -} - -#navigator-toolbox:focus-within { - height: 40px; - opacity: 1 !important; - transition: opacity 200ms ease-in-out; - --is-bar-visible: visible; -} - -toolbarbutton[open="true"] { - --is-bar-visible: visible !important; -} -*/ diff --git a/misc/screenshots/window-control-buttons.png b/misc/screenshots/window-control-buttons.png new file mode 100755 index 0000000000000000000000000000000000000000..4c280789166b466329728410bfdea3a2a6a951be GIT binary patch literal 1947 zcmV;M2W0q(P)tsZBFwFHSXO6INbUF}vQ3CMQML&YC(1S<;zZdd zM4Twwgou-J|!-NOA6+{3;mF?VBpWW!}T$J9Tv>voI9vTfUrw6s)y559TJrYD|^b>7n0*a#paBZFJLe7TXYT5`F3!v+(# z92ORqkeI+N8}z9F=DzsCfztgCk9e4`azvDvKsSI-a=Dyk{{hg`-6NGs`8~Kop>STU zs=CnH+6usst_N_jwyve6m9JV!NxCUhr~J6H=*EpswOaM-Nz3U|rvVJU(}swMq3iP2 zE?k(?+uO@mQ6e&e@3*tFUpag36gMgcV6}Duu-U8txQ(aJSTeIRy)Tsfbn57sSjX4% z&&>s(R4Nk^5&#@IdIW$}Dm_s8llQeUGSUHzA3xq;(8tHeH#9UxM@IoD-n-ASPeNkC z@^{|yz7`QHiO_$iQguzG*<5(==Q03RYgcu34Yxfm?kSZ@4ZvueF?-JJabx3sQGMF9 zsaw9@1RyKxEi z8+&?sQd9Kp?SFYwj);KU->D?{F}YkWKlpQ*#bR;U?g%*mUi$45CyxyuK8#zwSX*Z_ z&IX{@rvk8At>@031(2Su_rB1~nKN91Z7wjcS(C>tfAaB4r9xqRb`}7cOqQIITvEKx z%~43m6MVLiBoDENeCwX|<7K$BhLrefl)Y_Py9qu+_t>3$hmattFc_Z+K(b zoB#Kv`ylviKWm&bV#Ff=7QdRaapU^z?8QDR)Y8)Gh$Z8jsl2| zj?!u)Jsja4$?m=i*wE16a+S_zvudNF`uh69!os?{yS=X%A_fYu=h*Y^jb(4T%`m^g zh6u8K^=k9gtIYt^YL#hyp6?1JKka%`&0sKa3uWcyxYLJwufG1SdujRkrro>usMM;7 z6DQ_mFTQr|T1-rg%~WXU?1n@{8obGs_J^j(Gbb z*bqUsRVvkjtcCrrlk?6o*}nY86#ywI$=q|@M~?miASE@0VR(Bp*R3;c+?3BP%jI&D zDbHkbGuKFc%gUd0&eJ3O5vY9-Q+_@clN+vNLB+_prmPS#%kuKRs;{r- zZg-6y9Rr}etlW9^Vr|{(HEX@E1>pVnR@BtgE?xS1|Br>(Y_{cZzkBFV883xMKse8_ z2fA|ZCBZ+JmbY&0oH?^S@AKmiJ6Ejuz(4Kbmqs(hXf)<5%8rWC+U@rG`iAnd!)9~g z_3PII-86yOQLxp+JupAd9eBS7=JvTX!DpM0dl5WW^?dQ{3T2xRaiagDmyi%b*(OAs zDBFaH2R9n$P__vXHiijjS+@Un$~Gaw#z+~v-QIsYWt$LTlgSvjAN8ed6Cz-Ylu@e{ zU0q$yGi?A8iG;FEh=6G{s(7XYh(NZN1PA(g9sC^MBbRygK-s>ZF*%(FBzT0>+31pI3><6#Oh~;o zWFT}J_}_iM=L2=%E`sh_8l7Y$cm&(o=-eI;BXbV*+XM){lbH0^KiHmkrhc1{0R`dN z=r-Z*?|}tj>xuu-X&?xmgYB{qbp5uVQ9{VQ^Zr^IJa*mGZxdk)wG;S1XWjHXIk`)y hB}AYG3bxyC-@m%|VD5zRO9TJ_002ovPDHLkV1o1X;L`vA literal 0 HcmV?d00001 diff --git a/readme.md b/readme.md index 96c7aeb..2b608a8 100644 --- a/readme.md +++ b/readme.md @@ -1,169 +1,14 @@ # About -My tailor-fitted, highly customized, and advanced [Firefox](https://www.mozilla.org/en-US/firefox) configuration. +This branch adds window control buttons at the bottom. -> [!NOTE] -> This repository is not meant to be used as a whole but rather as a reference for my own configuration. I do not recommend using it as is, as it is not meant to be used by anyone else. I do not provide any support for this repository. If you want to use it, you are on your own. -> -> Firefox occasionally changes its codebase, which may break some of the configurations on newer versions of Firefox. I try to keep this repository updated, but I cannot guarantee that everything will work as expected. +![Window Control Buttons](misc/screenshots/window-control-buttons.png) -> [!TIP] -> Disable Telemetry and Data Collection: Ensure that all telemetry and data collection features are turned off in Firefox. You can use my `user.js` as a reference, and explore other `user.js` files and hardened Firefox configurations for additional security. -> -> Cookie Management: With cookie isolation enabled, clearing cookies may be less effective. Instead, consider using temporary containers for better privacy. -> -> Customizing Firefox: For detailed guidance on customizing Firefox to suit your needs, refer to the [Customizing Firefox](#customizing-firefox) section. -> -> JPEG XL (JXL): Firefox 128 now supports JPEG XL images. You can use the [JPEG XL](https://jpeg.org/jpegxl/) format for images to save bandwidth and improve loading times. It is available as `image.jxl.enabled` in `about:config` preference. You can enable it by setting it to `true`. Note that it is currently an experimental feature in Firefox 128+. +> [!WARNING] +> It's currently experimental and may not work as expected. Please report any issues you find. -## Features +## Credits -- Smooth scrolling -- Animations -- Sidebar (Sidebery) with auto-hide mechanism -- Hovercards -- Scrollable through tabs -- Search bar for tabs in the sidebar -- Custom toolbar button icons -- Custom (bouncing) loading indicator animation -- Only icons in extensions menu -- Icons in main menu items -- Round UI items -- Dark UI in pages (e.g., addons.mozilla.org) -- Custom centered status panel at the top with animations -- Compact about:config list -- Compact items and menus (e.g., context menu) -- Various sidebar (Sidebery, Tree Style Tab) tweaks, including auto-hide -- Consistent and matching colors across various elements and the UI -- Glow and scale effect on hover on toolbar buttons -- Findbar as floating box at the top -- Hidden horizontal tab bar -- Bottom main toolbar and search/url bar -- Hidden bookmarks toolbar visible on hover -- Custom colors on various items -- Centered text in the url bar -- Colored overlay on the url bar based on the type of connection -- RGB animation on the url bar address -- Global font family and size -- Other various fixes and tweaks -- Custom addons configuration -- Userscripts -- Userstyles -- Custom theme -- Various performance and privacy tweaks -- JPEG XL (JXL) enabled by default +It's based on [FrameUIForFirefox](https://github.com/FineFuturity/FrameUIForFirefox/), created by [FineFuturity](https://github.com/FineFuturity). -## Screenshots and GIFs - -![Firefox-1](misc/screenshots/firefox-1.png) -![Firefox-2](misc/screenshots/firefox-2.png) -![Page loading animation](misc/gifs/page-loading-animation.gif) -![RGB URL bar](misc/gifs/rgb-urlbar.gif) -![Navigation Buttons](misc/gifs/navigation-buttons.gif) -![Other buttons](misc/gifs/other-buttons.gif) -![Findbar](misc/screenshots/findbar.png) -![Status Panel](misc/screenshots/statuspanel.png) -![Searchbar](misc/screenshots/searchbar.png) -![Downloads Menu](misc/screenshots/downloads-menu.png) - -## File Locations - -Both `user.js` and `chrome` files should be placed in the following locations depending on your operating system: - -| OS | Location | -| ------- | ---------------------------------------------------------------------- | -| Linux | `~/.mozilla/firefox/.default/` | -| Windows | `%APPDATA%\Mozilla\Firefox\Profiles\.default/` | -| macOS | `~/Library/Application Support/Firefox/Profiles/.default/` | - -Replace `` with your Firefox profile ID. - -For addons and userscripts configuration, you can find them in the respective directories. - -### Finding Your Default Profile - -- **Linux**: You can find your default profile in `~/.mozilla/firefox/profiles.ini` OR go to `about:support` in Firefox, you'll see your default profile directory in the `Profile Directory` section. Click on `Open Directory`. - -- **Windows**: Your default profile can be found at `%APPDATA%\Mozilla\Firefox\Profiles\`. Alternatively, navigate to `about:support` in Firefox, and click on `Open Folder` next to the `Profile Directory` section. - -- **macOS**: Locate your default profile in `~/Library/Application Support/Firefox/Profiles/`. Or, go to `about:support` in Firefox, and click on `Show in Finder` next to the `Profile Directory` section. - -## Enabling `userChrome.css` and `userContent.css` - -Enable `userChrome.css` and `userContent.css` support in Firefox: - -1. Go to `about:config` and click the "Accept the Risk and Continue" button. -2. In the search box, type `toolkit.legacyUserProfileCustomizations.stylesheets`. -3. Double-click the `toolkit.legacyUserProfileCustomizations.stylesheets` entry to set its value to **`true`**. -4. Restart Firefox. - -## Additional Tweaks - -### Toolbar - -Go to `Open application menu > More tools > Customize toolbar...` and make the following changes: - -![Toolbar Settings](misc/screenshots/toolbar.png) - -Set Density to `Normal` and uncheck Title Bar. - -To disable bookmarks toolbar: - -![Bookmarks Toolbar](misc/screenshots/bookmarks-toolbar.png) - -## Customizing Firefox - -If you're planning to make multiple and extensive alterations to your UI, learning how to use the [Browser Toolbox](https://firefox-source-docs.mozilla.org/devtools-user/browser_toolbox/index.html) is essential. It allows you to create modifications to the UI and fix those modifications if a newer version of the Firefox codebase causes issues. - -While the Browser Toolbox isn't particularly user-friendly to set up or use initially, perseverance will pay off as it is key to inspecting Firefox's UI. Check out the [r/firefoxcss wiki](https://www.reddit.com/r/FirefoxCSS/wiki/index/) and search the subreddit for specific posts. - -Investigate how to use Mozilla's source code indexing tool [SearchFox](https://searchfox.org) as well. - -Most of your "How to" questions can be answered by the Browser Toolbox and SearchFox, though it takes some time to understand them both from scratch. - -As an alternative to using the Browser Toolbox and SearchFox, you can explore the wealth of information in subreddits like [r/FirefoxCSS](https://www.reddit.com/r/FirefoxCSS), [r/firefox](https://www.reddit.com/r/firefox/), and [r/unixporn](https://www.reddit.com/r/unixporn/). Finding the precisely relevant information often requires diligent searching with a variety of **keywords**. A useful trick is to search with a section of CSS userstyle, a selector, or a rule related to the UI element you want to modify. You can also look on GitHub, GitLab, and other code hosting sites, or simply use your favorite search engine. There are various articles and blogs online as well. Discord servers like [unixporn](https://discord.com/invite/unixporn) can be helpful too. - -Look for specific topics on GitHub: [userchrome](https://github.com/topics/userchrome), [firefox-css](https://github.com/topics/firefox-css), [firefox-tweaks](https://github.com/topics/firefox-tweaks), [userchrome-styles](https://github.com/topics/userchrome-styles), [userchromecss](https://github.com/topics/userchromecss). - -More handy resources: [userchrome.org](https://www.userchrome.org), [FirefoxCSS Store](https://firefoxcss-store.github.io), [Mozilla Bugzilla](https://bugzilla.mozilla.org), [The other guide to CSS hacking](https://mrotherguy.github.io/ToyfoCSS/). - -### Live Debug and Update `userChrome.css` - -1. Set `devtools.debugger.remote-enabled` to `true` in `about:config`. -2. Set `devtools.chrome.enabled` to `true` in `about:config`. -3. Open remote debugger using **Ctrl+Alt+Shift+I**. -4. Allow the incoming connection. -5. Select Style Editor tab, then open `userChrome.css`. -6. Edit and save the file for it to take effect (hot reload). - -## Theme - -The theme I'm currently using: [RosyBrown Dark by Me](https://addons.mozilla.org/en-US/firefox/addon/rosybrown_dark/) - -## Addons - -You can find a list of addons I use [here](https://addons.mozilla.org/en-US/firefox/collections/17970682/TAT-Collection/). - -## Userscripts - -![Userscripts](misc/screenshots/violentmonkey-userscripts.png) - -## Stylus Styles - -![Stylus styles](misc/screenshots/stylus-userstyles.png) - -## Ublock Origin - -Enabled all filters except for the regional ones. Added some custom filters: - -![Ublock origin](misc/screenshots/ublock-origin-custom-filters.png) - -## Notable Mentions - -- [schizofox](https://github.com/schizofox/schizofox) - Hardened Firefox flake for the delusional and the schizophrenics. You might find some interesting stuff there. -- [Betterfox](https://github.com/yokoffing/Betterfox) - Firefox user.js for speed, privacy, and security. Your favorite browser, but better. -- [FirefoxCSS-Store](https://firefoxcss-store.github.io) - A collection site of Firefox userchrome themes. -- [r/FirefoxCSS](https://www.reddit.com/r/FirefoxCSS) - A subreddit dedicated to Firefox customization. -- [SearchFox](https://searchfox.org) - A source code indexing tool for Mozilla Firefox. It indexes C++, Rust, and JavaScript code. -- [ArkenFox GUI](https://arkenfox.github.io/gui) - Site to help you explore the information from the [arkenfox user.js](https://github.com/arkenfox/user.js) -- [fx-autoconfig](https://github.com/MrOtherGuy/fx-autoconfig) - A toolkit to load arbitrary javascript files to be run in Firefox browser context. Relies on autoconfig functionality available in Firefox. +Initial idea from [rpcarvalheira](https://github.com/rpcarvalheira). See: [#32](https://github.com/TanvirOnGH/firefox-config/issues/32)