Compare commits

...

27 Commits

Author SHA1 Message Date
Dominika 171b1c3037 * fix in css patch 2021-12-05 14:29:45 +01:00
Dominika 3c4b8f2f40 * fixes in urlbar 2021-12-05 14:19:37 +01:00
Dominika 94123cfebe backporting mozilla-vpn-ad.patch from librewolf-common 2021-12-05 13:34:10 +01:00
Dominika Liberda 57d0ee09e7 fix useragent patch 2021-10-21 14:51:55 +02:00
Dominika Liberda 6f238fdad6 fix css patch 2021-10-21 14:26:48 +02:00
Dominika Liberda a488b9271b * fixing how tabs look 2021-10-21 00:43:42 +02:00
Dominika Liberda 8993b5c7f0 + useragent override per domain 2021-10-21 00:17:31 +02:00
Dominika Liberda 07cb6455d9 fix typo 2021-10-12 17:22:50 +02:00
Dominika Liberda a96a5f0101 fix file import 2021-10-12 16:52:32 +02:00
Dominika Liberda a3b801eabf fix view-page-info patch 2021-10-12 16:24:58 +02:00
Dominika Liberda d754d4019b fix patch 2021-10-12 16:18:47 +02:00
Dominika Liberda ef41ab718c change about colors 2021-10-12 16:14:50 +02:00
Dominika Liberda 841e6dc516 * more icon and string patches 2021-10-12 16:04:37 +02:00
Dominika Liberda 8e79ff8340 fixing patches 2021-10-12 12:21:42 +02:00
Dominika Liberda 546e7f21e6 visual improvements 2021-10-12 12:16:52 +02:00
Dominika Liberda cbac36ec59 porting old foxgirl stuff 2021-10-12 00:51:43 +02:00
Dominika Liberda 6defdd7054 * change branding in some places 2021-10-11 22:05:29 +02:00
Dominika Liberda 869589746c correct path 2021-10-11 00:52:20 +02:00
Dominika Liberda d3621b1f39 + urlbar, wordmark patches 2021-10-11 00:41:56 +02:00
Dominika Liberda 5dee011f4c proudly violating copyright licenses now lmao 2021-10-10 23:30:13 +02:00
ohfp 528e2db2ef update mozilla_dirs.patch 2021-10-08 11:58:31 +02:00
fxbrit 04e3660d2e update mozilla-vpn-ad.patch 2021-10-04 20:02:14 +02:00
ohfp 6f55a8bdc3
update search-config patch 2021-09-26 13:39:31 +02:00
ohfp 0ed8765675 add unity-menubar.patch for 92.0 2021-09-10 10:58:59 +02:00
fxbrit f56939407f update search-config patch 2021-09-07 20:01:31 +02:00
Bert van der Weerd 8403388baf
updated megabar.patch for 92.0 2021-09-07 11:29:00 +02:00
Bert van der Weerd 95c92c61ac
Added build_tools/build.py 2021-08-17 11:36:39 +02:00
41 changed files with 3921 additions and 840 deletions

757
build_tools/build.py Normal file
View File

@ -0,0 +1,757 @@
#!env python3
pkgver = '91.0'
nightly_ver = '93.0a1'
#
# build.py - try move functionality away from that too big/horrible build script.
#
import optparse
import sys
import os
import glob
import time
start_time = time.time()
parser = optparse.OptionParser()
parser.add_option('-x', '--cross', dest='cross_compile', default=False, action="store_true")
parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true")
parser.add_option('-l', '--no-librewolf', dest='no_librewolf', default=False, action="store_true")
parser.add_option('-s', '--src', dest='src', default='release')
parser.add_option('-t', '--distro', dest='distro', default='autodetect')
parser.add_option('-T', '--token', dest='token', default='')
parser.add_option('-3', '--i386', dest='i386', default=False, action="store_true")
parser.add_option('-P', '--settings-pane', dest='settings_pane', default=False, action="store_true")
options, remainder = parser.parse_args()
# try autodetecting options.distro
if options.distro == 'autodetect':
options.distro = 'win'
if os.path.isdir('/Applications'):
options.distro = 'osx'
elif os.path.isdir('/etc'):
options.distro = 'rpm'
if os.path.isdir('/etc/apt'):
options.distro = 'deb'
def script_exit(statuscode):
if (time.time() - start_time) > 60:
# print elapsed time
elapsed = time.strftime("%H:%M:%S", time.gmtime(time.time() - start_time))
print(f"\n\aElapsed time: {elapsed}")
sys.exit(statuscode)
def enter_srcdir():
dir = "firefox-{}".format(pkgver)
if options.src == 'nightly':
dir = 'mozilla-unified'
elif options.src == 'tor-browser':
dir = 'tor-browser'
elif options.src == 'gecko-dev':
dir = 'gecko-dev'
print("cd {}".format(dir))
if not options.no_execute:
try:
os.chdir(dir)
except:
print("fatal error: can't change to '{}' folder.".format(dir))
script_exit(1)
def leave_srcdir():
print("cd ..")
if not options.no_execute:
os.chdir("..")
def exec(cmd):
if cmd != '':
print(cmd)
if not options.no_execute:
retval = os.system(cmd)
if retval != 0:
print("fatal error: command '{}' failed".format(cmd))
script_exit(1)
def patch(patchfile):
cmd = "patch -p1 -i {}".format(patchfile)
print("\n*** -> {}".format(cmd))
if not options.no_execute:
retval = os.system(cmd)
if retval != 0:
print("fatal error: patch '{}' failed".format(patchfile))
script_exit(1)
#
# Utilities:
#
def execute_update_submodules():
exec("git submodule update --recursive")
exec("git submodule foreach git pull origin master")
exec("git submodule foreach git merge origin master")
def execute_git_init():
if options.src != 'release':
print("fatal error: git_init only works with the release source (--src release)")
script_exit(1)
enter_srcdir()
exec("rm -rf .git")
exec("git init")
exec("git config core.safecrlf false")
exec("git config commit.gpgsign false")
exec("git add -f * .[a-z]*")
exec("git commit -am initial")
leave_srcdir()
def execute_deps_deb():
deps1 = "python python-dev python3 python3-dev python3-distutils clang pkg-config libpulse-dev gcc"
deps2 = "curl wget nodejs libpango1.0-dev nasm yasm zip m4 libgtk-3-dev libgtk2.0-dev libdbus-glib-1-dev"
deps3 = "libxt-dev python3-pip mercurial automake autoconf libtool m4"
exec("apt install -y {} {} {}".format(deps1,deps2,deps3))
def execute_deps_rpm():
deps1 = "python3 python3-distutils-extra clang pkg-config gcc curl wget nodejs nasm yasm zip m4"
deps2 = "python3-zstandard python-zstandard python-devel python3-devel gtk3-devel llvm gtk2-devel dbus-glib-devel libXt-devel pulseaudio-libs-devel"
exec("dnf -y install {} {}".format(deps1,deps2))
def execute_deps_pkg():
deps = "wget gmake m4 python3 py37-sqlite3 pkgconf llvm node nasm zip unzip yasm"
exec("pkg install {}".format(deps))
def execute_rustup():
# rust needs special love: https://www.atechtown.com/install-rust-language-on-debian-10/
exec("curl https://sh.rustup.rs -sSf | sh")
exec("cargo install cbindgen")
def execute_mach_env():
enter_srcdir()
exec("bash ./mach create-mach-environment")
leave_srcdir()
def execute_reset():
if options.src == 'release':
path = "firefox-{}/.git/index".format(pkgver)
if not os.path.isfile(path):
print("fatal error: cannot reset '--src release' sources as it's not under version control.")
script_exit(1)
enter_srcdir()
exec("git reset --hard")
leave_srcdir()
elif options.src == 'nightly':
enter_srcdir()
exec("hg up -C")
exec("hg purge")
exec("hg pull -u")
leave_srcdir()
elif options.src == 'tor-browser':
enter_srcdir()
exec("git reset --hard")
leave_srcidr()
elif options.src == 'gecko-dev':
enter_srcdir()
exec("git reset --hard")
leave_srcdir()
#
# Targets:
#
def execute_fetch():
if options.src == 'release':
exec("rm -f firefox-{}.source.tar.xz".format(pkgver))
exec("wget -q https://archive.mozilla.org/pub/firefox/releases/{}/source/firefox-{}.source.tar.xz".format(pkgver, pkgver))
elif options.src == 'nightly':
if not os.path.isdir('mozilla-unified'):
exec("rm -f bootstrap.py")
exec("rm -rf mozilla-unified")
exec("wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py")
exec("python3 bootstrap.py --no-interactive --application-choice=browser")
elif options.src == 'tor-browser':
if not os.path.isdir('tor-browser'):
exec("rm -rf tor-browser")
exec("git clone --no-checkout --recursive https://git.torproject.org/tor-browser.git")
patch("../patches/tb-mozconfig-win10.patch")
enter_srcdir()
exec("git checkout tor-browser-89.0-10.5-1-build1")
exec("git submodule update --recursive")
leave_srcdir()
elif options.src == 'gecko-dev':
if not os.path.isdir('gecko-dev'):
exec("rm -rf gecko-dev")
exec("git clone --depth=1 https://github.com/mozilla/gecko-dev.git")
def execute_extract():
if options.src == 'release':
exec("rm -rf firefox-{}".format(pkgver))
exec("tar xf firefox-{}.source.tar.xz".format(pkgver))
def execute_build():
enter_srcdir()
exec("bash ./mach build")
leave_srcdir()
def execute_package():
enter_srcdir()
exec("bash ./mach package")
leave_srcdir()
#
# LibreWolf specific:
#
def create_mozconfig(contents):
if not options.no_execute:
f = open('mozconfig', 'w')
f.write(contents)
if not options.distro == 'win':
f.write("\nac_add_options --with-app-name=foxgirl")
if options.distro == 'osx' and options.cross_compile:
f.write("\nac_add_options --target=aarch64")
if options.i386:
f.write("\nac_add_options --target=i386")
f.write("\n")
f.close()
def execute_lw_do_patches():
if options.no_librewolf:
return
if not options.src in ['release','nightly','gecko-dev']:
return
enter_srcdir()
# create the right mozconfig file..
create_mozconfig(mozconfig_release)
# macos : if have compatibilty osx api headers, add that to mozconfig_release
dir = os.environ['HOME'] + '/.mozbuild/macos-sdk/MacOSX11.1.sdk'
if os.path.isdir(dir):
with open('mozconfig','a') as f:
f.write("\nac_add_options --with-macos-sdk=$HOME/.mozbuild/macos-sdk/MacOSX11.1.sdk")
f.close()
# copy branding files..
exec("cp -vr ../common/source_files/* .")
exec("cp -v ../files/configure.sh browser/branding/librewolf")
patches = []
if options.src == 'release':
# production patches
patches = [
"../common/patches/context-menu.patch",
"../common/patches/remove_addons.patch",
"../common/patches/megabar.patch",
"../common/patches/mozilla-vpn-ad.patch",
"../common/patches/allow_dark_preference_with_rfp.patch",
"../common/patches/about-dialog.patch",
# sed patches..
"../common/patches/sed-patches/allow-searchengines-non-esr.patch",
"../common/patches/sed-patches/disable-pocket.patch",
"../common/patches/sed-patches/remove-internal-plugin-certs.patch",
"../common/patches/sed-patches/stop-undesired-requests.patch",
]
elif options.src == 'nightly' or options.src == 'gecko-dev':
# patches for future releases are caught with nightly
patches = [
"../common/patches/context-menu.patch",
"../patches/remove_addons-91.0a1-nightly.patch",
##"../common/patches/megabar.patch",
"../patches/vpn-patch-91.0a1-nightly.patch",
"../common/patches/allow_dark_preference_with_rfp.patch",
"../common/patches/about-dialog.patch",
# sed patches..
"../common/patches/sed-patches/allow-searchengines-non-esr.patch",
"../common/patches/sed-patches/disable-pocket.patch",
"../common/patches/sed-patches/remove-internal-plugin-certs.patch",
##"../common/patches/sed-patches/stop-undesired-requests.patch",
]
for p in patches:
patch(p)
# local windows patches
for p in ["../patches/browser-confvars.patch", "../patches/package-manifest.patch"]:
patch(p)
# insert the settings pane source (experimental)
if options.settings_pane:
exec('rm -rf librewolf-pref-pane')
exec('git clone https://gitlab.com/ohfp/librewolf-pref-pane.git')
exec('cp -vrf librewolf-pref-pane/browser/* browser')
# this code ultimately does not work, it remains stuck on 'tab-overflow-indicator.svg'
exec('touch browser/themes/shared/newInstall.css')
exec('touch browser/themes/shared/newInstallPage.css')
exec('cp browser/themes/shared/icons/pin-12.svg browser/themes/shared/icons/pin-tab.svg')
exec('cp browser/themes/shared/icons/stop-to-reload.svg browser/themes/shared/icons/stop.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/unpin-tab.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/fingerprinters.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/tracker-image.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/tracker-image-disabled.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/customizableui/menu-arrow.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/illustrations/blue-berror.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/illustrations/error-connection-failure.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/illustrations/error-server-not-found.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/illustrations/error-session-restore.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/canvas-blocked.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/canvas.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/indexedDB.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/popup-subitem.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/update.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/webauthn.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/block-cryptominer.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/block-social.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/notification-icons/block-fingerprinter.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/back-12.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/3rdpartycookies-disabled.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/cryptominers-disabled.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/fingerprinters-disabled.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/controlcenter/socialblock-disabled.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/preferences/no-search-results.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/restore-session.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/quit.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/reload.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/send-to-device.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/sign-out.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/tab-12.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/icons/zoom-in.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/tabbrowser/indicator-tab-attention.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/tabbrowser/tab-audio-blocked.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/tabbrowser/tab-overflow-indicator.png')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/update-circle-fill-12.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/incontent-icons/welcome-back.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/places/folder.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/places/history.svg')
exec('cp browser/themes/shared/icons/stop.svg browser/themes/shared/warning.svg')
pass # EON (end of nightmare)
leave_srcdir()
def get_objdir():
pattern = "obj-*"
retval = glob.glob(pattern)
if options.no_execute:
return "obj-XXX"
if len(retval) != 1:
print("fatal error: in execute_lw_post_build(): cannot glob build output folder '{}'".format(pattern))
script_exit(1)
return retval[0]
def execute_lw_post_build():
if options.no_librewolf:
return
enter_srcdir()
dirname = get_objdir()
distfolder = "dist/bin"
if options.distro == 'osx':
distfolder = 'dist/LibreWolf.app/Contents/Resources'
if not options.no_execute:
os.makedirs("{}/{}/defaults/pref".format(dirname,distfolder), exist_ok=True)
os.makedirs("{}/{}/distribution".format(dirname,distfolder), exist_ok=True)
exec("cp -v ../settings/defaults/pref/local-settings.js {}/{}/defaults/pref/".format(dirname,distfolder))
exec("cp -v ../settings/distribution/policies.json {}/{}/distribution/".format(dirname,distfolder))
exec("cp -v ../settings/foxgirl.cfg {}/{}/".format(dirname,distfolder))
leave_srcdir()
def execute_lw_artifacts():
if options.no_librewolf:
return
enter_srcdir()
if options.distro == 'win':
exe = ".exe"
ospkg = "win64"
dirname = "{}/dist/firefox".format(get_objdir())
elif options.distro == 'deb':
exe = ""
ospkg = "deb"
dirname = "{}/dist/firefox".format(get_objdir())
elif options.distro == 'rpm':
exe = ""
ospkg = "rpm"
dirname = "{}/dist/firefox".format(get_objdir())
elif options.distro == 'osx':
#exe = ""
#ospkg = "osx"
#dirname = "{}/dist/firefox".format(get_objdir())
exec("cp {}/dist/librewolf*.dmg ..".format(get_objdir()))
leave_srcdir()
return
exec("rm -rf ../firefox ../librewolf")
exec("cp -rv {} ..".format(dirname))
leave_srcdir()
librewolfdir = "librewolf"
if options.distro == 'osx':
librewolfdir = 'librewolf/Librewolf.app'
exec("mv firefox librewolf")
if options.distro != 'osx':
exec("mv -v {}/firefox{} {}/librewolf{}".format(librewolfdir,exe,librewolfdir,exe));
exec("rm -rf {}/maintainanceservice* {}/pingsender* {}/firefox.*.xml {}/precomplete {}/removed-files {}/uninstall"
.format(librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir,librewolfdir))
exec("cp -v common/source_files/browser/branding/librewolf/firefox.ico {}/librewolf.ico".format(librewolfdir))
if options.distro != 'win':
exec("cp -v files/register-librewolf files/start-librewolf files/start-librewolf.desktop.in librewolf")
# create zip filename
if options.src == 'release':
zipname = "librewolf-{}.en-US.{}.zip".format(pkgver,ospkg)
elif options.src == 'nightly':
zipname = "librewolf-{}.en-US.{}-nightly.zip".format(nightly_ver,ospkg)
elif options.src == 'gecko-dev':
zipname = "librewolf-{}.en-US.{}-gecko-dev.zip".format(nightly_ver,ospkg)
# 'windows portable' zip stuff..
if options.distro == 'win':
# we need tmp to tell us what portable folder to make
if options.src == 'release':
tmp = pkgver
else:
tmp = nightly_ver
exec("rm -rf librewolf-{}".format(tmp))
#exec("mkdir -p librewolf-{}/Profiles/Default librewolf-{}/LibreWolf".format(pkgver,pkgver))
os.makedirs("librewolf-{}/Profiles/Default".format(tmp), exist_ok=True)
os.makedirs("librewolf-{}/LibreWolf".format(tmp), exist_ok=True)
exec("cp -vr librewolf/* librewolf-{}/LibreWolf".format(tmp))
exec("rm -f librewolf-portable.exe")
exec("wget -q https://gitlab.com/librewolf-community/browser/windows/uploads/8347381f01806245121adcca11b7f35c/librewolf-portable.exe")
exec("mv librewolf-portable.exe librewolf-{}".format(tmp))
exec("rm -f {}".format(zipname))
exec("zip -qr9 {} librewolf-{}".format(zipname,tmp))
# 'normal' zip file..
else:
exec("rm -f {}".format(zipname))
exec("zip -qr9 {} librewolf".format(zipname))
# create installer
if options.distro == 'win':
setupname = "librewolf-{}.en-US.win64-setup.exe".format(pkgver)
if options.src == 'nightly':
if os.path.isfile(setupname):
exec("rm -f tmp.exe")
exec("mv {} tmp.exe".format(setupname))
setupname = "librewolf-{}.en-US.win64-nightly-setup.exe".format(nightly_ver)
elif options.src == 'gecko-dev':
if os.path.isfile(setupname):
exec("rm -f tmp.exe")
exec("mv {} tmp.exe".format(setupname))
setupname = "librewolf-{}.en-US.win64-gecko-dev-setup.exe".format(nightly_ver)
exec("rm -f {} tmp.nsi".format(setupname))
s = pkgver
if options.src == 'nightly' or options.src == 'gecko-dev':
s = nightly_ver
exec("sed \"s/pkg_version/{}/g\" < setup.nsi > tmp.nsi".format(s))
exec("makensis-3.01.exe -V1 tmp.nsi")
exec("rm -f tmp.nsi")
from_name = 'librewolf-{}.en-US.win64-setup.exe'.format(s)
if from_name != setupname:
exec("mv {} {}".format(from_name,setupname))
if os.path.isfile("tmp.exe"):
exec("mv tmp.exe librewolf-{}.en-US.win64-setup.exe".format(pkgver))
def do_upload(filename):
exec("echo \".\" >> upload.txt")
exec("curl --request POST --header \"PRIVATE-TOKEN: {}\" --form \"file=@{}\" \"https://gitlab.com/api/v4/projects/13852981/uploads\" >> upload.txt".format(options.token,filename))
exec("echo \".\" >> upload.txt")
def execute_upload():
if options.token =='':
print("fatal error: You must specify a private token when using the 'upload' command.")
script_exit(1)
if options.distro == 'win':
ospkg = "win64"
elif options.distro == 'deb':
ospkg = "deb"
elif options.distro == 'rpm':
ospkg = "rpm"
elif options.distro == 'osx':
ospkg = "osx"
zip_filename = "librewolf-{}.en-US.{}.zip".format(pkgver,ospkg)
setup_filename = "librewolf-{}.en-US.{}-setup.exe".format(pkgver,ospkg)
nightly_setup_filename = "librewolf-{}.en-US.{}-gecko-dev.zip".format(nightly_ver,ospkg)
if not os.path.isfile(zip_filename):
print("fatal error: File '{}' not found.".format(zip_filename))
script_exit(1)
if not os.path.isfile(setup_filename):
print("fatal error: File '{}' not found.".format(setup_filename))
script_exit(1)
if not os.path.isfile(nightly_setup_filename):
print("fatal error: File '{}' not found.".format(nightly_setup_filename))
script_exit(1)
exec("sha256sum {} {} {} > sha256sums.txt".format(zip_filename,setup_filename,nightly_setup_filename))
exec("rm -f upload.txt")
do_upload(setup_filename)
do_upload(zip_filename)
do_upload(nightly_setup_filename)
do_upload("sha256sums.txt")
print("upload.txt: Upload JSON api results are in the file \'upload.txt\'.")
#
# Main targets:
#
def execute_all():
execute_fetch()
execute_extract()
execute_lw_do_patches()
execute_build()
execute_lw_post_build()
execute_package()
execute_lw_artifacts()
def execute_clean():
exec("rm -rf librewolf-{} librewolf-{}".format(pkgver,nightly_ver))
exec("rm -rf librewolf bootstrap.py tmp.nsi tmp.exe sha256sums.txt upload.txt librewolf-portable.exe")
for filename in glob.glob("librewolf-*"):
try:
os.remove(filename)
except:
pass
def execute_veryclean():
exec("rm -rf firefox-{}.source.tar.xz mozilla-unified tor-browser gecko-dev".format(pkgver))
exec("rm -rf firefox-{}".format(pkgver))
execute_clean()
#
# main commandline interface
#
def main():
if options.src == 'tor-browser':
options.no_librewolf = True
if len(remainder) > 0:
if not options.src in ['release','nightly','tor-browser','gecko-dev']:
print("error: option --src invalid value")
script_exit(1)
if not options.distro in ['deb','rpm', 'win','osx']:
print("error: option --distro invalid value")
script_exit(1)
for arg in remainder:
if arg == 'all':
execute_all()
elif arg == 'clean':
execute_clean()
elif arg == 'veryclean':
execute_veryclean()
# Targets:
elif arg == 'fetch':
execute_fetch()
elif arg == 'extract':
execute_extract()
elif arg == 'lw_do_patches':
execute_lw_do_patches()
elif arg == 'build':
execute_build()
elif arg == 'lw_post_build':
execute_lw_post_build()
elif arg == 'package':
execute_package()
elif arg == 'lw_artifacts':
execute_lw_artifacts()
# Utilities
elif arg == 'update_submodules':
execute_update_submodules()
elif arg == 'upload':
execute_upload()
elif arg == 'git_init':
execute_git_init()
elif arg == 'deps_deb':
execute_deps_deb()
elif arg == 'deps_rpm':
execute_deps_rpm()
elif arg == 'deps_pkg':
execute_deps_pkg()
elif arg == 'rustup':
execute_rustup()
elif arg == 'mach_env':
execute_mach_env()
elif arg == 'reset':
execute_reset()
else:
print("error: unknown command on command line: ", arg)
script_exit(1)
else:
# Print help message
print(help_message.format(options.distro))
#
# Large multiline strings
#
help_message = """# Use:
build.py [<options>] clean | all | <targets> | <utilities>
# Options:
-n,--no-execute - print commands, don't execute them
-l,--no-librewolf - skip LibreWolf specific stages.
-x,--cross - crosscompile from linux, implies -t win
-s,--src <src> - release,nightly,tor-browser,gecko-dev
(default=release)
-t,--distro <distro> - deb,rpm,win,osx (default={})
-T,--token <private_token> - private token used to upload to gitlab.com
-3,--i386 - build 32-bit
-P,--settings-pane - build with the experimental settings pane
# Targets:
all - all steps from fetch to producing setup.exe
clean - clean everything, including extracted/fetched sources
veryclean - clean like above, and also remove build artifacts.
fetch - wget or hg clone or git pull
extract - when using wget, extract the archive.
lw_do_patches - [librewolf] patch the source
build - build the browser
lw_post_build - [librewolf] insert our settings
package - package the browser into zip/apk
lw_artifacts - [librewolf] build setup.exe
# Utilities:
update_submodules - git update submodules
upload - upload the build artifacts to gitlab.com
git_init - put the source folder in a .git repository
reset - use git/mercurial to revert changes to a clean state
deps_deb - install dependencies with apt
deps_rpm - install dependencies with dnf
deps_pkg - install dependencies on freebsd
rustup - update rust
mach_env - create mach environment
"""
#
# mozconfig files:
#
mozconfig_release = """
ac_add_options --enable-application=browser
# This supposedly speeds up compilation (We test through dogfooding anyway)
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --enable-rust-simd
ac_add_options --enable-optimize
# Branding
ac_add_options --enable-update-channel=release
# theming bugs: ac_add_options --with-app-name=librewolf
# theming bugs: ac_add_options --with-app-basename=LibreWolf
ac_add_options --with-branding=browser/branding/librewolf
ac_add_options --with-distribution-id=io.gitlab.librewolf-community
ac_add_options --with-unsigned-addon-scopes=app,system
ac_add_options --allow-addon-sideload
#export MOZ_REQUIRE_SIGNING=0
# Features
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
# Disables crash reporting, telemetry and other data gathering tools
mk_add_options MOZ_CRASHREPORTER=0
mk_add_options MOZ_DATA_REPORTING=0
mk_add_options MOZ_SERVICES_HEALTHREPORT=0
mk_add_options MOZ_TELEMETRY_REPORTING=0
# testing..
# MOZ_APP_NAME=librewolf
# This gives the same theming issue as --with-app-name=librewolf
"""
main()
script_exit(0)

View File

@ -0,0 +1,30 @@
--- a/browser/themes/shared/toolbarbuttons.inc.css 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/themes/shared/toolbarbuttons.inc.css 2021-10-12 12:14:29.155204427 +0200
@@ -54,6 +54,10 @@
.toolbarbutton-1 > .toolbarbutton-icon {
margin-inline-end: 0 !important;
+ height: 24px !important;
+ width: 24px !important;
+ padding: 0 !important;
+ margin: 0 4px !important;
}
.toolbarbutton-1 > .toolbarbutton-icon,
@@ -367,3 +371,16 @@
margin-inline-end: -6px !important;
background: url(chrome://browser/skin/badge-blue.svg);
}
+
+#PersonalToolbar {
+ padding-left: 0px;
+}
+
+#PersonalToolbar > toolbarbutton {
+ margin: 0px !important;
+ padding: 0px !important;
+}
+
+#PersonalToolbar > toolbarbutton > image {
+ margin-inline-start: 0px !important;
+}

686
patches/css.patch Normal file
View File

@ -0,0 +1,686 @@
diff --git a/browser/components/newtab/content-src/styles/_icons.scss b/browser/components/newtab/content-src/styles/_icons.scss
--- a/browser/components/newtab/content-src/styles/_icons.scss
+++ b/browser/components/newtab/content-src/styles/_icons.scss
@@ -31,11 +31,11 @@
// icon images
&.icon-bookmark-added {
- background-image: url('chrome://browser/skin/bookmark.svg');
+ background-image: url('chrome://browser/skin/starred48.png');
}
&.icon-bookmark-hollow {
- background-image: url('chrome://browser/skin/bookmark-hollow.svg');
+ background-image: url('chrome://browser/skin/unstarred48.png');
}
&.icon-clear-input {
diff --git a/browser/components/newtab/css/activity-stream-linux.css b/browser/components/newtab/css/activity-stream-linux.css
--- a/browser/components/newtab/css/activity-stream-linux.css
+++ b/browser/components/newtab/css/activity-stream-linux.css
@@ -102,10 +102,10 @@ body[lwt-newtab-brighttext] {
fill: var(--newtab-text-primary-color);
}
.icon.icon-bookmark-added {
- background-image: url("chrome://browser/skin/bookmark.svg");
+ background-image: url("chrome://browser/skin/starred48.png");
}
.icon.icon-bookmark-hollow {
- background-image: url("chrome://browser/skin/bookmark-hollow.svg");
+ background-image: url("chrome://browser/skin/unstarred48.png");
}
.icon.icon-clear-input {
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-cancel-16.svg");
@@ -3742,7 +3742,7 @@ main.has-snippet {
margin-inline-end: 6px;
}
.story-footer .status-message .story-badge-icon.icon-bookmark-removed {
- background-image: url("chrome://activity-stream/content/data/content/assets/icon-removed-bookmark.svg");
+ background-image: url("chrome://activity-stream/content/data/content/assets/icon-removed-starred48.png");
}
.story-footer .status-message .story-context-label {
color: var(--newtab-text-secondary-color);
diff --git a/browser/components/places/content/bookmarkProperties.js b/browser/components/places/content/bookmarkProperties.js
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -267,7 +267,7 @@ var BookmarkPropertiesPanel = {
},
_getIconUrl() {
- let url = "chrome://browser/skin/bookmark-hollow.svg";
+ let url = "chrome://browser/skin/unstarred48.png";
if (this._action === ACTION_EDIT && this._itemType === BOOKMARK_ITEM) {
url = window.arguments[0]?.node?.icon;
diff --git a/browser/components/protections/content/protections.css b/browser/components/protections/content/protections.css
--- a/browser/components/protections/content/protections.css
+++ b/browser/components/protections/content/protections.css
@@ -265,7 +265,7 @@ a.hidden,
height: var(--exit-icon-size);
top: var(--exit-icon-position);
inset-inline-end: var(--exit-icon-position);
- background-image: url(chrome://global/skin/icons/close.svg);
+ background-image: url(chrome://browser/skin/tab-close.png);
background-size: calc(var(--exit-icon-size) - 2px);
background-color: transparent;
background-position: center;
diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -1914,13 +1914,21 @@ class UrlbarInput {
"--urlbar-container-height",
px(getBoundsWithoutFlushing(this.textbox.parentNode).height)
);
+ //this.textbox.style.setProperty(
+ // "--urlbar-height",
+ // px(getBoundsWithoutFlushing(this.textbox).height)
+ //);
+ //this.textbox.style.setProperty(
+ // "--urlbar-toolbar-height",
+ // px(getBoundsWithoutFlushing(this._toolbar).height)
+ //);
this.textbox.style.setProperty(
"--urlbar-height",
- px(getBoundsWithoutFlushing(this.textbox).height)
+ 20
);
this.textbox.style.setProperty(
"--urlbar-toolbar-height",
- px(getBoundsWithoutFlushing(this._toolbar).height)
+ 26
);
this.setAttribute("breakout", "true");
diff --git a/browser/components/urlbar/UrlbarUtils.jsm b/browser/components/urlbar/UrlbarUtils.jsm
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -230,7 +230,7 @@ var UrlbarUtils = {
{
source: UrlbarUtils.RESULT_SOURCE.BOOKMARKS,
restrict: UrlbarTokenizer.RESTRICT.BOOKMARK,
- icon: "chrome://browser/skin/bookmark.svg",
+ icon: "chrome://browser/skin/starred48.png",
pref: "shortcuts.bookmarks",
},
{
diff --git a/browser/components/urlbar/tests/browser/browser_oneOffs_heuristicRestyle.js b/browser/components/urlbar/tests/browser/browser_oneOffs_heuristicRestyle.js
--- a/browser/components/urlbar/tests/browser/browser_oneOffs_heuristicRestyle.js
+++ b/browser/components/urlbar/tests/browser/browser_oneOffs_heuristicRestyle.js
@@ -42,7 +42,7 @@ const RESULT_DATA_BY_TYPE = {
function getSourceIcon(source) {
switch (source) {
case UrlbarUtils.RESULT_SOURCE.BOOKMARKS:
- return "chrome://browser/skin/bookmark.svg";
+ return "chrome://browser/skin/starred48.png";
case UrlbarUtils.RESULT_SOURCE.HISTORY:
return "chrome://browser/skin/history.svg";
case UrlbarUtils.RESULT_SOURCE.TABS:
diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js b/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js
--- a/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js
+++ b/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js
@@ -111,7 +111,7 @@ add_task(async function localOneOff() {
);
Assert.equal(
result.image,
- "chrome://browser/skin/bookmark.svg",
+ "chrome://browser/skin/starred48.png",
"Check the heuristic icon"
);
@@ -252,7 +252,7 @@ add_task(async function localOneOff_with
);
Assert.equal(
result.image,
- "chrome://browser/skin/bookmark.svg",
+ "chrome://browser/skin/starred48.png",
"Check the heuristic icon"
);
diff --git a/browser/themes/shared/browser.inc.css b/browser/themes/shared/browser.inc.css
--- a/browser/themes/shared/browser.inc.css
+++ b/browser/themes/shared/browser.inc.css
@@ -57,10 +56,6 @@
--urlbar-box-text-color: inherit;
--urlbar-min-height: 32px;
--urlbar-icon-fill-opacity: 0.9;
- --urlbar-icon-padding: 6px; /* (32px - 2px border - 2px padding - 16px icon) / 2 */
- /* This should be used for icons and chiclets inside the input field. It makes
- the gap around them more uniform when they are close to the field edges */
- --urlbar-icon-border-radius: calc(var(--toolbarbutton-border-radius) - 1px);
--urlbar-popup-url-color: -moz-nativehyperlinktext;
--lwt-additional-images: none;
@@ -490,7 +485,7 @@ menupopup::part(drop-indicator) {
margin: 3px;
border: none;
border-radius: 2px;
- background-image: url(chrome://global/skin/icons/close.svg);
+ background-image: url(chrome://browser/skin/tab-close.png);
background-color: transparent;
background-repeat: no-repeat;
background-position: center;
@@ -617,7 +612,7 @@ menupopup::part(drop-indicator) {
#cfr-notification-footer-filled-stars,
#cfr-notification-footer-empty-stars {
-moz-context-properties: fill, fill-opacity;
- background-image: url(chrome://browser/skin/bookmark.svg);
+ background-image: url(chrome://browser/skin/starred48.png);
fill: currentColor;
fill-opacity: 0.7;
height: 16px;
@@ -826,3 +821,8 @@ popupnotificationcontent {
#tab-notification-deck {
display: block;
}
+
+#nav-bar, #nav-bar-customization-target {
+ height: 36px !important;
+}
+
diff --git a/browser/themes/shared/contextmenu.inc.css b/browser/themes/shared/contextmenu.inc.css
--- a/browser/themes/shared/contextmenu.inc.css
+++ b/browser/themes/shared/contextmenu.inc.css
@@ -37,11 +37,11 @@
}
#context-bookmarkpage {
- list-style-image: url("chrome://browser/skin/bookmark-hollow.svg");
+ list-style-image: url("chrome://browser/skin/unstarred48.png");
}
#context-bookmarkpage[starred=true] {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
+ list-style-image: url("chrome://browser/skin/starred48.png");
}
#context-back:-moz-locale-dir(rtl),
diff --git a/browser/themes/shared/controlcenter/panel.inc.css b/browser/themes/shared/controlcenter/panel.inc.css
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -721,7 +721,7 @@ description#identity-popup-content-verif
margin: 0;
width: 12px;
height: 12px;
- list-style-image: url(chrome://global/skin/icons/close.svg);
+ list-style-image: url(chrome://browser/skin/tab-close.png);
-moz-context-properties: fill;
fill: currentColor;
}
diff --git a/browser/themes/shared/identity-block/identity-block.inc.css b/browser/themes/shared/identity-block/identity-block.inc.css
--- a/browser/themes/shared/identity-block/identity-block.inc.css
+++ b/browser/themes/shared/identity-block/identity-block.inc.css
@@ -279,3 +279,6 @@
#urlbar-input-container[pageproxystate="invalid"] > #tracking-protection-icon-container {
visibility: collapse;
}
+.verifiedDomain {
+ margin 0 4px !important;
+}
diff --git a/browser/themes/shared/places/tree-icons.css b/browser/themes/shared/places/tree-icons.css
--- a/browser/themes/shared/places/tree-icons.css
+++ b/browser/themes/shared/places/tree-icons.css
@@ -41,7 +41,7 @@ treechildren::-moz-tree-image(query) {
}
treechildren::-moz-tree-image(query, OrganizerQuery_allbms_____v) {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
+ list-style-image: url("chrome://browser/skin/starred48.png");
}
treechildren::-moz-tree-image(query, OrganizerQuery_downloads__v) {
diff --git a/browser/themes/shared/preferences/preferences.inc.css b/browser/themes/shared/preferences/preferences.inc.css
--- a/browser/themes/shared/preferences/preferences.inc.css
+++ b/browser/themes/shared/preferences/preferences.inc.css
@@ -601,8 +601,8 @@ richlistitem[selected] .actionsMenu:focu
background-color: transparent; /* override common.css, but keep hover/active states */
min-width: 0;
min-height: auto;
- width: 20px;
- height: 20px;
+ width: 16px !important;
+ height: 16px !important;
padding: 0;
margin-inline: 0 8px;
}
@@ -790,7 +790,7 @@ dialog > .sync-engines-list + hbox {
.sync-engine-bookmarks .checkbox-icon,
.sync-engine-bookmarks.sync-engine-image {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
+ list-style-image: url("chrome://browser/skin/starred48.png");
}
.sync-engine-history .checkbox-icon,
diff --git a/browser/themes/shared/sidebar.inc.css b/browser/themes/shared/sidebar.inc.css
--- a/browser/themes/shared/sidebar.inc.css
+++ b/browser/themes/shared/sidebar.inc.css
@@ -106,7 +106,7 @@ toolbarseparator + #sidebar-extensions-s
}
#sidebar-box[sidebarcommand="viewBookmarksSidebar"] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon {
- list-style-image: url(chrome://browser/skin/bookmark.svg);
+ list-style-image: url(chrome://browser/skin/starred48.png);
-moz-context-properties: fill;
fill: currentColor;
opacity: 0.8;
--- a/browser/themes/shared/tabs.inc.css 2021-09-28 00:46:31.000000000 +0200
+++ b/browser/themes/shared/tabs.inc.css 2021-10-21 00:55:40.676223564 +0200
@@ -44,6 +44,7 @@
#tabbrowser-tabs {
--tab-min-width: 76px;
--tab-loading-fill: #0A84FF;
+ --tab-min-height: 24px !important;
}
#tabbrowser-tabpanels {
@@ -90,11 +91,9 @@
margin: 0 !important /* override tabbox.css */;
padding: 0 !important /* override tabbox.css */;
-moz-box-align: stretch;
-}
-
-.tabbrowser-tab {
min-height: var(--tab-min-height);
padding-inline: 2px !important;
+ height: 24px !important;
}
/* tabbrowser-tab keyboard focus */
@@ -447,10 +446,11 @@
.tab-close-button {
-moz-context-properties: fill, fill-opacity;
margin-inline-end: calc(var(--inline-tab-padding) / -2);
- width: 24px;
- height: 24px;
- padding: 7px;
+ width: 16px !important;
+ height: 16px !important;
+ padding: 0px;
border-radius: var(--tab-border-radius);
+ list-style-image: url("chrome://browser/skin/tab-close.png");
}
/* The following rulesets allow showing more of the tab title */
@@ -541,9 +541,8 @@
.tab-background {
border: 1px none transparent;
background-clip: padding-box;
-}
-
-.tab-background {
+ margin-top: 0;
+ height: 24px;
border-radius: var(--tab-border-radius);
margin-block: var(--tab-block-margin);
}
@@ -645,7 +644,7 @@
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab[first-visible-unpinned-tab] {
/* Add a gap between the last pinned tab and the first visible tab */
- margin-inline-start: 12px !important; /* .tabbrowser-tab sets margin: 0 !important; */
+ margin-inline-start: 0px !important; /* .tabbrowser-tab sets margin: 0 !important; */
}
.tab-label[attention]:not([selected="true"]) {
@@ -778,5 +777,55 @@
}
.all-tabs-item > toolbarbutton {
- margin-inline-start: 0;
+ margin-inline-start: 0 !important;
+}
+
+tab {
+ font-size: 16px !important;
+ font-family: sans-serif !important;
+ padding-inline-start: 0px !important;
+ padding-inline-end: 0px !important;
+}
+
+.tab-background {
+ /*background: #eeeeee;*/
+ border-radius: 0 !important;
+ margin-bottom: 0px !important;
+ box-shadow: 0 0 2px 2px rgba(0,0,0,0.1) !important;
+ border: 1px solid rgba(0,0,0,.5) !important;
+ border-bottom-width: 0px !important;
+}
+
+#tabbrowser-tabs {
+ --tab-min-height: 24px !important;
+}
+#scrollbutton-up,
+#scrollbutton-down {
+ border-top-width: 0 !important;
+ border-bottom-width: 0 !important;
+}
+
+.tabbrowser-tab[selected] .tab-background {
+ background: #75cc00 !important;
+}
+
+.tabbrowser-tab[selected] .tab-label {
+ color: black !important;
+ font-weight: bold !important;
+}
+
+#TabsToolbar {
+ border-bottom: 2px solid #000000 !important;
+ height: 24px !important;
+}
+/*
+.tabbrowser-tab:hover .tab-background:not([selected]) {
+ background: #75cc00 !important;
+}*/
+
+.tabbrowser-tab:not([selected]) > .tab-stack > .tab-content > .tab-label-container > .tab-close-button {
+ list-style-image: url("chrome://browser/skin/tab-close_inactive.png") !important;
+}
+.tabbrowser-tab > .tab-stack > .tab-content > .tab-label-container > .tab-close-button:hover {
+ list-style-image: url("chrome://browser/skin/tab-close_hover.png") !important;
}
diff --git a/browser/themes/shared/toolbarbutton-icons.inc.css b/browser/themes/shared/toolbarbutton-icons.inc.css
--- a/browser/themes/shared/toolbarbutton-icons.inc.css
+++ b/browser/themes/shared/toolbarbutton-icons.inc.css
@@ -56,11 +56,11 @@ toolbar[brighttext]:-moz-lwtheme {
}
#back-button {
- list-style-image: url("chrome://browser/skin/back.svg");
+ list-style-image: url("chrome://browser/skin/back.png");
}
#forward-button {
- list-style-image: url("chrome://browser/skin/forward.svg");
+ list-style-image: url("chrome://browser/skin/forward.png");
}
/* The animations for the reload-button and stop-button are disabled
@@ -120,10 +120,6 @@ toolbar[brighttext]:-moz-lwtheme {
position: relative;
}
-#nav-bar-customization-target :where(#reload-button, #stop-button) > .toolbarbutton-icon {
- padding: calc(var(--toolbarbutton-inner-padding) + 1px) var(--toolbarbutton-inner-padding) calc(var(--toolbarbutton-inner-padding) - 1px ) !important; /* The animation is 18px but the other icons are 16px, lower it by 1px so it is vertically centered */
-}
-
#reload-button > .toolbarbutton-animatable-box,
#stop-button > .toolbarbutton-animatable-box {
top: calc(50% - 9px); /* Vertically center the 20px tall animatable image, which is 1px higher than other icons */
@@ -134,25 +130,6 @@ toolbar[brighttext]:-moz-lwtheme {
height: 20px; /* Height of each frame within the SVG sprite */
}
-#stop-reload-button[animate] > #reload-button > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
- background-image: url("chrome://browser/skin/stop-to-reload.svg");
- /*
- transition from stop icon to reload icon
- pause at frame 0 for 6 ticks,
- pause at frame 15 for 16 ticks
- total 35 steps*/
- --anim-frames: 14;
- --anim-steps: calc(var(--anim-frames) + 21); /* Add steps for doing the pause at the start and end */
- width: calc(20px * (var(--anim-frames) + 1));
- height: 20px;
-
- /* initial state for animation */
- transform: translateX(0);
-}
-
-#stop-reload-button[animate] > #reload-button:not([displaystop]) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
- animation-name: stop-to-reload;
-}
#reload-button:not([displaystop]) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
animation-duration: calc(var(--anim-steps) * 16.667ms);
@@ -193,15 +170,16 @@ toolbar[brighttext]:-moz-lwtheme {
}
#reload-button {
- list-style-image: url("chrome://global/skin/icons/reload.svg");
+ list-style-image: url("chrome://browser/skin/refresh.png");
}
#stop-button {
- list-style-image: url("chrome://global/skin/icons/close.svg");
+ list-style-image: url("chrome://browser/skin/stop.png");
+ display: block !important;
}
#home-button {
- list-style-image: url("chrome://browser/skin/home.svg");
+ list-style-image: url("chrome://browser/skin/home.png");
}
#bookmarks-toolbar-button,
diff --git a/browser/themes/shared/urlbar-searchbar.inc.css b/browser/themes/shared/urlbar-searchbar.inc.css
--- a/browser/themes/shared/urlbar-searchbar.inc.css
+++ b/browser/themes/shared/urlbar-searchbar.inc.css
@@ -43,14 +43,14 @@
background-color: var(--toolbar-field-background-color);
background-clip: border-box;
border: 1px solid var(--toolbar-field-border-color);
- border-radius: var(--toolbarbutton-border-radius);
+ /*border-radius: var(--toolbarbutton-border-radius);*/
}
-
+/*
#urlbar-input-container,
#searchbar {
border-radius: var(--toolbarbutton-border-radius);
overflow: clip;
-}
+}*/
#urlbar-input,
#urlbar-scheme,
@@ -66,13 +66,13 @@
#urlbar[focused="true"]:not([suppress-focus-border]) > #urlbar-background,
#searchbar:focus-within {
- outline: var(--focus-outline);
- outline-offset: calc(var(--focus-outline-width) * -1);
+ /*outline: var(--focus-outline);
+ outline-offset: calc(var(--focus-outline-width) * -1);*/
/* We used --focus-outline above to inherit its width and style properties,
but we still want to use the theme's border-color.
--toolbar-field-focus-border-color is set equal to --focus-outline-color
on :root, but LWT themes can override this value. */
- outline-color: var(--toolbar-field-focus-border-color);
+ /*outline-color: var(--toolbar-field-focus-border-color);*/
border-color: transparent;
}
@@ -186,13 +186,14 @@
position: absolute;
width: 100%;
height: var(--urlbar-height);
- top: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2);
+ /*top: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2);*/
+ top: 2px;
left: 0;
}
#urlbar[breakout] > #urlbar-input-container {
width: 100%;
- height: 100%;
+ height: 32px !important;
}
#urlbar:not([open]) > .urlbarView,
@@ -277,7 +278,7 @@
color: var(--urlbar-box-text-color);
margin-inline-end: 8px;
align-items: center;
- border-radius: var(--urlbar-icon-border-radius);
+/* border-radius: var(--urlbar-icon-border-radius);*/
padding-inline: 8px 6px;
}
@@ -336,11 +337,15 @@
#pageAction-panel-bookmark,
#star-button {
- list-style-image: url("chrome://browser/skin/bookmark-hollow.svg");
+ list-style-image: url("chrome://browser/skin/unstarred48.png");
+ width: 28px !important;
+ height: 28px !important;
}
#pageAction-panel-bookmark[starred],
#star-button[starred] {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
+ list-style-image: url("chrome://browser/skin/starred48.png");
+ width: 28px !important;
+ height: 28px !important;
}
#star-button[starred] {
fill-opacity: 1;
@@ -383,7 +388,7 @@
.search-go-button {
width: calc(var(--urlbar-min-height) - 2px /* border */ - 2 * var(--urlbar-container-padding));
height: calc(var(--urlbar-min-height) - 2px /* border */ - 2 * var(--urlbar-container-padding));
- border-radius: var(--urlbar-icon-border-radius);
+/* border-radius: var(--urlbar-icon-border-radius);*/
padding: var(--urlbar-icon-padding);
color: inherit;
}
@@ -501,7 +506,7 @@
#cfr-label-container {
width: 0;
overflow: hidden;
- border-radius: 5px;
+/* border-radius: 5px;*/
padding-inline-start: 28px;
mask-image: linear-gradient(to right, transparent 0, black 0);
mask-position-x: var(--cfr-label-width);
@@ -578,7 +583,7 @@
color: inherit;
font-size: .8em;
padding: 3px 7px;
- border-radius: var(--urlbar-icon-border-radius);
+/* border-radius: var(--urlbar-icon-border-radius);*/
background-color: var(--urlbar-box-bgcolor);
color: var(--urlbar-box-text-color);
margin-block: calc((var(--urlbar-min-height) - 20px) / 2 - 1px /* border */ - var(--urlbar-container-padding));
--- a/browser/themes/shared/urlbarView.inc.css
+++ b/browser/themes/shared/urlbarView.inc.css
@@ -718,7 +718,7 @@
.urlbarView-row[source="bookmarks"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon,
#urlbar-engine-one-off-item-bookmarks {
- list-style-image: url("chrome://browser/skin/bookmark.svg");
+ list-style-image: url("chrome://browser/skin/starred48.png");
fill: var(--lwt-toolbar-field-icon-fill-attention, var(--toolbarbutton-icon-fill-attention));
fill-opacity: 1;
-moz-context-properties: fill, fill-opacity;
--- a/browser/base/content/browser.css 2021-09-28 01:17:27.000000000 +0200
+++ b/browser/base/content/browser.css 2021-10-12 15:48:21.482190973 +0200
@@ -1642,3 +1642,11 @@
/**
* End Dialogs
*/
+
+.bookmark-item {
+ margin: 0px !important;
+ padding: 0px !important;
+}
+#PlacesToolbar {
+ height: 27px !important;
+}
--- a/browser/themes/shared/tabs.inc.css 2021-09-28 00:46:31.000000000 +0200
+++ b/browser/themes/shared/tabs.inc.css 2021-10-12 15:55:22.390190531 +0200
@@ -278,7 +278,7 @@
}
.tab-icon-image {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
@@ -752,7 +752,7 @@
}
.all-tabs-button {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
}
.all-tabs-secondary-button > label {
--- a/browser/themes/shared/aboutSessionRestore.css 2021-09-28 01:17:27.000000000 +0200
+++ b/browser/themes/shared/aboutSessionRestore.css 2021-10-12 15:56:47.191190442 +0200
@@ -63,7 +63,7 @@
}
treechildren::-moz-tree-image(noicon) {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
--- a/browser/themes/shared/customizableui/panelUI.inc.css 2021-09-28 01:17:27.000000000 +0200
+++ b/browser/themes/shared/customizableui/panelUI.inc.css 2021-10-12 15:58:32.361190332 +0200
@@ -1394,7 +1394,7 @@
.PanelUI-remotetabs-clientcontainer > toolbarbutton[itemtype="tab"],
#PanelUI-historyItems > toolbarbutton {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
--- a/browser/themes/shared/searchbar.inc.css 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/themes/shared/searchbar.inc.css 2021-10-12 15:59:11.861190291 +0200
@@ -5,7 +5,7 @@
.searchbar-engine-image {
width: 16px;
height: 16px;
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
--- a/browser/themes/shared/places/tree-icons.css 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/themes/shared/places/tree-icons.css 2021-10-12 16:00:05.215190235 +0200
@@ -8,7 +8,7 @@
}
treechildren::-moz-tree-image(title) {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
padding-inline-end: 2px;
margin: 0 2px;
width: 16px;
--- a/browser/themes/shared/syncedtabs/sidebar.inc.css 2021-09-28 00:46:26.000000000 +0200
+++ b/browser/themes/shared/syncedtabs/sidebar.inc.css 2021-10-12 16:01:03.318190174 +0200
@@ -132,7 +132,7 @@
}
.item.tab > .item-title-container > .item-icon-container {
- background-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ background-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
--- a/browser/themes/shared/aboutWelcomeBack.css 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/themes/shared/aboutWelcomeBack.css 2021-10-12 16:01:43.595190132 +0200
@@ -22,7 +22,7 @@
}
treechildren::-moz-tree-image(noicon) {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}
--- a/browser/themes/shared/toolbarbutton-icons.inc.css 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/themes/shared/toolbarbutton-icons.inc.css 2021-10-12 16:02:37.571190075 +0200
@@ -429,7 +429,7 @@
/* ----- BOOKMARK BUTTONS ----- */
.bookmark-item {
- list-style-image: url("chrome://global/skin/icons/defaultFavicon.svg");
+ list-style-image: url("chrome://browser/skin/defaultFavicon.png");
-moz-context-properties: fill;
fill: currentColor;
}

314
patches/defsites.patch Normal file
View File

@ -0,0 +1,314 @@
--- a/browser/components/newtab/lib/DefaultSites.jsm 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/components/newtab/lib/DefaultSites.jsm 2021-10-12 11:02:34.976208950 +0200
@@ -8,40 +8,8 @@
// This first item is the global list fallback for any unexpected geos
[
"",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.reddit.com/,https://www.amazon.com/,https://twitter.com/",
- ],
- [
- "US",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://twitter.com/",
- ],
- [
- "CA",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.wikipedia.org/,https://www.amazon.ca/,https://twitter.com/",
- ],
- [
- "DE",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.amazon.de/,https://www.ebay.de/,https://www.wikipedia.org/,https://www.reddit.com/",
- ],
- [
- "PL",
- "https://www.youtube.com/,https://www.facebook.com/,https://allegro.pl/,https://www.wikipedia.org/,https://www.olx.pl/,https://www.wykop.pl/",
- ],
- [
- "RU",
- "https://vk.com/,https://www.youtube.com/,https://ok.ru/,https://www.avito.ru/,https://www.aliexpress.com/,https://www.wikipedia.org/",
- ],
- [
- "GB",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.reddit.com/,https://www.amazon.co.uk/,https://www.bbc.co.uk/,https://www.ebay.co.uk/",
- ],
- [
- "FR",
- "https://www.youtube.com/,https://www.facebook.com/,https://www.wikipedia.org/,https://www.amazon.fr/,https://www.leboncoin.fr/,https://twitter.com/",
- ],
- [
- "CN",
- "https://www.baidu.com/,https://www.zhihu.com/,https://www.ifeng.com/,https://weibo.com/,https://www.ctrip.com/,https://www.iqiyi.com/",
- ],
+ "https://duck.com/",
+ ]
]);
this.EXPORTED_SYMBOLS = ["DEFAULT_SITES"];
--- a/browser/components/places/CommonNames.jsm 2021-09-28 01:17:27.000000000 +0200
+++ b/browser/components/places/CommonNames.jsm 2021-10-12 11:10:58.952208421 +0200
@@ -20,265 +20,7 @@
* a site doesn't expose site_name metadata. Maps a site's hostname (not
* including `www.`) to its common name.
*/
-const CUSTOM_NAMES = new Map([
- ["adobe.com", "Adobe"],
- ["adp.com", "ADP"],
- ["airbnb.com", "Airbnb"],
- ["alibaba.com", "Alibaba"],
- ["aliexpress.com", "AliExpress"],
- ["aliexpress.ru", "AliExpress.ru"],
- ["allegro.pl", "Allegro"],
- ["amazon.ca", "Amazon.ca"],
- ["amazon.co.jp", "Amazon.co.jp"],
- ["amazon.co.uk", "Amazon.co.uk"],
- ["amazon.com", "Amazon"],
- ["amazon.de", "Amazon.de"],
- ["amazon.es", "Amazon.es"],
- ["amazon.fr", "Amazon.fr"],
- ["amazon.in", "Amazon.in"],
- ["amazon.it", "Amazon.it"],
- ["amazonaws.com", "AWS"],
- ["americanexpress.com", "American Express"],
- ["ameritrade.com", "TD Ameritrade"],
- ["aol.com", "AOL"],
- ["apple.com", "Apple"],
- ["archive.org", "Internet Archive"],
- ["ask.com", "Ask.com"],
- ["att.com", "AT&T"],
- ["aws.amazon.com", "AWS"],
- ["bankofamerica.com", "Bank of America"],
- ["bbc.co.uk", "BBC"],
- ["bbc.com", "BBC"],
- ["bestbuy.com", "Best Buy"],
- ["bing.com", "Bing"],
- ["blogger.com", "Blogger"],
- ["bloomberg.com", "Bloomberg"],
- ["bluehost.com", "Bluehost"],
- ["booking.com", "Booking.com"],
- ["bscscan.com", "BscScan"],
- ["businessinsider.com", "Insider"],
- ["ca.gov", "California State Portal"],
- ["canada.ca", "Government of Canada"],
- ["canva.com", "Canva"],
- ["capitalone.com", "Capital One"],
- ["cdc.gov", "CDC.gov"],
- ["chase.com", "Chase"],
- ["chess.com", "Chess.com"],
- ["citi.com", "Citi.com"],
- ["cj.com", "CJ Affiliate"],
- ["cnbc.com", "CNBC"],
- ["cnet.com", "CNET"],
- ["cnn.com", "CNN"],
- ["cnnindonesia.com", "CNN Indonesia"],
- ["coingecko.com", "CoinGecko"],
- ["coinmarketcap.com", "CoinMarketCap"],
- ["constantcontact.com", "Constant Contact"],
- ["coursera.org", "Coursera"],
- ["cowin.gov.in", "CoWIN"],
- ["craigslist.org", "Craigslist"],
- ["dailymail.co.uk", "Daily Mail"],
- ["dailymotion.com", "Dailymotion"],
- ["deepl.com", "DeepL"],
- ["dell.com", "Dell"],
- ["discord.com", "Discord"],
- ["disneyplus.com", "Disney+"],
- ["docs.google.com", "Google Docs"],
- ["docusign.net", "DocuSign"],
- ["drive.google.com", "Google Drive"],
- ["dropbox.com", "Dropbox"],
- ["duckduckgo.com", "DuckDuckGo"],
- ["ebay.co.uk", "eBay"],
- ["ebay.com", "eBay"],
- ["ebay.de", "eBay"],
- ["espn.com", "ESPN"],
- ["etherscan.io", "Etherscan"],
- ["etrade.com", "E*TRADE"],
- ["etsy.com", "Etsy"],
- ["evernote.com", "Evernote"],
- ["expedia.com", "Expedia"],
- ["facebook.com", "Facebook"],
- ["fandom.com", "Fandom"],
- ["fast.com", "Fast.com"],
- ["fedex.com", "FedEx"],
- ["feedly.com", "Feedly"],
- ["fidelity.com", "Fidelity"],
- ["fiverr.com", "Fiverr"],
- ["flickr.com", "Flickr"],
- ["flipkart.com", "Flipkart"],
- ["force.com", "Salesforce"],
- ["foxnews.com", "Fox News"],
- ["freshdesk.com", "Freshdesk"],
- ["geeksforgeeks.org", "GeeksforGeeks"],
- ["github.com", "GitHub"],
- ["glassdoor.com", "Glassdoor"],
- ["gmail.com", "Gmail"],
- ["godaddy.com", "GoDaddy"],
- ["goodreads.com", "Goodreads"],
- ["google.az", "Google"],
- ["google.ca", "Google"],
- ["google.cn", "Google"],
- ["google.co.id", "Google"],
- ["google.co.in", "Google"],
- ["google.co.jp", "Google"],
- ["google.co.th", "Google"],
- ["google.co.uk", "Google"],
- ["google.com", "Google"],
- ["google.com.ar", "Google"],
- ["google.com.au", "Google"],
- ["google.com.br", "Google"],
- ["google.com.eg", "Google"],
- ["google.com.hk", "Google"],
- ["google.com.mx", "Google"],
- ["google.com.sa", "Google"],
- ["google.com.sg", "Google"],
- ["google.com.tr", "Google"],
- ["google.com.tw", "Google"],
- ["google.de", "Google"],
- ["google.es", "Google"],
- ["google.fr", "Google"],
- ["google.it", "Google"],
- ["google.pl", "Google"],
- ["google.ru", "Google"],
- ["googlevideo.com", "Google Video"],
- ["grammarly.com", "Grammarly"],
- ["hbomax.com", "HBO Max"],
- ["healthline.com", "Healthline"],
- ["homedepot.com", "The Home Depot"],
- ["hootsuite.com", "Hootsuite"],
- ["hostgator.com", "HostGator"],
- ["hotstar.com", "Hotstar"],
- ["hp.com", "HP"],
- ["hulu.com", "Hulu"],
- ["icicibank.com", "ICICI Bank"],
- ["ikea.com", "IKEA"],
- ["ilovepdf.com", "iLovePDF"],
- ["imdb.com", "IMDb"],
- ["imgur.com", "Imgur"],
- ["indeed.com", "Indeed"],
- ["indiamart.com", "IndiaMART"],
- ["indiatimes.com", "Indiatimes"],
- ["instagram.com", "Instagram"],
- ["instructure.com", "Instructure"],
- ["intuit.com", "Intuit"],
- ["investing.com", "Investing.com"],
- ["iqbroker.com", "IQ Option"],
- ["irs.gov", "IRS.gov"],
- ["istockphoto.com", "iStock"],
- ["japanpost.jp", "Japan Post"],
- ["kayak.com ", "Kayak"],
- ["linkedin.com", "LinkedIn"],
- ["linktr.ee", "Linktree"],
- ["live.com", "Live"],
- ["loom.com", "Loom"],
- ["mail.google.com", "Gmail"],
- ["mailchimp.com", "Mailchimp"],
- ["manage.wix.com", "Wix"],
- ["maps.google.com", "Google Maps"],
- ["marca.com", "MARCA"],
- ["mediafire.com", "MediaFire"],
- ["mercadolibre.com.mx", "Mercado Libre"],
- ["mercadolivre.com.br", "Mercado Livre"],
- ["mercari.com", "Mercari"],
- ["microsoft.com", "Microsoft"],
- ["mlb.com", "MLB.com"],
- ["moneycontrol.com", "moneycontrol.com"],
- ["mozilla.org", "Mozilla"],
- ["msn.com", "MSN"],
- ["myshopify.com", "Shopify"],
- ["myworkdayjobs.com", "Workday"],
- ["naukri.com", "Naukri.com"],
- ["ndtv.com", "NDTV.com"],
- ["netflix.com", "Netflix"],
- ["nih.gov", "National Institutes of Health (NIH)"],
- ["nike.com", "Nike"],
- ["nordstrom.com", "Nordstrom"],
- ["notion.so", "Notion"],
- ["nypost.com", "New York Post"],
- ["nytimes.com", "New York Times"],
- ["office.com", "Office"],
- ["office365.com", "Office 365"],
- ["olympics.com", "Olympics"],
- ["onlinesbi.com", "State Bank of India"],
- ["orange.fr", "Orange"],
- ["patreon.com", "Patreon"],
- ["paypal.com", "PayPal"],
- ["pinterest.com", "Pinterest"],
- ["primevideo.com", "Prime Video"],
- ["quora.com", "Quora"],
- ["rakuten.co.jp", "Rakuten"],
- ["rakuten.com", "Rakuten"],
- ["realtor.com", "Realtor.com"],
- ["redd.it", "Reddit"],
- ["reddit.com", "Reddit"],
- ["redfin.com", "Redfin"],
- ["researchgate.net", "ResearchGate"],
- ["reuters.com", "Reuters"],
- ["reverso.net", "Reverso"],
- ["roblox.com", "Roblox"],
- ["rt.com", "RT"],
- ["salesforce.com", "Salesforce"],
- ["samsung.com", "Samsung"],
- ["scribd.com", "Scribd"],
- ["sheets.google.com", "Google Sheets"],
- ["shein.com", "Shein"],
- ["shutterstock.com", "Shutterstock"],
- ["skype.com", "Skype"],
- ["slides.google.com", "Google Slides"],
- ["slideshare.net", "SlideShare"],
- ["soundcloud.com", "SoundCloud"],
- ["speedtest.net", "Speedtest"],
- ["spotify.com", "Spotify"],
- ["squarespace.com", "Squarespace"],
- ["stackexchange.com", "Stack Exchange"],
- ["stackoverflow.com", "Stack Overflow"],
- ["steampowered.com", "Steam"],
- ["taboola.com", "Taboola.com"],
- ["target.com", "Target"],
- ["td.com", "TD Bank"],
- ["telegram.org", "Telegram"],
- ["theguardian.com", "The Guardian"],
- ["tiktok.com", "TikTok"],
- ["tmall.com", "Tmall"],
- ["tokopedia.com", "Tokopedia"],
- ["trello.com", "Trello"],
- ["tripadvisor.com", "Tripadvisor"],
- ["trustpilot.com", "Trustpilot"],
- ["twitch.tv", "Twitch"],
- ["twitter.com", "Twitter"],
- ["udemy.com", "Udemy"],
- ["unsplash.com", "Unsplash"],
- ["ups.com", "UPS"],
- ["upwork.com", "Upwork"],
- ["usps.com", "USPS"],
- ["vimeo.com", "Vimeo"],
- ["w3schools.com", "W3Schools"],
- ["walmart.com", "Walmart"],
- ["washingtonpost.com", "Washington Post"],
- ["wayfair.com", "Wayfair"],
- ["weather.com", "The Weather Channel"],
- ["webmd.com", "WebMD"],
- ["wellsfargo.com", "Wells Fargo"],
- ["wetransfer.com", "WeTransfer"],
- ["whatsapp.com", "WhatsApp"],
- ["wikihow.com", "wikiHow"],
- ["wikimedia.org", "Wikimedia Commons"],
- ["wikipedia.org", "Wikipedia"],
- ["wildberries.ru", "Wildberries"],
- ["wordpress.org", "WordPress.org"],
- ["worldometers.info", "Worldometer"],
- ["wsj.com", "Wall Street Journal"],
- ["xfinity.com", "Xfinity"],
- ["y2mate.com", "Y2mate"],
- ["yahoo.co.jp", "Yahoo Japan"],
- ["yahoo.com", "Yahoo"],
- ["yandex.ru", "Yandex"],
- ["yelp.com", "Yelp"],
- ["youtube.com", "YouTube"],
- ["zendesk.com", "Zendesk"],
- ["zerodha.com", "Zerodha"],
- ["zillow.com", "Zillow"],
- ["zoom.us", "Zoom"],
-]);
+const CUSTOM_NAMES = new Map([]);
/**
* Maps the domains from CUSTOM_NAMES to a regex that matches a URL ending with

38
patches/icons.patch Normal file
View File

@ -0,0 +1,38 @@
diff --git a/browser/themes/shared/jar.inc.mn b/browser/themes/shared/jar.inc.mn
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -116,9 +116,9 @@
skin/classic/browser/add-circle-fill.svg (../shared/icons/add-circle-fill.svg)
skin/classic/browser/back.svg (../shared/icons/back.svg)
- skin/classic/browser/bookmark.svg (../shared/icons/bookmark.svg)
+ skin/classic/browser/starred48.png (../shared/icons/starred48.png)
skin/classic/browser/bookmark-12.svg (../shared/icons/bookmark-12.svg)
- skin/classic/browser/bookmark-hollow.svg (../shared/icons/bookmark-hollow.svg)
+ skin/classic/browser/unstarred48.png (../shared/icons/unstarred48.png)
skin/classic/browser/bookmark-star-on-tray.svg (../shared/icons/bookmark-star-on-tray.svg)
skin/classic/browser/bookmarks-toolbar.svg (../shared/icons/bookmarks-toolbar.svg)
skin/classic/browser/canvas.svg (../shared/icons/canvas.svg)
@@ -143,6 +143,22 @@
skin/classic/browser/history.svg (../shared/icons/history.svg)
skin/classic/browser/home.svg (../shared/icons/home.svg)
skin/classic/browser/import.svg (../shared/icons/import.svg)
+ skin/classic/browser/back.png (../shared/icons/back.png)
+ skin/classic/browser/back_hover.png (../shared/icons/back_hover.png)
+ skin/classic/browser/forward.png (../shared/icons/forward.png)
+ skin/classic/browser/forward_hover.png (../shared/icons/forward_hover.png)
+ skin/classic/browser/stop.png (../shared/icons/stop.png)
+ skin/classic/browser/stop_hover.png (../shared/icons/stop_hover.png)
+ skin/classic/browser/home.png (../shared/icons/home.png)
+ skin/classic/browser/home_hover.png (../shared/icons/home_hover.png)
+ skin/classic/browser/refresh.png (../shared/icons/refresh.png)
+ skin/classic/browser/refresh_hover.png (../shared/icons/refresh_hover.png)
+ skin/classic/browser/tab-close.png (../shared/icons/tab-close.png)
+ skin/classic/browser/tab-close_hover.png (../shared/icons/tab-close_hover.png)
+ skin/classic/browser/tab-close_inactive.png (../shared/icons/tab-close_inactive.png)
+ skin/classic/browser/fox_happy.png (../shared/icons/fox_happy.png)
+ skin/classic/browser/fox_crying.png (../shared/icons/fox_crying.png)
+ skin/classic/browser/defaultFavicon.png (../shared/icons/defaultFavicon.png)
#ifndef MOZ_WIDGET_GTK
skin/classic/browser/import-export.svg (../shared/icons/import-export.svg)
#endif

View File

@ -27,10 +27,9 @@ diff --git a/browser/themes/shared/urlbar-searchbar.inc.css b/browser/themes/sha
index e80aaf6..6ec0961 100644
--- a/browser/themes/shared/urlbar-searchbar.inc.css
+++ b/browser/themes/shared/urlbar-searchbar.inc.css
@@ -5,7 +5,7 @@
@@ -5,6 +5,6 @@
%endif
%define fieldHoverBorderColor hsla(240,5%,5%,.35)
-%define urlbarMarginInline 5px
+%define urlbarMarginInline 0px
%define urlbarSearchButtonWidth calc(16px + 2 * var(--urlbar-icon-padding))

View File

@ -1,24 +1,30 @@
diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
index f8a1764..ebf4206 100644
index 32c9146..f645288 100644
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.html
@@ -54,10 +54,11 @@
<div class="info">
<h1 id="info-title" data-l10n-id="about-private-browsing-info-title"></h1>
<p id="info-body" data-l10n-id="about-private-browsing-info-description"></p>
- <a id="private-browsing-myths" data-l10n-id="about-private-browsing-info-myths"></a>
+<!-- <a id="private-browsing-myths" data-l10n-id="about-private-browsing-info-myths"></a> -->
@@ -51,14 +51,14 @@
<div class="fake-caret"></div>
</button>
</div>
- <div class="info">
+ <!--div class="info">
<h1 id="info-title"></h1>
<p id="info-body"></p>
<a id="private-browsing-myths"></a>
- </div>
+ </div-->
</div>
+ <!--
<div class="promo">
- <div class="promo">
+ <!--div class="promo">
<div class="promo-image-large">
<img src="" alt="" />
@@ -73,5 +74,6 @@
</div>
@@ -72,6 +72,6 @@
</div>
</div>
</div>
</div>
+ -->
- </div>
+ </div-->
</body>
</html>

View File

@ -1,94 +1,76 @@
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 753c4df..8eefc56 100644
index 50a64a2..79d7d9c 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -302,16 +302,16 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
@@ -303,16 +303,16 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType,
getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv)) {
- rv = localDir->AppendNative("Mozilla"_ns);
+ rv = localDir->AppendNative("LibreWolf"_ns);
+ rv = localDir->AppendNative("Foxgirl"_ns);
}
# else
constexpr auto dirname =
# ifdef HAVE_USR_LIB64_DIR
- "/usr/lib64/mozilla"_ns
+ "/usr/lib64/librewolf"_ns
+ "/usr/lib64/foxgirl"_ns
# elif defined(__OpenBSD__) || defined(__FreeBSD__)
- "/usr/local/lib/mozilla"_ns
+ "/usr/local/lib/librewolf"_ns
+ "/usr/local/lib/foxgirl"_ns
# else
- "/usr/lib/mozilla"_ns
+ "/usr/lib/librewolf"_ns
+ "/usr/lib/foxgirl"_ns
# endif
;
rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
@@ -417,9 +417,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
@@ -413,9 +413,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false);
if (NS_SUCCEEDED(rv)) {
# if defined(XP_MACOSX)
- rv = localDir->AppendNative("Mozilla"_ns);
+ rv = localDir->AppendNative("LibreWolf"_ns);
+ rv = localDir->AppendNative("Foxgirl"_ns);
# else
- rv = localDir->AppendNative(".mozilla"_ns);
+ rv = localDir->AppendNative(".librewolf"_ns);
+ rv = localDir->AppendNative(".foxgirl"_ns);
# endif
}
if (NS_SUCCEEDED(rv)) {
@@ -469,9 +469,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
@@ -465,9 +465,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) {
# ifdef ENABLE_SYSTEM_EXTENSION_DIRS
# if defined(__OpenBSD__) || defined(__FreeBSD__)
- static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions";
+ static const char* const sysLExtDir = "/usr/local/share/librewolf/extensions";
+ static const char* const sysLExtDir = "/usr/local/share/foxgirl/extensions";
# else
- static const char* const sysLExtDir = "/usr/share/mozilla/extensions";
+ static const char* const sysLExtDir = "/usr/share/librewolf/extensions";
+ static const char* const sysLExtDir = "/usr/share/foxgirl/extensions";
# endif
return NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, aFile);
# else
@@ -1278,7 +1278,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
@@ -1276,7 +1276,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
return NS_ERROR_FAILURE;
}
- } else if (NS_FAILED(localDir->AppendNative("Mozilla"_ns))) {
+ } else if (NS_FAILED(localDir->AppendNative("LibreWolf"_ns))) {
+ } else if (NS_FAILED(localDir->AppendNative("Foxgril"_ns))) {
return NS_ERROR_FAILURE;
}
@@ -1584,7 +1584,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
@@ -1559,7 +1559,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
#if defined(XP_MACOSX) || defined(XP_WIN)
- static const char* const sXR = "Mozilla";
+ static const char* const sXR = "LibreWolf";
+ static const char* const sXR = "Foxgirl";
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1594,7 +1594,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
@@ -1569,7 +1569,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
#elif defined(XP_UNIX)
- static const char* const sXR = ".mozilla";
+ static const char* const sXR = ".librewolf";
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1615,7 +1615,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
#if defined(XP_MACOSX) || defined(XP_WIN)
- static const char* const sXR = "Mozilla";
+ static const char* const sXR = "LibreWolf";
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1625,7 +1625,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
#elif defined(XP_UNIX)
- static const char* const sXR = ".mozilla";
+ static const char* const sXR = ".librewolf";
+ static const char* const sXR = ".foxgirl";
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);

File diff suppressed because it is too large Load Diff

20
patches/smile.patch Normal file
View File

@ -0,0 +1,20 @@
--- a/browser/themes/shared/preferences/preferences.inc.css 2021-09-28 01:17:27.000000000 +0200
+++ b/browser/themes/shared/preferences/preferences.inc.css 2021-10-12 15:18:19.065192862 +0200
@@ -908,7 +908,7 @@
}
.face-sad {
- list-style-image: url("chrome://browser/skin/preferences/face-sad.svg");
+ list-style-image: url("chrome://browser/skin/fox_crying.png");
width: 20px;
height: 20px;
margin-block: 5px;
@@ -916,7 +916,7 @@
}
.face-smile {
- list-style-image: url("chrome://browser/skin/preferences/face-smile.svg");
+ list-style-image: url("chrome://browser/skin/fox_happy.png");
width: 20px;
height: 20px;
margin-block: 5px;

35
patches/strings.patch Normal file
View File

@ -0,0 +1,35 @@
--- a/browser/locales/en-US/browser/browserContext.ftl 2021-09-28 00:46:32.000000000 +0200
+++ b/browser/locales/en-US/browser/browserContext.ftl 2021-10-12 15:37:50.134191634 +0200
@@ -256,11 +256,11 @@
.accesskey = R
main-context-menu-image-view-new-tab =
- .label = Open Image in New Tab
+ .label = View Image
.accesskey = I
main-context-menu-video-view-new-tab =
- .label = Open Video in New Tab
+ .label = View Video
.accesskey = i
main-context-menu-image-copy =
@@ -425,6 +425,9 @@
.label = View Page Source
.accesskey = V
+main-context-menu-view-page-info =
+ .label = View Page Info
+
main-context-menu-bidi-switch-text =
.label = Switch Text Direction
.accesskey = w
@@ -434,7 +437,7 @@
.accesskey = D
main-context-menu-inspect =
- .label = Inspect
+ .label = Inspect Element
.accesskey = Q
main-context-menu-inspect-a11y-properties =

View File

@ -3517,7 +3517,7 @@
+{
+ RefPtr<ComputedStyle> style =
+ nsComputedDOMStyle::GetComputedStyleNoFlush(
+ mContent->AsElement(), nullptr);
+ mContent->AsElement());
+
+ return style.forget();
+}

205
patches/urlbar.patch Normal file
View File

@ -0,0 +1,205 @@
--- firefox-94.0/browser/base/content/navigator-toolbox.inc.xhtml
+++ _firefox/browser/base/content/navigator-toolbox.inc.xhtml
@@ -28,71 +28,6 @@
#include titlebar-items.inc.xhtml
</toolbar>
- <toolbar id="TabsToolbar"
- class="browser-toolbar titlebar-color"
- fullscreentoolbar="true"
- customizable="true"
- customizationtarget="TabsToolbar-customization-target"
- mode="icons"
- data-l10n-id="tabs-toolbar"
- context="toolbar-context-menu"
- flex="1">
-
- <hbox class="titlebar-spacer" type="pre-tabs"/>
-
- <hbox flex="1" align="end" class="toolbar-items">
- <hbox id="TabsToolbar-customization-target" flex="1">
- <tabs id="tabbrowser-tabs"
- is="tabbrowser-tabs"
- flex="1"
- aria-multiselectable="true"
- setfocus="false"
- tooltip="tabbrowser-tab-tooltip"
- stopwatchid="FX_TAB_CLICK_MS">
- <hbox class="tab-drop-indicator" hidden="true"/>
- <arrowscrollbox id="tabbrowser-arrowscrollbox" orient="horizontal" flex="1" style="min-width: 1px;" clicktoscroll="true" scrolledtostart="true" scrolledtoend="true">
- <tab is="tabbrowser-tab" class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
- <toolbarbutton id="tabs-newtab-button"
- class="toolbarbutton-1"
- command="cmd_newNavigatorTab"
- onclick="checkForMiddleClick(this, event);"
- tooltip="dynamic-shortcut-tooltip"/>
- <spacer class="closing-tabs-spacer" style="width: 0;"/>
- </arrowscrollbox>
- <html:span id="tabbrowser-tab-a11y-desc" hidden="true"/>
- </tabs>
-
- <toolbarbutton id="new-tab-button"
- class="toolbarbutton-1 chromeclass-toolbar-additional"
- data-l10n-id="tabs-toolbar-new-tab"
- command="cmd_newNavigatorTab"
- onclick="checkForMiddleClick(this, event);"
- tooltip="dynamic-shortcut-tooltip"
- ondrop="newTabButtonObserver.onDrop(event)"
- ondragover="newTabButtonObserver.onDragOver(event)"
- ondragenter="newTabButtonObserver.onDragOver(event)"
- cui-areatype="toolbar"
- removable="true"/>
-
- <toolbarbutton id="alltabs-button"
- class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button"
- badged="true"
- oncommand="gTabsPanel.showAllTabsPanel(event);"
- data-l10n-id="tabs-toolbar-list-all-tabs"
- removable="false"/>
- </hbox>
- </hbox>
-
- <hbox class="titlebar-spacer" type="post-tabs"/>
-
- <button class="accessibility-indicator" data-l10n-id="navbar-accessibility-indicator"
- aria-live="polite"/>
- <hbox class="private-browsing-indicator"/>
-
-#include titlebar-items.inc.xhtml
-
- </toolbar>
-
</vbox>
<toolbar id="nav-bar"
@@ -125,9 +60,16 @@
onclick="checkForMiddleClick(this, event);"
tooltip="forward-button-tooltip"
context="backForwardMenu"/>
- <toolbaritem id="stop-reload-button" class="chromeclass-toolbar-additional"
- data-l10n-id="toolbar-button-stop-reload"
- removable="true" overflows="false">
+ <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
+ removable="true"
+ label="&homeButton.label;"
+ ondragover="homeButtonObserver.onDragOver(event)"
+ ondragenter="homeButtonObserver.onDragOver(event)"
+ ondrop="homeButtonObserver.onDrop(event)"
+ key="goHome"
+ onclick="BrowserHome(event);"
+ cui-areatype="toolbar"
+ tooltiptext="&homeButton.defaultPage.tooltip;"/>
<toolbarbutton id="reload-button" class="toolbarbutton-1"
data-l10n-id="toolbar-button-reload"
command="Browser:ReloadOrDuplicate"
@@ -145,8 +87,6 @@
<image class="toolbarbutton-animatable-image"/>
</box>
</toolbarbutton>
- </toolbaritem>
- <toolbarspring cui-areatype="toolbar" class="chromeclass-toolbar-additional"/>
<toolbaritem id="urlbar-container" flex="400" persist="width"
removable="false"
class="chromeclass-location" overflows="false">
@@ -168,20 +108,6 @@
class="chromeclass-toolbar-additional"/>
<!-- Use onclick instead of normal popup= syntax since the popup
code fires onmousedown, and hence eats our favicon drag events. -->
- <box id="tracking-protection-icon-container" align="center"
- role="button"
- onclick="gProtectionsHandler.handleProtectionsButtonEvent(event);"
- onkeypress="gProtectionsHandler.handleProtectionsButtonEvent(event);"
- onmouseover="gProtectionsHandler.onTrackingProtectionIconHoveredOrFocused();"
- onfocus="gProtectionsHandler.onTrackingProtectionIconHoveredOrFocused();"
- tooltip="tracking-protection-icon-tooltip">
- <box id="tracking-protection-icon-box">
- <image id="tracking-protection-icon"/>
- </box>
- <tooltip id="tracking-protection-icon-tooltip">
- <description id="tracking-protection-icon-tooltip-label" class="tooltip-label"/>
- </tooltip>
- </box>
<box id="identity-box"
pageproxystate="invalid"
ondragstart="gIdentityHandler.onDragStart(event);">
@@ -368,8 +294,6 @@
<toolbartabstop/>
</toolbaritem>
- <toolbarspring cui-areatype="toolbar" class="chromeclass-toolbar-additional"/>
-
<toolbarbutton id="downloads-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
badged="true"
@@ -526,6 +450,71 @@
</hbox>
</toolbaritem>
</toolbar>
+
+ <toolbar id="TabsToolbar"
+ class="browser-toolbar titlebar-color"
+ fullscreentoolbar="true"
+ customizable="true"
+ customizationtarget="TabsToolbar-customization-target"
+ mode="icons"
+ data-l10n-id="tabs-toolbar"
+ context="toolbar-context-menu"
+ flex="1">
+
+ <hbox class="titlebar-spacer" type="pre-tabs"/>
+
+ <hbox flex="1" align="end" class="toolbar-items">
+ <hbox id="TabsToolbar-customization-target" flex="1">
+ <tabs id="tabbrowser-tabs"
+ is="tabbrowser-tabs"
+ flex="1"
+ aria-multiselectable="true"
+ setfocus="false"
+ tooltip="tabbrowser-tab-tooltip"
+ stopwatchid="FX_TAB_CLICK_MS">
+ <hbox class="tab-drop-indicator" hidden="true"/>
+ <arrowscrollbox id="tabbrowser-arrowscrollbox" orient="horizontal" flex="1" style="min-width: 1px;" clicktoscroll="true" scrolledtostart="true" scrolledtoend="true">
+ <tab is="tabbrowser-tab" class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
+ <toolbarbutton id="tabs-newtab-button"
+ class="toolbarbutton-1"
+ command="cmd_newNavigatorTab"
+ onclick="checkForMiddleClick(this, event);"
+ tooltip="dynamic-shortcut-tooltip"/>
+ <spacer class="closing-tabs-spacer" style="width: 0;"/>
+ </arrowscrollbox>
+ <html:span id="tabbrowser-tab-a11y-desc" hidden="true"/>
+ </tabs>
+
+ <toolbarbutton id="new-tab-button"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
+ data-l10n-id="tabs-toolbar-new-tab"
+ command="cmd_newNavigatorTab"
+ onclick="checkForMiddleClick(this, event);"
+ tooltip="dynamic-shortcut-tooltip"
+ ondrop="newTabButtonObserver.onDrop(event)"
+ ondragover="newTabButtonObserver.onDragOver(event)"
+ ondragenter="newTabButtonObserver.onDragOver(event)"
+ cui-areatype="toolbar"
+ removable="true"/>
+
+ <toolbarbutton id="alltabs-button"
+ class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button"
+ badged="true"
+ oncommand="gTabsPanel.showAllTabsPanel(event);"
+ data-l10n-id="tabs-toolbar-list-all-tabs"
+ removable="false"/>
+ </hbox>
+ </hbox>
+
+ <hbox class="titlebar-spacer" type="post-tabs"/>
+
+ <button class="accessibility-indicator" data-l10n-id="navbar-accessibility-indicator"
+ aria-live="polite"/>
+ <hbox class="private-browsing-indicator"/>
+
+#include titlebar-items.inc.xhtml
+
+ </toolbar>
<html:template id="tab-notification-deck-template">
<html:named-deck id="tab-notification-deck"></html:named-deck>

View File

@ -0,0 +1,849 @@
diff -ur a/netwerk/base/RequestContextService.cpp b/netwerk/base/RequestContextService.cpp
--- a/netwerk/base/RequestContextService.cpp 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/base/RequestContextService.cpp 2021-10-20 21:16:24.413520944 +0200
@@ -60,6 +60,7 @@
uint64_t mID;
Atomic<uint32_t> mBlockingTransactionCount;
UniquePtr<SpdyPushCache> mSpdyCache;
+ nsCString mUserAgentOverride;
using PendingTailRequest = nsCOMPtr<nsIRequestTailUnblockCallback>;
// Number of known opened non-tailed requets
@@ -186,6 +187,15 @@
uint64_t RequestContext::GetID() { return mID; }
+const nsACString& RequestContext::GetUserAgentOverride() {
+ return mUserAgentOverride;
+}
+
+void RequestContext::SetUserAgentOverride(
+ const nsACString& aUserAgentOverride) {
+ mUserAgentOverride = aUserAgentOverride;
+}
+
NS_IMETHODIMP
RequestContext::AddNonTailRequest() {
MOZ_ASSERT(NS_IsMainThread());
diff -ur a/netwerk/base/nsILoadGroup.idl b/netwerk/base/nsILoadGroup.idl
--- a/netwerk/base/nsILoadGroup.idl 2021-09-28 00:46:56.000000000 +0200
+++ b/netwerk/base/nsILoadGroup.idl 2021-10-20 21:17:31.740524540 +0200
@@ -96,6 +96,8 @@
*/
attribute nsLoadFlags defaultLoadFlags;
+ attribute ACString userAgentOverrideCache;
+
/**
* Returns true if the loadGroup belongs to a discarded context, such as, a
* terminated private browsing session.
diff -ur a/netwerk/base/nsIRequestContext.idl b/netwerk/base/nsIRequestContext.idl
--- a/netwerk/base/nsIRequestContext.idl 2021-09-28 00:47:20.000000000 +0200
+++ b/netwerk/base/nsIRequestContext.idl 2021-10-20 21:18:11.556526666 +0200
@@ -93,6 +93,8 @@
*/
[notxpcom,nostdcall] attribute SpdyPushCachePtr spdyPushCache;
+ [notxpcom,nostdcall] attribute ACString userAgentOverride;
+
/**
* Increases/decrease the number of non-tailed requests in this context.
* If the count drops to zero, all tail-blocked callbacks are notified
diff -ur a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp
--- a/netwerk/base/nsLoadGroup.cpp 2021-09-28 00:47:46.000000000 +0200
+++ b/netwerk/base/nsLoadGroup.cpp 2021-10-20 21:20:24.781533781 +0200
@@ -767,6 +767,19 @@
return NS_OK;
}
+NS_IMETHODIMP
+nsLoadGroup::GetUserAgentOverrideCache(nsACString& aUserAgentOverrideCache) {
+ aUserAgentOverrideCache = mUserAgentOverrideCache;
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsLoadGroup::SetUserAgentOverrideCache(
+ const nsACString& aUserAgentOverrideCache) {
+ mUserAgentOverrideCache = aUserAgentOverrideCache;
+ return NS_OK;
+}
+
////////////////////////////////////////////////////////////////////////////////
void nsLoadGroup::TelemetryReport() {
diff -ur a/netwerk/base/nsLoadGroup.h b/netwerk/base/nsLoadGroup.h
--- a/netwerk/base/nsLoadGroup.h 2021-09-28 00:47:20.000000000 +0200
+++ b/netwerk/base/nsLoadGroup.h 2021-10-20 21:19:17.732530200 +0200
@@ -103,6 +103,8 @@
mozilla::TimeStamp mDefaultRequestCreationTime;
uint32_t mTimedRequests{0};
uint32_t mCachedRequests{0};
+
+ nsCString mUserAgentOverrideCache;
};
} // namespace net
diff -ur a/netwerk/protocol/http/components.conf b/netwerk/protocol/http/components.conf
--- a/netwerk/protocol/http/components.conf 2021-09-28 00:47:17.000000000 +0200
+++ b/netwerk/protocol/http/components.conf 2021-10-20 21:46:26.687617196 +0200
@@ -6,6 +6,13 @@
Classes = [
{
+ 'cid': '{965b0ca8-155b-11e7-93ae-92361f002671}',
+ 'contract_ids': ['@mozilla.org/network/ua-overrides-bootstrapper;1'],
+ 'jsm': 'resource://gre/modules/UAOverridesBootstrapper.jsm',
+ 'constructor': 'UAOverridesBootstrapper',
+ 'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+ },
+ {
'cid': '{b4f96c89-5238-450c-8bda-e12c26f1d150}',
'contract_ids': ['@mozilla.org/network/well-known-opportunistic-utils;1'],
'jsm': 'resource://gre/modules/WellKnownOpportunisticUtils.jsm',
diff -ur a/netwerk/protocol/http/moz.build b/netwerk/protocol/http/moz.build
--- a/netwerk/protocol/http/moz.build 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/protocol/http/moz.build 2021-10-20 21:48:41.781624411 +0200
@@ -174,6 +174,7 @@
"PHttpTransaction.ipdl",
]
+
include("/ipc/chromium/chromium-config.mozbuild")
FINAL_LIBRARY = "xul"
@@ -190,7 +191,10 @@
]
EXTRA_JS_MODULES += [
+ "UAOverridesBootstrapper.jsm",
+ "UserAgentOverrides.jsm",
+ "UserAgentUpdates.jsm",
"WellKnownOpportunisticUtils.jsm",
]
XPCOM_MANIFESTS += [
diff -ur a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/protocol/http/nsHttpChannel.cpp 2021-10-20 21:29:52.377564094 +0200
@@ -436,6 +436,8 @@
nsresult nsHttpChannel::OnBeforeConnect() {
nsresult rv;
+ SetLoadGroupUserAgentOverride();
+
// Check if request was cancelled during suspend AFTER on-modify-request
if (mCanceled) {
return mStatus;
@@ -5428,6 +5430,8 @@
// notify "http-on-modify-request" observers
CallOnModifyRequestObservers();
+ SetLoadGroupUserAgentOverride();
+
// Check if request was cancelled during on-modify-request
if (mCanceled) {
return mStatus;
@@ -8640,6 +8644,48 @@
return aFunc(this);
}
+void nsHttpChannel::SetLoadGroupUserAgentOverride() {
+ nsCOMPtr<nsIURI> uri;
+ GetURI(getter_AddRefs(uri));
+ nsAutoCString uriScheme;
+ if (uri) {
+ uri->GetScheme(uriScheme);
+ }
+
+ // We don't need a UA for file: protocols.
+ if (uriScheme.EqualsLiteral("file")) {
+ gHttpHandler->OnUserAgentRequest(this);
+ return;
+ }
+
+ nsIRequestContextService* rcsvc = gHttpHandler->GetRequestContextService();
+ nsCOMPtr<nsIRequestContext> rc;
+ if (rcsvc) {
+ rcsvc->GetRequestContext(mRequestContextID, getter_AddRefs(rc));
+ }
+
+ nsAutoCString ua;
+ if (nsContentUtils::IsNonSubresourceRequest(this)) {
+ gHttpHandler->OnUserAgentRequest(this);
+ if (rc) {
+ GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
+ rc->SetUserAgentOverride(ua);
+ }
+ } else {
+ GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
+ // Don't overwrite the UA if it is already set (eg by an XHR with explicit
+ // UA).
+ if (ua.IsEmpty()) {
+ if (rc) {
+ SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"),
+ rc->GetUserAgentOverride(), false);
+ } else {
+ gHttpHandler->OnUserAgentRequest(this);
+ }
+ }
+ }
+}
+
// Step 10 of HTTP-network-or-cache fetch
void nsHttpChannel::SetOriginHeader() {
if (mRequestHead.IsGet() || mRequestHead.IsHead()) {
diff -ur a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
--- a/netwerk/protocol/http/nsHttpChannel.h 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/protocol/http/nsHttpChannel.h 2021-10-20 21:25:28.422549997 +0200
@@ -502,6 +502,8 @@
void SetPushedStreamTransactionAndId(
HttpTransactionShell* aTransWithPushedStream, uint32_t aPushedStreamId);
+ void SetLoadGroupUserAgentOverride();
+
void SetOriginHeader();
void SetDoNotTrack();
diff -ur a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
--- a/netwerk/protocol/http/nsHttpHandler.cpp 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/protocol/http/nsHttpHandler.cpp 2021-10-20 21:35:59.579583705 +0200
@@ -291,6 +291,24 @@
}
}
+void nsHttpHandler::EnsureUAOverridesInit() {
+ MOZ_ASSERT(XRE_IsParentProcess());
+ MOZ_ASSERT(NS_IsMainThread());
+
+ static bool initDone = false;
+
+ if (initDone) {
+ return;
+ }
+
+ nsresult rv;
+ nsCOMPtr<nsISupports> bootstrapper =
+ do_GetService("@mozilla.org/network/ua-overrides-bootstrapper;1", &rv);
+ MOZ_ASSERT(bootstrapper);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+ initDone = true;
+}
+
nsHttpHandler::~nsHttpHandler() {
LOG(("Deleting nsHttpHandler [this=%p]\n", this));
@@ -2031,6 +2049,11 @@
uint32_t caps = mCapabilities;
+ if (XRE_IsParentProcess()) {
+ // Load UserAgentOverrides.jsm before any HTTP request is issued.
+ EnsureUAOverridesInit();
+ }
+
uint64_t channelId;
nsresult rv = NewChannelId(channelId);
NS_ENSURE_SUCCESS(rv, rv);
diff -ur a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
--- a/netwerk/protocol/http/nsHttpHandler.h 2021-09-28 01:17:27.000000000 +0200
+++ b/netwerk/protocol/http/nsHttpHandler.h 2021-10-20 21:31:35.602569607 +0200
@@ -383,6 +383,11 @@
NotifyObservers(chan, NS_HTTP_ON_STOP_REQUEST_TOPIC);
}
+ // Called by the channel and cached in the loadGroup
+ void OnUserAgentRequest(nsIHttpChannel* chan) {
+ NotifyObservers(chan, NS_HTTP_ON_USERAGENT_REQUEST_TOPIC);
+ }
+
// Called by the channel before setting up the transaction
void OnBeforeConnect(nsIHttpChannel* chan) {
NotifyObservers(chan, NS_HTTP_ON_BEFORE_CONNECT_TOPIC);
@@ -528,6 +533,8 @@
void SetHttpHandlerInitArgs(const HttpHandlerInitArgs& aArgs);
void SetDeviceModelId(const nsCString& aModelId);
+ void EnsureUAOverridesInit();
+
// Checks if there are any user certs or active smart cards on a different
// thread. Updates mSpeculativeConnectEnabled when done.
void MaybeEnableSpeculativeConnect();
diff -ur a/netwerk/protocol/http/nsIHttpProtocolHandler.idl b/netwerk/protocol/http/nsIHttpProtocolHandler.idl
--- a/netwerk/protocol/http/nsIHttpProtocolHandler.idl 2021-09-28 00:47:46.000000000 +0200
+++ b/netwerk/protocol/http/nsIHttpProtocolHandler.idl 2021-10-20 21:38:21.926591307 +0200
@@ -190,6 +190,8 @@
*/
#define NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC "http-on-examine-cached-response"
+#define NS_HTTP_ON_USERAGENT_REQUEST_TOPIC "http-on-useragent-request"
+
/**
* This topic is notified for every http channel right after it called
* OnStopRequest on its listener, regardless whether it was finished
--- a/netwerk/protocol/http/UAOverridesBootstrapper.jsm 2021-10-21 14:47:27.380530041 +0200
+++ b/netwerk/protocol/http/UAOverridesBootstrapper.jsm 2021-10-20 21:55:18.750645611 +0200
@@ -0,0 +1,33 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { UserAgentOverrides } = ChromeUtils.import(
+ "resource://gre/modules/UserAgentOverrides.jsm"
+);
+
+function UAOverridesBootstrapper() {
+ this.init();
+}
+
+UAOverridesBootstrapper.prototype = {
+ init: function uaob_init() {
+ Services.obs.addObserver(this, "profile-change-net-teardown");
+ UserAgentOverrides.init();
+ },
+
+ observe: function uaob_observe(aSubject, aTopic, aData) {
+ if (aTopic == "profile-change-net-teardown") {
+ Services.obs.removeObserver(this, "profile-change-net-teardown");
+ UserAgentOverrides.uninit();
+ }
+ },
+
+ QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
+ classID: Components.ID("{965b0ca8-155b-11e7-93ae-92361f002671}"),
+};
+
+var EXPORTED_SYMBOLS = ["UAOverridesBootstrapper"];
--- a/netwerk/protocol/http/UserAgentOverrides.jsm 2021-10-21 14:47:32.138529785 +0200
+++ b/netwerk/protocol/http/UserAgentOverrides.jsm 2021-10-20 21:55:21.938645781 +0200
@@ -0,0 +1,188 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+var EXPORTED_SYMBOLS = ["UserAgentOverrides"];
+
+const { XPCOMUtils } = ChromeUtils.import(
+ "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { UserAgentUpdates } = ChromeUtils.import(
+ "resource://gre/modules/UserAgentUpdates.jsm"
+);
+
+const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides";
+const MAX_OVERRIDE_FOR_HOST_CACHE_SIZE = 250;
+
+// lazy load nsHttpHandler to improve startup performance.
+XPCOMUtils.defineLazyGetter(this, "DEFAULT_UA", function() {
+ return Cc["@mozilla.org/network/protocol;1?name=http"].getService(
+ Ci.nsIHttpProtocolHandler
+ ).userAgent;
+});
+
+var gPrefBranch;
+var gOverrides = new Map();
+var gUpdatedOverrides;
+var gOverrideForHostCache = new Map();
+var gInitialized = false;
+var gOverrideFunctions = [
+ function(aHttpChannel) {
+ return UserAgentOverrides.getOverrideForURI(aHttpChannel.URI);
+ },
+];
+var gBuiltUAs = new Map();
+
+var UserAgentOverrides = {
+ init: function uao_init() {
+ if (gInitialized) {
+ return;
+ }
+
+ gPrefBranch = Services.prefs.getBranch("general.useragent.override.");
+ gPrefBranch.addObserver("", buildOverrides);
+
+ Services.prefs.addObserver(PREF_OVERRIDES_ENABLED, buildOverrides);
+
+ try {
+ Services.obs.addObserver(
+ HTTP_on_useragent_request,
+ "http-on-useragent-request"
+ );
+ } catch (x) {
+ // The http-on-useragent-request notification is disallowed in content processes.
+ }
+
+ try {
+ UserAgentUpdates.init(function(overrides) {
+ gOverrideForHostCache.clear();
+ if (overrides) {
+ for (let domain in overrides) {
+ overrides[domain] = getUserAgentFromOverride(overrides[domain]);
+ }
+ overrides.get = function(key) {
+ return this[key];
+ };
+ }
+ gUpdatedOverrides = overrides;
+ });
+
+ buildOverrides();
+ } catch (e) {
+ // UserAgentOverrides is initialized before profile is ready.
+ // UA override might not work correctly.
+ }
+
+ Services.obs.notifyObservers(null, "useragentoverrides-initialized");
+ gInitialized = true;
+ },
+
+ addComplexOverride: function uao_addComplexOverride(callback) {
+ // Add to front of array so complex overrides have precedence
+ gOverrideFunctions.unshift(callback);
+ },
+
+ getOverrideForURI: function uao_getOverrideForURI(aURI) {
+ let host = aURI.asciiHost;
+ if (!gInitialized || (!gOverrides.size && !gUpdatedOverrides) || !host) {
+ return null;
+ }
+
+ let override = gOverrideForHostCache.get(host);
+ if (override !== undefined) {
+ return override;
+ }
+
+ function findOverride(overrides) {
+ let searchHost = host;
+ let userAgent = overrides.get(searchHost);
+
+ while (!userAgent) {
+ let dot = searchHost.indexOf(".");
+ if (dot === -1) {
+ return null;
+ }
+ searchHost = searchHost.slice(dot + 1);
+ userAgent = overrides.get(searchHost);
+ }
+ return userAgent;
+ }
+
+ override =
+ (gOverrides.size && findOverride(gOverrides)) ||
+ (gUpdatedOverrides && findOverride(gUpdatedOverrides));
+
+ if (gOverrideForHostCache.size >= MAX_OVERRIDE_FOR_HOST_CACHE_SIZE) {
+ gOverrideForHostCache.clear();
+ }
+ gOverrideForHostCache.set(host, override);
+
+ return override;
+ },
+
+ uninit: function uao_uninit() {
+ if (!gInitialized) {
+ return;
+ }
+ gInitialized = false;
+
+ gPrefBranch.removeObserver("", buildOverrides);
+
+ Services.prefs.removeObserver(PREF_OVERRIDES_ENABLED, buildOverrides);
+
+ Services.obs.removeObserver(
+ HTTP_on_useragent_request,
+ "http-on-useragent-request"
+ );
+ },
+};
+
+function getUserAgentFromOverride(override) {
+ let userAgent = gBuiltUAs.get(override);
+ if (userAgent !== undefined) {
+ return userAgent;
+ }
+ let [search, replace] = override.split("#", 2);
+ if (search && replace) {
+ userAgent = DEFAULT_UA.replace(new RegExp(search, "g"), replace);
+ } else {
+ userAgent = override;
+ }
+ gBuiltUAs.set(override, userAgent);
+ return userAgent;
+}
+
+function buildOverrides() {
+ gOverrides.clear();
+ gOverrideForHostCache.clear();
+
+ if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED)) {
+ return;
+ }
+
+ let domains = gPrefBranch.getChildList("");
+
+ for (let domain of domains) {
+ let override = gPrefBranch.getCharPref(domain);
+ let userAgent = getUserAgentFromOverride(override);
+
+ if (userAgent != DEFAULT_UA) {
+ gOverrides.set(domain, userAgent);
+ }
+ }
+}
+
+function HTTP_on_useragent_request(aSubject, aTopic, aData) {
+ let channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
+
+ for (let callback of gOverrideFunctions) {
+ let modifiedUA = callback(channel, DEFAULT_UA);
+ if (modifiedUA) {
+ channel.setRequestHeader("User-Agent", modifiedUA, false);
+ return;
+ }
+ }
+}
--- a/netwerk/protocol/http/UserAgentUpdates.jsm 2021-10-21 14:47:36.532529549 +0200
+++ b/netwerk/protocol/http/UserAgentUpdates.jsm 2021-10-20 21:55:25.283645960 +0200
@@ -0,0 +1,333 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+var EXPORTED_SYMBOLS = ["UserAgentUpdates"];
+
+const { AppConstants } = ChromeUtils.import(
+ "resource://gre/modules/AppConstants.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+ "resource://gre/modules/XPCOMUtils.jsm"
+);
+
+XPCOMUtils.defineLazyGlobalGetters(this, ["XMLHttpRequest"]);
+
+ChromeUtils.defineModuleGetter(
+ this,
+ "FileUtils",
+ "resource://gre/modules/FileUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+ this,
+ "NetUtil",
+ "resource://gre/modules/NetUtil.jsm"
+);
+
+ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
+
+ChromeUtils.defineModuleGetter(
+ this,
+ "UpdateUtils",
+ "resource://gre/modules/UpdateUtils.jsm"
+);
+
+XPCOMUtils.defineLazyServiceGetter(
+ this,
+ "gUpdateTimer",
+ "@mozilla.org/updates/timer-manager;1",
+ "nsIUpdateTimerManager"
+);
+
+XPCOMUtils.defineLazyGetter(this, "gDecoder", function() {
+ return new TextDecoder();
+});
+
+XPCOMUtils.defineLazyGetter(this, "gEncoder", function() {
+ return new TextEncoder();
+});
+
+const TIMER_ID = "user-agent-updates-timer";
+
+const PREF_UPDATES = "general.useragent.updates.";
+const PREF_UPDATES_ENABLED = PREF_UPDATES + "enabled";
+const PREF_UPDATES_URL = PREF_UPDATES + "url";
+const PREF_UPDATES_INTERVAL = PREF_UPDATES + "interval";
+const PREF_UPDATES_RETRY = PREF_UPDATES + "retry";
+const PREF_UPDATES_TIMEOUT = PREF_UPDATES + "timeout";
+const PREF_UPDATES_LASTUPDATED = PREF_UPDATES + "lastupdated";
+
+const KEY_PREFDIR = "PrefD";
+const KEY_APPDIR = "XCurProcD";
+const FILE_UPDATES = "ua-update.json";
+
+const PREF_APP_DISTRIBUTION = "distribution.id";
+const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
+
+var gInitialized = false;
+
+function readChannel(url) {
+ return new Promise((resolve, reject) => {
+ try {
+ let channel = NetUtil.newChannel({
+ uri: url,
+ loadUsingSystemPrincipal: true,
+ });
+ channel.contentType = "application/json";
+
+ NetUtil.asyncFetch(channel, (inputStream, status) => {
+ if (!Components.isSuccessCode(status)) {
+ reject();
+ return;
+ }
+
+ let data = JSON.parse(
+ NetUtil.readInputStreamToString(inputStream, inputStream.available())
+ );
+ resolve(data);
+ });
+ } catch (ex) {
+ reject(
+ new Error(
+ "UserAgentUpdates: Could not fetch " +
+ url +
+ " " +
+ ex +
+ "\n" +
+ ex.stack
+ )
+ );
+ }
+ });
+}
+
+var UserAgentUpdates = {
+ init(callback) {
+ if (gInitialized) {
+ return;
+ }
+ gInitialized = true;
+
+ this._callback = callback;
+ this._lastUpdated = 0;
+ this._applySavedUpdate();
+
+ Services.prefs.addObserver(PREF_UPDATES, this);
+ },
+
+ uninit() {
+ if (!gInitialized) {
+ return;
+ }
+ gInitialized = false;
+ Services.prefs.removeObserver(PREF_UPDATES, this);
+ },
+
+ _applyUpdate(update) {
+ // Check pref again in case it has changed
+ if (update && this._getPref(PREF_UPDATES_ENABLED, false)) {
+ this._callback(update);
+ } else {
+ this._callback(null);
+ }
+ },
+
+ _applySavedUpdate() {
+ if (!this._getPref(PREF_UPDATES_ENABLED, false)) {
+ // remove previous overrides
+ this._applyUpdate(null);
+ return;
+ }
+ // try loading from profile dir, then from app dir
+ let dirs = [KEY_PREFDIR, KEY_APPDIR];
+
+ dirs
+ .reduce((prevLoad, dir) => {
+ let file = FileUtils.getFile(dir, [FILE_UPDATES], true).path;
+ // tryNext returns promise to read file under dir and parse it
+ let tryNext = () =>
+ OS.File.read(file).then(bytes => {
+ let update = JSON.parse(gDecoder.decode(bytes));
+ if (!update) {
+ throw new Error("invalid update");
+ }
+ return update;
+ });
+ // try to load next one if the previous load failed
+ return prevLoad ? prevLoad.catch(tryNext) : tryNext();
+ }, null)
+ .catch(ex => {
+ if (AppConstants.platform !== "android") {
+ // All previous (non-Android) load attempts have failed, so we bail.
+ throw new Error(
+ "UserAgentUpdates: Failed to load " +
+ FILE_UPDATES +
+ ex +
+ "\n" +
+ ex.stack
+ );
+ }
+ // Make one last attempt to read from the Fennec APK root.
+ return readChannel("resource://android/" + FILE_UPDATES);
+ })
+ .then(update => {
+ // Apply update if loading was successful
+ this._applyUpdate(update);
+ })
+ .catch(Cu.reportError);
+ this._scheduleUpdate();
+ },
+
+ _saveToFile(update) {
+ let file = FileUtils.getFile(KEY_PREFDIR, [FILE_UPDATES], true);
+ let path = file.path;
+ let bytes = gEncoder.encode(JSON.stringify(update));
+ OS.File.writeAtomic(path, bytes, { tmpPath: path + ".tmp" }).then(() => {
+ this._lastUpdated = Date.now();
+ Services.prefs.setCharPref(
+ PREF_UPDATES_LASTUPDATED,
+ this._lastUpdated.toString()
+ );
+ }, Cu.reportError);
+ },
+
+ _getPref(name, def) {
+ try {
+ switch (typeof def) {
+ case "number":
+ return Services.prefs.getIntPref(name);
+ case "boolean":
+ return Services.prefs.getBoolPref(name);
+ }
+ return Services.prefs.getCharPref(name);
+ } catch (e) {
+ return def;
+ }
+ },
+
+ _getParameters() {
+ return {
+ "%DATE%": function() {
+ return Date.now().toString();
+ },
+ "%PRODUCT%": function() {
+ return Services.appinfo.name;
+ },
+ "%APP_ID%": function() {
+ return Services.appinfo.ID;
+ },
+ "%APP_VERSION%": function() {
+ return Services.appinfo.version;
+ },
+ "%BUILD_ID%": function() {
+ return Services.appinfo.appBuildID;
+ },
+ "%OS%": function() {
+ return Services.appinfo.OS;
+ },
+ "%CHANNEL%": function() {
+ return UpdateUtils.UpdateChannel;
+ },
+ "%DISTRIBUTION%": function() {
+ return this._getPref(PREF_APP_DISTRIBUTION, "");
+ },
+ "%DISTRIBUTION_VERSION%": function() {
+ return this._getPref(PREF_APP_DISTRIBUTION_VERSION, "");
+ },
+ };
+ },
+
+ _getUpdateURL() {
+ let url = this._getPref(PREF_UPDATES_URL, "");
+ let params = this._getParameters();
+ return url.replace(/%[A-Z_]+%/g, function(match) {
+ let param = params[match];
+ // preserve the %FOO% string (e.g. as an encoding) if it's not a valid parameter
+ return param ? encodeURIComponent(param()) : match;
+ });
+ },
+
+ _fetchUpdate(url, success, error) {
+ let request = new XMLHttpRequest();
+ request.mozBackgroundRequest = true;
+ request.timeout = this._getPref(PREF_UPDATES_TIMEOUT, 60000);
+ request.open("GET", url, true);
+ request.overrideMimeType("application/json");
+ request.responseType = "json";
+
+ request.addEventListener("load", function() {
+ let response = request.response;
+ response ? success(response) : error();
+ });
+ request.addEventListener("error", error);
+ request.send();
+ },
+
+ _update() {
+ let url = this._getUpdateURL();
+ url &&
+ this._fetchUpdate(
+ url,
+ response => {
+ // success
+ // apply update and save overrides to profile
+ this._applyUpdate(response);
+ this._saveToFile(response);
+ this._scheduleUpdate(); // cancel any retries
+ },
+ response => {
+ // error
+ this._scheduleUpdate(true /* retry */);
+ }
+ );
+ },
+
+ _scheduleUpdate(retry) {
+ // only schedule updates in the main process
+ if (
+ Services.appinfo.processType !== Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT
+ ) {
+ return;
+ }
+ let interval = this._getPref(PREF_UPDATES_INTERVAL, 604800 /* 1 week */);
+ if (retry) {
+ interval = this._getPref(PREF_UPDATES_RETRY, interval);
+ }
+ gUpdateTimer.registerTimer(TIMER_ID, this, Math.max(1, interval));
+ },
+
+ notify(timer) {
+ // timer notification
+ if (this._getPref(PREF_UPDATES_ENABLED, false)) {
+ this._update();
+ }
+ },
+
+ observe(subject, topic, data) {
+ switch (topic) {
+ case "nsPref:changed":
+ if (data === PREF_UPDATES_ENABLED) {
+ this._applySavedUpdate();
+ } else if (data === PREF_UPDATES_INTERVAL) {
+ this._scheduleUpdate();
+ } else if (data === PREF_UPDATES_LASTUPDATED) {
+ // reload from file if there has been an update
+ let lastUpdated = parseInt(
+ this._getPref(PREF_UPDATES_LASTUPDATED, "0"),
+ 0
+ );
+ if (lastUpdated > this._lastUpdated) {
+ this._applySavedUpdate();
+ this._lastUpdated = lastUpdated;
+ }
+ }
+ break;
+ }
+ },
+
+ QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver, Ci.nsITimerCallback]),
+};

View File

@ -0,0 +1,38 @@
--- firefox-93.0/browser/base/content/browser-context.inc 2021-09-28 00:46:26.000000000 +0200
+++ firefox-93.0_patched/browser/base/content/browser-context.inc 2021-10-12 15:41:48.608191384 +0200
@@ -375,29 +368,28 @@
oncommand="gContextMenu.addDictionaries();"/>
</menupopup>
</menu>
- <menuseparator hidden="true" id="context-sep-bidi"/>
+ <menuseparator id="context-sep-bidi"/>
<menuitem hidden="true" id="context-bidi-text-direction-toggle"
data-l10n-id="main-context-menu-bidi-switch-text"
command="cmd_switchTextDirection"/>
<menuitem hidden="true" id="context-bidi-page-direction-toggle"
data-l10n-id="main-context-menu-bidi-switch-page"
oncommand="gContextMenu.switchPageDirection();"/>
- <menuseparator id="inspect-separator" hidden="true"/>
+ <menuseparator id="inspect-separator"/>
<menuitem id="context-viewpartialsource-selection"
data-l10n-id="main-context-menu-view-selection-source"
oncommand="gContextMenu.viewPartialSource();"/>
<menuitem id="context-viewsource"
data-l10n-id="main-context-menu-view-page-source"
oncommand="BrowserViewSource(gContextMenu.browser);"/>
- <menuitem id="context-inspect-a11y"
- hidden="true"
- data-l10n-id="main-context-menu-inspect-a11y-properties"
- oncommand="gContextMenu.inspectA11Y();"/>
+ <menuitem id="context-viewpageinfo"
+ data-l10n-id="main-context-menu-view-page-info"
+ oncommand="gIdentityHandler.handleMoreInfoClick();"/>
<menuitem id="context-inspect"
hidden="true"
data-l10n-id="main-context-menu-inspect"
oncommand="gContextMenu.inspectNode();"/>
- <menuseparator id="context-media-eme-separator" hidden="true"/>
+ <menuseparator id="context-media-eme-separator"/>
<menuitem id="context-media-eme-learnmore"
class="menuitem-iconic"
hidden="true"

12
patches/wordmark.patch Normal file
View File

@ -0,0 +1,12 @@
--- a/browser/components/newtab/css/activity-stream-linux.css 2021-10-11 00:33:16.266611832 +0200
+++ b/browser/components/newtab/css/activity-stream-linux.css 2021-10-11 00:34:40.395611744 +0200
@@ -1575,6 +1575,9 @@
margin-inline-start: 16px;
width: 134px;
}
+.wordmark {
+ width: 0px !important;
+}
@media (max-width: 609px) {
.search-wrapper .logo-and-wordmark .logo {
background-size: 64px;

View File

@ -5,8 +5,8 @@
# there is a possible patch to consider when changing this:
# see: patches/browser-confvars.patch
MOZ_APP_NAME=librewolf
MOZ_APP_BASENAME="LibreWolf"
MOZ_APP_PROFILE=librewolf
MOZ_APP_VENDOR=LibreWolf
MOZ_APP_NAME=foxgirl
MOZ_APP_BASENAME="Foxgirl"
MOZ_APP_PROFILE=foxgirl
MOZ_APP_VENDOR=Foxgirl

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -6,7 +6,7 @@
background-image: url("chrome://branding/content/about-background.png");
background-repeat: no-repeat;
background-color: #00acff;
color: #090909;
color: #ccc;
}
/*
@ -19,7 +19,7 @@ firefox-85.0/browser/base/content/aboutDialog.xhtml
.text-link {
color: #101010 !important;
color: #c2c2c2 !important;
text-decoration: underline;
}

View File

@ -2,12 +2,12 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY brandShorterName "LibreWolf">
<!ENTITY brandShortName "LibreWolf">
<!ENTITY brandFullName "LibreWolf">
<!ENTITY brandShorterName "Foxgirl">
<!ENTITY brandShortName "Foxgirl">
<!ENTITY brandFullName "Foxgirl">
<!-- LOCALIZATION NOTE (brandProductName):
This brand name can be used in messages where the product name needs to
remain unchanged across different versions (Nightly, Beta, etc.). -->
<!ENTITY brandProductName "LibreWolf">
<!ENTITY vendorShortName "LibreWolf">
<!ENTITY brandProductName "Foxgirl">
<!ENTITY vendorShortName "Foxgirl">
<!ENTITY trademarkInfo.part1 " ">

View File

@ -12,11 +12,11 @@
##
## Reference: https://www.mozilla.org/styleguide/communications/translation/
-brand-shorter-name = LibreWolf
-brand-short-name = LibreWolf
-brand-full-name = LibreWolf
-brand-shorter-name = Foxgirl
-brand-short-name = Foxgirl
-brand-full-name = Foxgirl
# This brand name can be used in messages where the product name needs to
# remain unchanged across different versions (Nightly, Beta, etc.).
-brand-product-name = LibreWolf
-vendor-short-name = LibreWolf
-brand-product-name = Foxgirl
-vendor-short-name = Foxgirl
trademarkInfo = { " " }

View File

@ -2,13 +2,13 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
brandShorterName=LibreWolf
brandShortName=LibreWolf
brandFullName=LibreWolf
brandShorterName=Foxgirl
brandShortName=Foxgirl
brandFullName=Foxgirl
# LOCALIZATION NOTE(brandProductName):
# This brand name can be used in messages where the product name needs to
# remain unchanged across different versions (Nightly, Beta, etc.).
brandProductName=LibreWolf
vendorShortName=LibreWolf
brandProductName=Foxgirl
vendorShortName=Foxgirl
syncBrandShortName=LibreWolf Sync
syncBrandShortName=Foxgirl Sync

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B