diff --git a/assets/moz.build b/assets/moz.build index b7254f6..fd01f49 100644 --- a/assets/moz.build +++ b/assets/moz.build @@ -4,6 +4,8 @@ FINAL_TARGET_FILES += [ FINAL_TARGET_FILES.distribution += [ "policies.json", + "userChrome.css", + "userContent.css", ] # local-settings does not yet end up being pacakged. diff --git a/assets/prefs.js b/assets/prefs.js index 97b3e46..16c7333 100644 --- a/assets/prefs.js +++ b/assets/prefs.js @@ -1,6 +1,11 @@ // misc pref("browser.newtabpage.enabled", false); pref("browser.startup.homepage", "about:blank"); +lockPref("toolkit.legacyUserProfileCustomizations.stylesheets", true); +lockPref("browser.uidensity", 1); + +// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1420777 +lockPref("network.http.http2.coalesce-hostnames", false); // ads & annoyances pref("extensions.getAddons.showPane", false); diff --git a/assets/userChrome.css b/assets/userChrome.css new file mode 100644 index 0000000..bf8bc43 --- /dev/null +++ b/assets/userChrome.css @@ -0,0 +1,102 @@ +/* General UI customizations */ + +:root { + --uc-toolbar-height: 35px; +} + +:root:not([sizemode="fullscreen"]) { + --uc-window-control-width: 65px; +} + +.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 +} + +:root #nav-bar { + border-inline: 0 solid transparent; + border-inline-style: solid !important; + border-right-width: calc(var(--uc-window-control-width, 0px)); + border-inline-width: var(--uc-window-control-width, 0px) 0px; + background-clip: border-box !important; +} + +#TabsToolbar>* { + visibility: collapse !important +} + +:root[sizemode="fullscreen"] #TabsToolbar>#window-controls { + visibility: visible !important; + z-index: 2 +} + +#TabsToolbar>.titlebar-buttonbox-container { + visibility: visible !important; + height: var(--uc-toolbar-height) !important; +} + +#nav-bar { + margin-top: calc(0px - var(--uc-toolbar-height)); +} + +:root[inFullscreen] #navigator-toolbox { + margin-top: 15px +} + +#sidebar-header { + display: none; +} + +#sidebar-splitter { + --sidebar-border-color: var(--chrome-content-separator-color); +} + +#navigator-toolbox { + --toolbarbutton-hover-background: hsla(0, 0%, 70%, 0.15); +} + +#urlbar-background { + --toolbar-field-focus-border-color: #c44aa0; /* orig: #a86595 */ +} + +#tracking-protection-icon-container { + display: none; +} + +/* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1721612 */ + +@font-face { + font-family: system-ui; + src: local('SF Pro Display'); +} + +@font-face { + font-family: -apple-system; + src: local('SF Pro Display'); +} + +* { + font-family: system-ui; +} diff --git a/assets/userContent.css b/assets/userContent.css new file mode 100644 index 0000000..d1a68de --- /dev/null +++ b/assets/userContent.css @@ -0,0 +1,9 @@ +@font-face { + font-family: system-ui; + src: local('SF Pro Display'); +} + +@font-face { + font-family: -apple-system; + src: local('SF Pro Display'); +} diff --git a/build.sh b/build.sh index 757f6d9..c7041f2 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ git clean -fd # Prepare assets mkdir -p snowleopard cp ../assets/mozconfig mozconfig -cp ../assets/{local-settings.js,prefs.js,policies.json,moz.build} snowleopard/ +cp ../assets/{local-settings.js,prefs.js,policies.json,moz.build,userChrome.css,userContent.css} snowleopard/ # Prepare patches for patch in ../patches/*.patch; do diff --git a/patches/0009-userchrome.patch b/patches/0009-userchrome.patch new file mode 100644 index 0000000..5a614f2 --- /dev/null +++ b/patches/0009-userchrome.patch @@ -0,0 +1,25 @@ +diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp +index dac063c8a17fc..4bdd21bca9588 100644 +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -455,16 +455,10 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, + } + #endif // defined(MOZ_CONTENT_TEMP_DIR) + else if (!strcmp(aProperty, NS_APP_USER_CHROME_DIR)) { +- // It isn't clear why this uses GetProfileStartupDir instead of +- // GetProfileDir. It could theoretically matter in a non-main +- // process where some other directory provider has defined +- // NS_APP_USER_PROFILE_50_DIR. In that scenario, using +- // GetProfileStartupDir means this will fail instead of succeed. +- rv = GetProfileStartupDir(getter_AddRefs(file)); +- if (NS_FAILED(rv)) { +- return rv; +- } +- rv = file->AppendNative("chrome"_ns); ++ bool persistent = false; ++ rv = GetFile(NS_GRE_DIR, &persistent, getter_AddRefs(file)); ++ NS_ENSURE_SUCCESS(rv, rv); ++ rv = file->AppendNative("distribution"_ns); + } else if (!strcmp(aProperty, NS_APP_PREFS_50_DIR)) { + rv = GetProfileDir(getter_AddRefs(file)); + if (NS_FAILED(rv)) { diff --git a/patches/0010-toolbar.patch b/patches/0010-toolbar.patch new file mode 100644 index 0000000..046e873 --- /dev/null +++ b/patches/0010-toolbar.patch @@ -0,0 +1,15 @@ +diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs +index d748b93a92455..4183758ae427e 100644 +--- a/browser/components/customizableui/CustomizableUI.sys.mjs ++++ b/browser/components/customizableui/CustomizableUI.sys.mjs +@@ -249,10 +249,7 @@ var CustomizableUIInternal = { + Services.policies.isAllowed("removeHomeButtonByDefault") + ? null + : "home-button", +- "spring", + "urlbar-container", +- "spring", +- "save-to-pocket-button", + "downloads-button", + AppConstants.MOZ_DEV_EDITION ? "developer-button" : null, + "fxa-toolbar-menu-button", diff --git a/start.sh b/start.sh index 41890be..729e7c1 100755 --- a/start.sh +++ b/start.sh @@ -2,4 +2,5 @@ set -e cd ./mozilla-unified +#MOZ_LOG=nsHttp:5 ./mach run ./mach run