diff --git a/Makefile b/Makefile index 3d8f39d..87538fb 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,13 @@ # SPDX-License-Identifier: GPL-3.0-or-later USERCHROME_FILES := $(sort $(wildcard src/userChrome/*.css)) +USERCONTENT_FILES := $(sort $(wildcard src/userContent/*.css)) HOMEPAGE_FILES := head.html distro_links.html bottom.html DISTRO := postmarketOS DESTDIR := FIREFOX_DIR := /usr/lib/firefox -all: out/home.html out/userChrome.css +all: out/home.html out/userChrome.css out/userContent.css clean: rm -rf out @@ -22,6 +23,9 @@ out/home.html: src/homepage/*.html out out/userChrome.css: $(USERCHROME_FILES) out cat $(USERCHROME_FILES) > $@ +out/userContent.css: $(USERCONTENT_FILES) out + cat $(USERCONTENT_FILES) > $@ + install: all install -Dm644 src/policies.json \ "$(DESTDIR)/etc/firefox/policies/policies.json" @@ -33,5 +37,7 @@ install: all "$(DESTDIR)/usr/share/mobile-config-firefox/home.html" install -Dm644 "out/userChrome.css" \ "$(DESTDIR)/etc/mobile-config-firefox/userChrome.css" + install -Dm644 "out/userContent.css" \ + "$(DESTDIR)/etc/mobile-config-firefox/userContent.css" .PHONY: all clean install diff --git a/src/mobile-config-autoconfig.js b/src/mobile-config-autoconfig.js index 07e3194..ae2ef70 100644 --- a/src/mobile-config-autoconfig.js +++ b/src/mobile-config-autoconfig.js @@ -31,3 +31,19 @@ if (chromeFile.exists() && defaultChrome.exists() && if (!chromeFile.exists()) { defaultChrome.copyTo(chromeDir, "userChrome.css"); } + +// Create nsIFile objects for userContent.css in /chrome/ and in /etc/ +var contentFile = chromeDir.clone(); +contentFile.append("userContent.css"); +var defaultContent = new FileUtils.File("/etc/mobile-config-firefox/userContent.css"); + +// Remove the existing userContent.css if older than the installed one +if (contentFile.exists() && defaultContent.exists() && + contentFile.lastModifiedTime < defaultContent.lastModifiedTime) { + contentFile.remove(false); +} + +// Copy userContent.css to /chrome/ +if (!contentFile.exists()) { + defaultContent.copyTo(chromeDir, "userContent.css"); +} diff --git a/src/userContent/preferences.css b/src/userContent/preferences.css new file mode 100644 index 0000000..66ff115 --- /dev/null +++ b/src/userContent/preferences.css @@ -0,0 +1,17 @@ +@-moz-document url("about:preferences"), url-prefix("about:preferences") { + /* avoid that sidebar is too wide */ + .navigation { + max-width: 50px; + } + + /* reduce space around category icons */ + #categories > .category { + margin-inline-start: 2px !important; + padding-inline: 2px !important; + } + + /* reduce space around footer icons (addons, help) */ + .sidebar-footer-list { + margin-inline: 2px !important; + } +}