0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-21 21:23:08 -05:00

Merge branch 'main' into add-mozilla-kde.patch

This commit is contained in:
Malte Jürgens 2022-02-05 16:05:44 +01:00
commit 746fa2bf22
No known key found for this signature in database
GPG key ID: D29FBD5F93C0CFC3
26 changed files with 1373 additions and 390 deletions

View file

@ -1,11 +1,49 @@
stages:
- build
- release
build-job:
Build:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- make all
- echo VERSION=$(cat version) >> variables.env
- echo RELEASE=$(cat release) >> variables.env
artifacts:
paths:
- librewolf-*.source.*
- librewolf-*.source.tar.gz
reports:
dotenv: variables.env
Release:
stage: release
when: manual
allow_failure: false
image: ubuntu
needs:
- job: "Build"
artifacts: true
only:
- main
except:
- merge_requests
before_script:
- apt-get update
- apt-get install -y curl
- curl -L --output /usr/local/bin/release-cli "https://release-cli-downloads.s3.amazonaws.com/latest/release-cli-linux-amd64"
- chmod +x /usr/local/bin/release-cli
script:
- |
curl \
--header "JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file librewolf-$VERSION-$RELEASE.source.tar.gz \
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/librewolf-source/$VERSION-$RELEASE/librewolf-$VERSION-$RELEASE.source.tar.gz"
release:
tag_name: "$VERSION-$RELEASE"
description: "LibreWolf v$VERSION-$RELEASE"
assets:
links:
- name: librewolf-$VERSION-$RELEASE.source.tar.gz
link_type: package
url: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/librewolf-source/$VERSION-$RELEASE/librewolf-$VERSION-$RELEASE.source.tar.gz

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "submodules/settings"]
path = submodules/settings
url = https://gitlab.com/librewolf-community/settings.git

106
Makefile
View file

@ -1,4 +1,4 @@
.PHONY : all help clean veryclean librewolf-patches check librewolf
.PHONY : help check all clean veryclean bootstrap build package run update
version:=$(shell cat ./version)
release:=$(shell cat ./release)
@ -9,67 +9,87 @@ release:=$(shell cat ./release)
#ext=.tar.xz
archive_create=tar cfz
ext=.tar.gz
#archive_create=zip -r9
#ext=.zip
upstream_filename=firefox-$(version).source.tar.xz
upstream_dirname=firefox-$(version)
help : README.md
help :
@echo "use: $(MAKE) [all] [check] [clean] [veryclean] [build] [package] [run]"
@echo ""
@echo " all - Make LibreWolf source archive ${version}-${release}."
@echo " check - Check if there is a new version of Firefox."
@echo " update - Update the git submodules and README.md."
@echo ""
@echo " clean - Clean everything except the upstream firefox tarball."
@echo " veryclean - Clean everything and the firefox tarball."
@echo " veryclean - Clean everything including the firefox tarball."
@echo ""
@echo " build - Make LibreWolf source archive and then build it."
@echo " package - Make LibreWolf source archive, then build and package it."
@echo " run - Make LibreWolf source archive, then build and run it."
@echo " bootstrap - Make librewolf source archive, and bootstrap the build system."
@echo ""
@echo " build - After a bootstrap, build it."
@echo " package - After a build, package it."
@echo " run - After a build, run it."
@echo ""
check : README.md
@python3 scripts/update-version.py
check :
python3 scripts/update-version.py
@echo "Current release:" $$(cat ./release)
include upstream.mk
all : librewolf-$(version)-$(release).source$(ext) README.md
clean :
rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version)-$(release).source$(ext)
veryclean : clean
$(MAKE) clean_upstream_file
rm -rf librewolf-$(version)
librewolf-$(version)-$(release).source$(ext) : $(upstream_filename) ./version ./release scripts/librewolf-patches.py assets/mozconfig assets/patches.txt README.md
$(MAKE) clean_upstream_dir
rm -rf librewolf-$(version)
$(MAKE) create_lw_from_upstream_dir
python3 scripts/librewolf-patches.py $(version)
rm -f librewolf-$(version)-$(release).source$(ext)
$(archive_create) librewolf-$(version)-$(release).source$(ext) librewolf-$(version)
rm -rf librewolf-$(version)
librewolf-$(version) : librewolf-$(version)-$(release).source$(ext)
tar xf librewolf-$(version)-$(release).source$(ext)
build : librewolf-$(version)
(cd librewolf-$(version) && ./mach build)
package : build
(cd librewolf-$(version) && ./mach package)
run : build
(cd librewolf-$(version) && ./mach run)
update : README.md
git submodule update --recursive --remote
README.md : README.md.in ./version ./release
@sed "s/__VERSION__/$(version)/g" < $< > tmp
@sed "s/__RELEASE__/$(release)/g" < tmp > $@
@rm -f tmp
all : librewolf-$(version)-$(release).source$(ext)
clean :
rm -rf *~ firefox-$(version) librewolf-$(version) librewolf-$(version)-$(release).source$(ext)
veryclean : clean
rm -f $(upstream_filename)
#
# The actual build stuff
#
$(upstream_filename) :
wget -q "https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz"
librewolf-$(version)-$(release).source$(ext) : $(upstream_filename) ./version ./release scripts/librewolf-patches.py assets/mozconfig assets/patches.txt
rm -rf $(upstream_dirname)
rm -rf librewolf-$(version)
tar xf $(upstream_filename)
mv $(upstream_dirname) librewolf-$(version)
python3 scripts/librewolf-patches.py $(version) $(release)
rm -f librewolf-$(version)-$(release).source$(ext)
$(archive_create) librewolf-$(version)-$(release).source$(ext) librewolf-$(version)
touch librewolf-$(version)
librewolf-$(version) : librewolf-$(version)-$(release).source$(ext)
tar xf librewolf-$(version)-$(release).source$(ext)
debs=python3 python3-dev python3-pip
rpms=python3 python3-devel
bootstrap : librewolf-$(version)
(sudo apt -y install $(debs); true)
(sudo rpm -y install $(rpms); true)
(cd librewolf-$(version) && MOZBUILD_STATE_PATH=$$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser)
build :
(cd librewolf-$(version) && ./mach build)
package :
(cd librewolf-$(version) && ./mach package)
run :
(cd librewolf-$(version) && ./mach run)

167
README.md
View file

@ -1,136 +1,75 @@
## Building LibreWolf from source:
## LibreWolf build instructions
First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs).
To download the latest from a script, use wget/curl like this:
First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.3-2.source.tar.gz?job=Build)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs).
```
wget -O librewolf-96.0.1-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job
curl -L -o librewolf-96.0.1-1.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-96.0.1-1.source.tar.gz?job=build-job
tar xf <tarball>
cd <folder>
make bootstrap build package run
```
#### How to make a patch:
Next, we create ourselves a build folder and extract the tarball.
The easiest way to make patches is to go to the LibreWolf source folder:
```
mkdir build
cd build
tar xf ../librewolf-96.0.1-1.source.tar.gz
cd librewolf-$(cat version)
git init
git add <path_to_file_you_changed>
git commit -am initial-commit
git diff > ../mypatch.patch
```
We have Gitter / Matrix rooms, and on the website we have links to the various issue trackers.
### build environment
#### Building LibreWolf with git:
Next step, if you have not done so already, you must _create the build environment_:
1. Clone the git repository via https:
```
./librewolf-96.0.1/lw/mozfetch.sh
git clone --recursive https://gitlab.com/librewolf-community/browser/source.git
```
This would create a _mozilla-unified_ folder in our 'build' folder, or basically anywhere that is your current working directory. It takes about an hour for me to complete, but it needs to be done only once. This step might fail and cause problems. Hack a bit, and if that fails you can ask on our [Gitter](https://gitter.im/librewolf-community/librewolf)/[Matrix](https://matrix.to/#/#librewolf:matrix.org) channels. There is no need to actually build _mozilla-unified_ (Mozilla Nightly) itself, nor is the folder needed to build LibreWolf. So you can remove it: `rm -rf mozilla-unfied` if you don't plan on using/exploring it.
#### wasi sdk
Since Firefox 95.0, we need to install an additional library, the **'wasi sdk'**. This library sandboxes wasm libraries, which is what we want, but it's still experimental for us to include properly.
A few resources:
* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/).
* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/).
* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html).
To setup the wasi sdk _headers_, you can use _librewolf-96.0.1/lw/setup-wasi-linux.sh_. Please note that this script is a bit experimental and not all kinks have been worked out, but it should work.
This might not be enough on all systems. Some systems have the wasi-libc library already installed, and some don't. It depends on the installed version of Clang/LLVM it seems, which should be v8 or above. On debian-based systems: `sudo apt install wasi-libc`, on Arch: `https://archlinux.org/packages/community/any/wasi-libc/` (`pacman -Syu wasi-libc`). Instructions for macos/windows and perhaps other Linux distro's will be added here soon.
Or, the other option is to not use these sandbox libraries: In this case we can't use our standard _mozconfig_ symlink from _mozconfig.new_ into _mozconfig.new.without-wasi_. In that case you have to type something along the lines of:
or Git:
```
cd librewolf-96.0.1
cp lw/mozconfig.new.without-wasi mozconfig
cd ..
git clone --recursive git@gitlab.com:librewolf-community/browser/source.git
```
### building librewolf
cd into it, build the LibreWolf tarball, bootstrap the build environment, and finally, perform the build:
```
cd source
make all
make bootstrap
make build
```
After that, you can either build a tarball from it, or run it:
```
make package
make run
```
#### How to create a patch for problems in Mozilla's [Bugzilla](https://bugzilla.mozilla.org/).
Now we're ready to actually build LibreWolf:
Well, first of all:
* [Create an account](https://bugzilla.mozilla.org/createaccount.cgi).
* Handy link: [Bugs Filed Today](https://bugzilla.mozilla.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=Bugs%20Filed%20Today&sharer_id=1&list_id=15939480).
* The essential: [Firefox Source Tree Documentation](https://firefox-source-docs.mozilla.org/).
Now that you have a patch in LibreWolf, that's not enough to upload to Mozilla. See, Mozilla only accepts patches against Nightly. So here is how to do that:
```
cd librewolf-96.0.1
hg clone https://hg.mozilla.org/mozilla-unified
cd mozilla-unified
hg update
MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser
./mach build
```
Also takes me an hour. Then, we can run it:
```
./mach run
```
Or make a package:
Now you can apply your patch to Nightly:
```
./mach package
patch -p1 -i ../mypatch.patch
```
Now you let Mercurial create the patch:
```
hg diff > ../my-nightly-patch.patch
```
And it can be uploaded to Bugzilla.
### I want to keep up to date with the latest, but compile myself
##### *(copy of Mozilla readme)* Now the fun starts
1. To first clone the repo:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make librewolf
```
2. To keep up-to-date:
```
git pull
make librewolf
```
Time to start hacking! You should join us on [Matrix](https://chat.mozilla.org/), say hello in the [Introduction channel](https://chat.mozilla.org/#/room/#introduction:mozilla.org), and [find a bug to start working on](https://codetribute.mozilla.org/). See the [Firefox Contributors Quick Reference](https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference) to learn how to test your changes, send patches to Mozilla, update your source code locally, and more.
## [dev info] How to use this repo instead of [Common](https://gitlab.com/librewolf-community/browser/common):
Since the dawn of time, we have used **Common** to get _patches_, _source_files_, including _source_files/{branding}_
This source repo supports all that, because it uses these same things to produce the tarball. As far as I can tell, the mapping from Common to Source would be:
* _[patches](https://gitlab.com/librewolf-community/browser/common/-/tree/master/patches)_ -> _[patches](https://gitlab.com/librewolf-community/browser/source/-/tree/main/patches)_
* _[source\_files](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files)/search-config.json_ -> _[assets](https://gitlab.com/librewolf-community/browser/source/-/tree/main/assets)/search-config.json_
* _source\_files/browser/[branding](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files/browser/branding)/librewolf_ -> _themes/browser/[branding](https://gitlab.com/librewolf-community/browser/source/-/tree/main/themes/browser/branding)/librewolf_
With this mapping, I hope that other builders that can't use our tarball (afterMozilla project, weird distro's), still use the same source/patches as the builders that do use it.
### Another feature
The file [assets/patches.txt](https://gitlab.com/librewolf-community/browser/source/-/blob/main/assets/patches.txt) defines what patches go in. These are not the only patches a builder will use, weird distro's etc, will use additional patches. those patches can live in the repo of that distro, or in a subfolder here. I hope this gives everybody the freedom to build anyway they please, like in Common, but with the added benefit that we produce a source tarball.
### Implementing a build script the new way:
The repository has a short [example shell script](https://gitlab.com/librewolf-community/browser/source/-/blob/main/scripts/fetch-build.sh) on how to use the new-style tarball approach instead of the older patching-it-yourself approach.
## [dev info] Building the LibreWolf source tarball:
Luckly, you don't need the build environment for this. If you don't have write access, just:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make all
```
If you **do** have write access, we're first gonna check for a newer version of Firefox:
```
git clone git@gitlab.com:librewolf-community/browser/source.git
cd source
make check
```
If there is a new version, it's a good time to git commit and trigger a CI build job.
```
git commit -am v$(cat version)-$(cat release) && git push
```
To build the source archive:
```
make all
```
If you have a working build environment, you can build librewolf with:
```
make librewolf
```
This extracts the source, and then tries to `./mach build && ./mach package`.
## FAQ: Common issues when setting up the Mozilla build environment
1. it doesnt find a suitable python.
```
export MACH_USE_SYSTEM_PYTHON=1
make librewolf
```
2. <python-package-1> requires <python-package-2, which is not installed.
```
pip3 install <python-package-2>
```
And retry.
#### Hey, I'm using a Mac or Windows :(
We understand, life isn't always fair 😺. The same steps as above do apply, you'll just have to walk through the beginning part of the guides for [MacOS](https://firefox-source-docs.mozilla.org/setup/macos_build.html), [Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html).

View file

@ -1,136 +1,75 @@
## Building LibreWolf from source:
## LibreWolf build instructions
First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs).
To download the latest from a script, use wget/curl like this:
First, let's **[download the latest tarball](https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build)**. This tarball is the latest produced by the [CI](https://gitlab.com/librewolf-community/browser/source/-/jobs).
```
wget -O librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job
curl -L -o librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=build-job
tar xf <tarball>
cd <folder>
make bootstrap build package run
```
#### How to make a patch:
Next, we create ourselves a build folder and extract the tarball.
The easiest way to make patches is to go to the LibreWolf source folder:
```
mkdir build
cd build
tar xf ../librewolf-__VERSION__-__RELEASE__.source.tar.gz
cd librewolf-$(cat version)
git init
git add <path_to_file_you_changed>
git commit -am initial-commit
git diff > ../mypatch.patch
```
We have Gitter / Matrix rooms, and on the website we have links to the various issue trackers.
### build environment
#### Building LibreWolf with git:
Next step, if you have not done so already, you must _create the build environment_:
1. Clone the git repository via https:
```
./librewolf-__VERSION__/lw/mozfetch.sh
git clone --recursive https://gitlab.com/librewolf-community/browser/source.git
```
This would create a _mozilla-unified_ folder in our 'build' folder, or basically anywhere that is your current working directory. It takes about an hour for me to complete, but it needs to be done only once. This step might fail and cause problems. Hack a bit, and if that fails you can ask on our [Gitter](https://gitter.im/librewolf-community/librewolf)/[Matrix](https://matrix.to/#/#librewolf:matrix.org) channels. There is no need to actually build _mozilla-unified_ (Mozilla Nightly) itself, nor is the folder needed to build LibreWolf. So you can remove it: `rm -rf mozilla-unfied` if you don't plan on using/exploring it.
#### wasi sdk
Since Firefox 95.0, we need to install an additional library, the **'wasi sdk'**. This library sandboxes wasm libraries, which is what we want, but it's still experimental for us to include properly.
A few resources:
* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/).
* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/).
* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html).
To setup the wasi sdk _headers_, you can use _librewolf-__VERSION__/lw/setup-wasi-linux.sh_. Please note that this script is a bit experimental and not all kinks have been worked out, but it should work.
This might not be enough on all systems. Some systems have the wasi-libc library already installed, and some don't. It depends on the installed version of Clang/LLVM it seems, which should be v8 or above. On debian-based systems: `sudo apt install wasi-libc`, on Arch: `https://archlinux.org/packages/community/any/wasi-libc/` (`pacman -Syu wasi-libc`). Instructions for macos/windows and perhaps other Linux distro's will be added here soon.
Or, the other option is to not use these sandbox libraries: In this case we can't use our standard _mozconfig_ symlink from _mozconfig.new_ into _mozconfig.new.without-wasi_. In that case you have to type something along the lines of:
or Git:
```
cd librewolf-__VERSION__
cp lw/mozconfig.new.without-wasi mozconfig
cd ..
git clone --recursive git@gitlab.com:librewolf-community/browser/source.git
```
### building librewolf
cd into it, build the LibreWolf tarball, bootstrap the build environment, and finally, perform the build:
```
cd source
make all
make bootstrap
make build
```
After that, you can either build a tarball from it, or run it:
```
make package
make run
```
#### How to create a patch for problems in Mozilla's [Bugzilla](https://bugzilla.mozilla.org/).
Now we're ready to actually build LibreWolf:
Well, first of all:
* [Create an account](https://bugzilla.mozilla.org/createaccount.cgi).
* Handy link: [Bugs Filed Today](https://bugzilla.mozilla.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=Bugs%20Filed%20Today&sharer_id=1&list_id=15939480).
* The essential: [Firefox Source Tree Documentation](https://firefox-source-docs.mozilla.org/).
Now that you have a patch in LibreWolf, that's not enough to upload to Mozilla. See, Mozilla only accepts patches against Nightly. So here is how to do that:
```
cd librewolf-__VERSION__
hg clone https://hg.mozilla.org/mozilla-unified
cd mozilla-unified
hg update
MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser
./mach build
```
Also takes me an hour. Then, we can run it:
```
./mach run
```
Or make a package:
Now you can apply your patch to Nightly:
```
./mach package
patch -p1 -i ../mypatch.patch
```
Now you let Mercurial create the patch:
```
hg diff > ../my-nightly-patch.patch
```
And it can be uploaded to Bugzilla.
### I want to keep up to date with the latest, but compile myself
##### *(copy of Mozilla readme)* Now the fun starts
1. To first clone the repo:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make librewolf
```
2. To keep up-to-date:
```
git pull
make librewolf
```
Time to start hacking! You should join us on [Matrix](https://chat.mozilla.org/), say hello in the [Introduction channel](https://chat.mozilla.org/#/room/#introduction:mozilla.org), and [find a bug to start working on](https://codetribute.mozilla.org/). See the [Firefox Contributors Quick Reference](https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference) to learn how to test your changes, send patches to Mozilla, update your source code locally, and more.
## [dev info] How to use this repo instead of [Common](https://gitlab.com/librewolf-community/browser/common):
Since the dawn of time, we have used **Common** to get _patches_, _source_files_, including _source_files/{branding}_
This source repo supports all that, because it uses these same things to produce the tarball. As far as I can tell, the mapping from Common to Source would be:
* _[patches](https://gitlab.com/librewolf-community/browser/common/-/tree/master/patches)_ -> _[patches](https://gitlab.com/librewolf-community/browser/source/-/tree/main/patches)_
* _[source\_files](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files)/search-config.json_ -> _[assets](https://gitlab.com/librewolf-community/browser/source/-/tree/main/assets)/search-config.json_
* _source\_files/browser/[branding](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files/browser/branding)/librewolf_ -> _themes/browser/[branding](https://gitlab.com/librewolf-community/browser/source/-/tree/main/themes/browser/branding)/librewolf_
With this mapping, I hope that other builders that can't use our tarball (afterMozilla project, weird distro's), still use the same source/patches as the builders that do use it.
### Another feature
The file [assets/patches.txt](https://gitlab.com/librewolf-community/browser/source/-/blob/main/assets/patches.txt) defines what patches go in. These are not the only patches a builder will use, weird distro's etc, will use additional patches. those patches can live in the repo of that distro, or in a subfolder here. I hope this gives everybody the freedom to build anyway they please, like in Common, but with the added benefit that we produce a source tarball.
### Implementing a build script the new way:
The repository has a short [example shell script](https://gitlab.com/librewolf-community/browser/source/-/blob/main/scripts/fetch-build.sh) on how to use the new-style tarball approach instead of the older patching-it-yourself approach.
## [dev info] Building the LibreWolf source tarball:
Luckly, you don't need the build environment for this. If you don't have write access, just:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make all
```
If you **do** have write access, we're first gonna check for a newer version of Firefox:
```
git clone git@gitlab.com:librewolf-community/browser/source.git
cd source
make check
```
If there is a new version, it's a good time to git commit and trigger a CI build job.
```
git commit -am v$(cat version)-$(cat release) && git push
```
To build the source archive:
```
make all
```
If you have a working build environment, you can build librewolf with:
```
make librewolf
```
This extracts the source, and then tries to `./mach build && ./mach package`.
## FAQ: Common issues when setting up the Mozilla build environment
1. it doesnt find a suitable python.
```
export MACH_USE_SYSTEM_PYTHON=1
make librewolf
```
2. <python-package-1> requires <python-package-2, which is not installed.
```
pip3 install <python-package-2>
```
And retry.
#### Hey, I'm using a Mac or Windows :(
We understand, life isn't always fair 😺. The same steps as above do apply, you'll just have to walk through the beginning part of the guides for [MacOS](https://firefox-source-docs.mozilla.org/setup/macos_build.html), [Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html).

144
assets/old-docs.md Normal file
View file

@ -0,0 +1,144 @@
That should be it for this readme, the stuff below is for more internal backward compatibility. So you can safely ignore it.
# CI documentation, wasi, and Docker
To download the latest from a script, use wget/curl like this:
```
wget -O librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build
curl -L -o librewolf-__VERSION__-__RELEASE__.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-__VERSION__-__RELEASE__.source.tar.gz?job=Build
```
Next, we create ourselves a build folder and extract the tarball.
```
mkdir build
cd build
tar xf ../librewolf-__VERSION__-__RELEASE__.source.tar.gz
```
### build environment
Next step, if you have not done so already, you must _create the build environment_:
```
./librewolf-__VERSION__/lw/mozfetch.sh
```
This would create a _mozilla-unified_ folder in our 'build' folder, or basically anywhere that is your current working directory. It takes about an hour for me to complete, but it needs to be done only once. This step might fail and cause problems. Hack a bit, and if that fails you can ask on our [Gitter](https://gitter.im/librewolf-community/librewolf)/[Matrix](https://matrix.to/#/#librewolf:matrix.org) channels. There is no need to actually build _mozilla-unified_ (Mozilla Nightly) itself, nor is the folder needed to build LibreWolf. So you can remove it: `rm -rf mozilla-unfied` if you don't plan on using/exploring it.
#### wasi sdk
Since Firefox 95.0, we need to install an additional library, the **'wasi sdk'**. This library sandboxes wasm libraries, which is what we want, but it's still experimental for us to include properly.
A few resources:
* mozilla.org: [WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95](https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/).
* [Compiling C to WebAssembly using clang/LLVM and WASI](https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/).
* [Firefox 95 on POWER](https://www.talospace.com/2021/12/firefox-95-on-power.html).
To setup the wasi sdk _headers_, you can use _librewolf-__VERSION__/lw/setup-wasi-linux.sh_. Please note that this script is a bit experimental and not all kinks have been worked out, but it should work.
This might not be enough on all systems. Some systems have the wasi-libc library already installed, and some don't. It depends on the installed version of Clang/LLVM it seems, which should be v8 or above. On debian-based systems: `sudo apt install wasi-libc`, on Arch: `https://archlinux.org/packages/community/any/wasi-libc/` (`pacman -Syu wasi-libc`). Instructions for macos/windows and perhaps other Linux distro's will be added here soon.
Or, the other option is to not use these sandbox libraries: In this case we can't use our standard _mozconfig_ symlink from _mozconfig.new_ into _mozconfig.new.without-wasi_. In that case you have to type something along the lines of:
```
cd librewolf-__VERSION__
cp lw/mozconfig.new.without-wasi mozconfig
cd ..
```
### building librewolf
Now we're ready to actually build LibreWolf:
```
cd librewolf-__VERSION__
./mach build
```
Also takes me an hour. Then, we can run it:
```
./mach run
```
Or make a package:
```
./mach package
```
### I want to keep up to date with the latest, but compile myself
1. To first clone the repo:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make librewolf
```
2. To keep up-to-date:
```
git pull
make librewolf
```
## [dev info] How to use this repo instead of [Common](https://gitlab.com/librewolf-community/browser/common):
Since the dawn of time, we have used **Common** to get _patches_, _source_files_, including _source_files/{branding}_
This source repo supports all that, because it uses these same things to produce the tarball. As far as I can tell, the mapping from Common to Source would be:
* _[patches](https://gitlab.com/librewolf-community/browser/common/-/tree/master/patches)_ -> _[patches](https://gitlab.com/librewolf-community/browser/source/-/tree/main/patches)_
* _[source\_files](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files)/search-config.json_ -> _[assets](https://gitlab.com/librewolf-community/browser/source/-/tree/main/assets)/search-config.json_
* _source\_files/browser/[branding](https://gitlab.com/librewolf-community/browser/common/-/tree/master/source_files/browser/branding)/librewolf_ -> _themes/browser/[branding](https://gitlab.com/librewolf-community/browser/source/-/tree/main/themes/browser/branding)/librewolf_
With this mapping, I hope that other builders that can't use our tarball (afterMozilla project, weird distro's), still use the same source/patches as the builders that do use it.
### Another feature
The file [assets/patches.txt](https://gitlab.com/librewolf-community/browser/source/-/blob/main/assets/patches.txt) defines what patches go in. These are not the only patches a builder will use, weird distro's etc, will use additional patches. those patches can live in the repo of that distro, or in a subfolder here. I hope this gives everybody the freedom to build anyway they please, like in Common, but with the added benefit that we produce a source tarball.
### Implementing a build script the new way:
The repository has a short [example shell script](https://gitlab.com/librewolf-community/browser/source/-/blob/main/scripts/fetch-build.sh) on how to use the new-style tarball approach instead of the older patching-it-yourself approach.
## [dev info] Building the LibreWolf source tarball:
Luckly, you don't need the build environment for this. If you don't have write access, just:
```
git clone https://gitlab.com/librewolf-community/browser/source.git
cd source
make all
```
If you **do** have write access, we're first gonna check for a newer version of Firefox:
```
git clone git@gitlab.com:librewolf-community/browser/source.git
cd source
make check
```
If there is a new version, it's a good time to git commit and trigger a CI build job.
```
git commit -am v$(cat version)-$(cat release) && git push
```
To build the source archive:
```
make all
```
If you have a working build environment, you can build librewolf with:
```
make librewolf
```
This extracts the source, and then tries to `./mach build && ./mach package`.
## FAQ: Common issues when setting up the Mozilla build environment
1. it doesnt find a suitable python.
```
export MACH_USE_SYSTEM_PYTHON=1
make librewolf
```
2. <python-package-1> requires <python-package-2, which is not installed.
```
pip3 install <python-package-2>
```
And retry.

View file

@ -1,6 +1,9 @@
patches/allow-ubo-private-mode.patch
patches/bootstrap-without-vcs.patch
patches/context-menu.patch
patches/custom-ubo-assets-bootstrap-location.patch
patches/disable-data-reporting-at-compile-time.patch
patches/librewolf-pref-pane.patch
patches/mozilla-vpn-ad.patch
patches/mozilla_dirs.patch
patches/mozilla-kde.patch
@ -18,4 +21,3 @@ patches/ui-patches/remove-organization-policy-banner.patch
patches/ui-patches/remove-snippets-from-home.patch
patches/ui-patches/sanitizing-description.patch
patches/urlbarprovider-interventions.patch
patches/xmas.patch

1
assets/uBOAssets.json Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,14 +0,0 @@
## handle different upstreams, like developer,nightly, or distro specific upstream cases
upstream_filename=bootstrap.py
upstream_dirname=mozilla-unified
$(upstream_filename) :
wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
##
clean_upstream_file :
rm -f $(upstream_filename)
clean_upstream_dir :
rm -rf $(upstream_dirname)
create_lw_from_upstream_dir :
python3 bootstrap.py --no-interactive --application-choice=browser
mv $(upstream_dirname) librewolf-$(version)

View file

@ -1,14 +0,0 @@
## handle different upstreams, like developer,nightly, or distro specific upstream cases
upstream_filename=mozilla-unified
upstream_dirname=mozilla-unified
$(upstream_filename) :
hg clone https://hg.mozilla.org/mozilla-unified
(cd mozilla-unified && hg update)
##
clean_upstream_file :
clean_upstream_dir :
create_lw_from_upstream_dir :
(cd mozilla-unified && hg pull)
(cd mozilla-unified && hg update)
cp -r $(upstream_dirname) librewolf-$(version)

View file

@ -1,14 +0,0 @@
## handle different upstreams, like developer,nightly, or distro specific upstream cases
upstream_filename=firefox-$(version).source.tar.xz
upstream_dirname=firefox-$(version)
$(upstream_filename) :
wget -q https://archive.mozilla.org/pub/firefox/releases/$(version)/source/firefox-$(version).source.tar.xz
##
clean_upstream_file :
rm -f $(upstream_filename)
clean_upstream_dir :
rm -rf $(upstream_dirname)
create_lw_from_upstream_dir :
tar xf $(upstream_filename)
mv $(upstream_dirname) librewolf-$(version)

View file

@ -0,0 +1,56 @@
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -542,10 +542,7 @@ def current_firefox_checkout(env, hg=None):
if child == "":
break
- raise UserError(
- "Could not identify the root directory of your checkout! "
- "Are you running `mach bootstrap` in an hg or git clone?"
- )
+ return ("local", os.getcwd())
def update_git_tools(git, root_state_dir):
--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
@@ -672,6 +672,21 @@ class GitRepository(Repository):
self._run("config", name, value)
+class LocalRepository(Repository):
+
+ def __init__(self, path):
+ super(LocalRepository, self).__init__(path, tool="true")
+
+ @property
+ def head_ref(self):
+ return ""
+
+ def get_tracked_files_finder(self):
+ files = [os.path.relpath(os.path.join(dp, f), self.path) for dp, dn, fn in os.walk(self.path) for f in fn]
+ files.sort()
+ return FileListFinder(files)
+
+
def get_repository_object(path, hg="hg", git="git"):
"""Get a repository object for the repository at `path`.
If `path` is not a known VCS repository, raise an exception.
@@ -681,7 +696,7 @@ def get_repository_object(path, hg="hg", git="git"):
elif os.path.exists(os.path.join(path, ".git")):
return GitRepository(path, git=git)
else:
- raise InvalidRepoPath("Unknown VCS, or not a source checkout: %s" % path)
+ return LocalRepository(path)
def get_repository_from_build_config(config):
@@ -705,6 +720,8 @@ def get_repository_from_build_config(config):
return HgRepository(config.topsrcdir, hg=config.substs["HG"])
elif flavor == "git":
return GitRepository(config.topsrcdir, git=config.substs["GIT"])
+ elif flavor == "local":
+ return LocalRepository(config.topsrcdir)
else:
raise MissingVCSInfo("unknown VCS_CHECKOUT_TYPE value: %s" % flavor)

View file

@ -0,0 +1,17 @@
--- a/toolkit/components/extensions/parent/ext-storage.js
+++ b/toolkit/components/extensions/parent/ext-storage.js
@@ -177,6 +177,14 @@ this.storage = class extends ExtensionAPI {
let data = await lookup;
if (!data) {
+ const assetsBootstrapLocation = Services.prefs.getStringPref("librewolf.uBO.assetsBootstrapLocation", undefined);
+ if (extension.id == "uBlock0@raymondhill.net" && assetsBootstrapLocation) {
+ return {
+ adminSettings: {
+ assetsBootstrapLocation
+ }
+ }
+ }
return Promise.reject({
message: "Managed storage manifest not found",
});

View file

@ -0,0 +1,782 @@
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..2badfe9
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,12 @@
+stages:
+ - build
+
+create-patch:
+ stage: build
+ variables:
+ GIT_DEPTH: 200
+ script:
+ - git diff 1fee314adc81000294fc0cf3196a758e4b64dace > librewolf-pref-pane.patch
+ artifacts:
+ paths:
+ - librewolf-pref-pane.patch
diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn
index 4f3babe..97c7ec2 100644
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -11,6 +11,7 @@ browser.jar:
content/browser/preferences/home.js
content/browser/preferences/search.js
content/browser/preferences/privacy.js
+ content/browser/preferences/librewolf.js
content/browser/preferences/containers.js
content/browser/preferences/sync.js
content/browser/preferences/experimental.js
diff --git a/browser/components/preferences/librewolf.inc.xhtml b/browser/components/preferences/librewolf.inc.xhtml
new file mode 100644
index 0000000..b627417
--- /dev/null
+++ b/browser/components/preferences/librewolf.inc.xhtml
@@ -0,0 +1,206 @@
+# 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/.
+
+<script src="chrome://browser/content/preferences/librewolf.js"/>
+
+<html:template id="template-paneLibrewolf">
+
+<hbox class="subcategory" hidden="true" data-category="paneLibrewolf">
+ <html:h1 data-l10n-id="librewolf-header"/>
+</hbox>
+
+<groupbox hidden="true" data-category="paneLibrewolf">
+ <html:h2 data-l10n-id="librewolf-general-heading"/>
+
+ <!-- TEMPLATE FOR A NEW PREFERENCE
+ <hbox>
+ <checkbox id="librewolf-LABEL-checkbox" data-l10n-id="librewolf-LABEL-checkbox" preference="PREF" flex="1" />
+ <html:label for="librewolf-LABEL-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-LABEL-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-LABEL-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-LABEL-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="PREF" label="PREF" />
+ </vbox>
+ </vbox>
+ -->
+
+ <hbox>
+ <checkbox id="librewolf-extension-update-checkbox" data-l10n-id="librewolf-extension-update-checkbox" preference="extensions.update.autoUpdateDefault" flex="1" />
+ <html:label for="librewolf-extension-update-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-extension-update-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-extension-update-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-extension-update-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="extensions.update.autoUpdateDefault" label="extensions.update.autoUpdateDefault" />
+ <checkbox preference="extensions.update.enabled" label="extensions.update.enabled" />
+ </vbox>
+ </vbox>
+
+ <hbox>
+ <checkbox id="librewolf-autocopy-checkbox" data-l10n-id="librewolf-autocopy-checkbox" preference="clipboard.autocopy" flex="1" />
+ <html:label for="librewolf-autocopy-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-autocopy-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-autocopy-description" />
+ <checkbox preference="clipboard.autocopy" label="clipboard.autocopy" />
+ <checkbox preference="middlemouse.paste" label="middlemouse.paste" />
+ </vbox>
+ </vbox>
+
+ <hbox>
+ <checkbox id="librewolf-styling-checkbox" data-l10n-id="librewolf-styling-checkbox" preference="toolkit.legacyUserProfileCustomizations.stylesheets" flex="1" />
+ <html:label for="librewolf-styling-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-styling-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-styling-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-styling-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="toolkit.legacyUserProfileCustomizations.stylesheets" label="toolkit.legacyUserProfileCustomizations.stylesheets" />
+ </vbox>
+ </vbox>
+
+</groupbox>
+
+<groupbox hidden="true" data-category="paneLibrewolf">
+ <html:h2 data-l10n-id="librewolf-network-heading" />
+
+ <hbox>
+ <checkbox id="librewolf-ipv6-checkbox" data-l10n-id="librewolf-ipv6-checkbox" preference="network.dns.disableIPv6" flex="1" />
+ <html:label for="librewolf-ipv6-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-ipv6-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-ipv6-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-ipv6-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="network.dns.disableIPv6" label="network.dns.disableIPv6" />
+ </vbox>
+ </vbox>
+
+</groupbox>
+
+<groupbox hidden="true" data-category="paneLibrewolf">
+ <html:h2 data-l10n-id="librewolf-broken-heading" />
+
+ <hbox>
+ <checkbox id="librewolf-rfp-checkbox" data-l10n-id="librewolf-rfp-checkbox" preference="privacy.resistFingerprinting" flex="1" />
+ <html:label for="librewolf-rfp-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-rfp-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-rfp-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-rfp-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="privacy.resistFingerprinting" label="privacy.resistFingerprinting" />
+ </vbox>
+ </vbox>
+
+ <vbox class="indent">
+
+ <hbox>
+ <checkbox id="librewolf-letterboxing-checkbox" data-l10n-id="librewolf-letterboxing-checkbox" preference="privacy.resistFingerprinting.letterboxing" flex="1" />
+ <html:label for="librewolf-letterboxing-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-letterboxing-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-letterboxing-description" />
+ <checkbox preference="privacy.resistFingerprinting.letterboxing" label="privacy.resistFingerprinting.letterboxing" />
+ </vbox>
+ </vbox>
+
+ <hbox>
+ <checkbox id="librewolf-auto-decline-canvas-checkbox" data-l10n-id="librewolf-auto-decline-canvas-checkbox" preference="privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" flex="1" />
+ <html:label for="librewolf-auto-decline-canvas-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-auto-decline-canvas-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-auto-decline-canvas-description" />
+ <html:div> <label data-l10n-id="librewolf-auto-decline-canvas-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" label="privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" />
+ </vbox>
+ </vbox>
+
+ </vbox>
+
+ <hbox>
+ <checkbox id="librewolf-webgl-checkbox" data-l10n-id="librewolf-webgl-checkbox" preference="webgl.disabled" flex="1" />
+ <html:label for="librewolf-webgl-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-webgl-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-webgl-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-webgl-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="webgl.disabled" label="webgl.disabled" />
+ </vbox>
+ </vbox>
+
+</groupbox>
+
+<groupbox hidden="true" data-category="paneLibrewolf">
+ <html:h2 data-l10n-id="librewolf-security-heading" />
+
+ <hbox>
+ <checkbox id="librewolf-goog-safe-checkbox" data-l10n-id="librewolf-goog-safe-checkbox" preference="browser.safebrowsing.malware.enabled" flex="1" />
+ <html:label for="librewolf-goog-safe-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-goog-safe-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-goog-safe-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-goog-safe-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="browser.safebrowsing.malware.enabled" label="browser.safebrowsing.malware.enabled" />
+ <checkbox preference="browser.safebrowsing.phishing.enabled" label="browser.safebrowsing.phishing.enabled" />
+ <checkbox preference="browser.safebrowsing.blockedURIs.enabled" label="browser.safebrowsing.blockedURIs.enabled" />
+ <checkbox preference="browser.safebrowsing.provider.google4.gethashURL" label="browser.safebrowsing.provider.google4.gethashURL" id="librewolf-goog-safe-hash4"/>
+ <checkbox preference="browser.safebrowsing.provider.google4.updateURL" label="browser.safebrowsing.provider.google4.updateURL" id="librewolf-goog-safe-up4"/>
+ <checkbox preference="browser.safebrowsing.provider.google.gethashURL" label="browser.safebrowsing.provider.google.gethashURL" id="librewolf-goog-safe-hash"/>
+ <checkbox preference="browser.safebrowsing.provider.google.updateURL" label="browser.safebrowsing.provider.google.updateURL" id="librewolf-goog-safe-up"/>
+ </vbox>
+ </vbox>
+
+ <vbox class="indent">
+ <hbox>
+ <checkbox id="librewolf-goog-safe-download-checkbox" data-l10n-id="librewolf-goog-safe-download-checkbox" preference="browser.safebrowsing.downloads.enabled" flex="1" />
+ <html:label for="librewolf-goog-safe-download-collapse" class="sidebar-footer-link" pack="end"> <image class="sidebar-footer-icon help-icon"/> </html:label>
+ </hbox>
+ <vbox class="librewolf-collapse indent">
+ <html:input type="checkbox" id="librewolf-goog-safe-download-collapse" />
+ <vbox class="librewolf-collapsed tracking-protection-ui content-blocking-category">
+ <label data-l10n-id="librewolf-goog-safe-download-description" />
+ <html:div> <image src="chrome://browser/skin/warning.svg" /> <label data-l10n-id="librewolf-goog-safe-download-warning1" class="librewolf-warning" /> </html:div>
+ <checkbox preference="browser.safebrowsing.downloads.enabled" label="browser.safebrowsing.downloads.enabled" />
+ </vbox>
+ </vbox>
+ </vbox>
+
+</groupbox>
+
+<hbox class="subcategory" hidden="true" data-category="paneLibrewolf">
+ <html:h1 data-l10n-id="librewolf-footer"/>
+</hbox>
+
+<groupbox data-category="paneLibrewolf" hidden="true">
+ <hbox>
+ <label id="librewolf-config-link-wrapper" class="sidebar-footer-link" is="text-link" flex="1">
+ <image class="sidebar-footer-icon" src="chrome://browser/skin/ion.svg" /> <!-- TODO not the typical way a picture is defined I think, and also we should copy the svg file in case they change it -->
+ <label id="librewolf-config-link" data-l10n-id="librewolf-config-link"></label>
+ </label>
+ <hbox pack="end">
+ <button id="librewolf-open-profile-button" class="accessory-button" is="highlightable-button" data-l10n-id="librewolf-open-profile"/>
+ </hbox>
+ </hbox>
+</groupbox>
+
+</html:template>
diff --git a/browser/components/preferences/librewolf.js b/browser/components/preferences/librewolf.js
new file mode 100644
index 0000000..c460b8c
--- /dev/null
+++ b/browser/components/preferences/librewolf.js
@@ -0,0 +1,234 @@
+/* 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/. */
+
+/* import-globals-from extensionControlled.js */
+/* import-globals-from preferences.js */
+
+var { AppConstants } = ChromeUtils.import( "resource://gre/modules/AppConstants.jsm");
+XPCOMUtils.defineLazyGetter(this, "L10n", () => {
+ return new Localization([
+ "branding/brand.ftl",
+ "browser/preferences/preferences.ftl",
+ ]);
+});
+
+Preferences.addAll([
+ // IPv6
+ { id: "network.dns.disableIPv6", type: "bool" },
+ // WebGL
+ { id: "webgl.disabled", type: "bool" },
+ // RFP
+ { id: "privacy.resistFingerprinting", type: "bool" },
+ // Automatically Update Extensions
+ { id: "extensions.update.enabled", type: "bool" },
+ { id: "extensions.update.autoUpdateDefault", type: "bool" },
+ // Clipboard autocopy/paste
+ { id: "clipboard.autocopy", type: "bool" },
+ { id: "middlemouse.paste", type: "bool" },
+ // Harden
+ { id: "privacy.resistFingerprinting.letterboxing", type: "bool" },
+ // Google Safe Browsing
+ //{ id: "browser.safebrowsing.malware.enabled", type: "bool" }, // Already loaded
+ //{ id: "browser.safebrowsing.phishing.enabled", type: "bool" },
+ { id: "browser.safebrowsing.blockedURIs.enabled", type: "bool" },
+ { id: "browser.safebrowsing.provider.google4.gethashURL", type: "string" },
+ { id: "browser.safebrowsing.provider.google4.updateURL", type: "string" },
+ { id: "browser.safebrowsing.provider.google.gethashURL", type: "string" },
+ { id: "browser.safebrowsing.provider.google.updateURL", type: "string" },
+ /**** Prefs that require changing a lockPref ****/
+ // Google safe browsing check downloads
+ //{ id: "browser.safebrowsing.downloads.enabled", type: "bool" }, //Also already added
+ { id: "toolkit.legacyUserProfileCustomizations.stylesheets", type: "bool" },
+ // Canvas UI when blocked
+ { id: "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts", type: "bool" },
+]);
+
+var gLibrewolfPane = {
+ _pane: null,
+
+ // called when the document is first parsed
+ init() {
+ this._pane = document.getElementById("paneLibrewolf");
+
+ // Set all event listeners on checkboxes
+ setBoolSyncListeners(
+ "librewolf-extension-update-checkbox",
+ ["extensions.update.autoUpdateDefault", "extensions.update.enabled"],
+ [true, true ],
+ );
+ setBoolSyncListeners(
+ "librewolf-ipv6-checkbox",
+ ["network.dns.disableIPv6"],
+ [false, ],
+ );
+ setBoolSyncListeners(
+ "librewolf-autocopy-checkbox",
+ ["clipboard.autocopy", "middlemouse.paste"],
+ [true, true ],
+ );
+ setBoolSyncListeners(
+ "librewolf-styling-checkbox",
+ ["toolkit.legacyUserProfileCustomizations.stylesheets"],
+ [true, ],
+ );
+
+ setBoolSyncListeners(
+ "librewolf-webgl-checkbox",
+ ["webgl.disabled"],
+ [false ],
+ );
+ setBoolSyncListeners(
+ "librewolf-rfp-checkbox",
+ ["privacy.resistFingerprinting"],
+ [true ],
+ );
+ setBoolSyncListeners(
+ "librewolf-auto-decline-canvas-checkbox",
+ ["privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts"],
+ [true ],
+ );
+
+ setBoolSyncListeners(
+ "librewolf-letterboxing-checkbox",
+ ["privacy.resistFingerprinting.letterboxing"],
+ [true ],
+ );
+
+ setSyncListeners(
+ "librewolf-goog-safe-checkbox",
+ [
+ "browser.safebrowsing.malware.enabled",
+ "browser.safebrowsing.phishing.enabled",
+ "browser.safebrowsing.blockedURIs.enabled",
+ "browser.safebrowsing.provider.google4.gethashURL",
+ "browser.safebrowsing.provider.google4.updateURL",
+ "browser.safebrowsing.provider.google.gethashURL",
+ "browser.safebrowsing.provider.google.updateURL",
+ ],
+ [
+ true,
+ true,
+ true,
+ "https://safebrowsing.googleapis.com/v4/fullHashes:find?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST",
+ "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST",
+ "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2",
+ "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_SAFEBROWSING_API_KEY%",
+ ],
+ [
+ false,
+ false,
+ false,
+ "",
+ "",
+ "",
+ "",
+ ]
+ );
+
+ // Set event listener on open profile directory button
+ setEventListener("librewolf-open-profile-button", "command", openProfileDirectory);
+ // Set event listener on open about:config button
+ setEventListener("librewolf-config-link", "click", openAboutConfig);
+
+ // Notify observers that the UI is now ready
+ Services.obs.notifyObservers(window, "librewolf-pane-loaded");
+ },
+};
+
+function openProfileDirectory() {
+ // Get the profile directory.
+ let currProfD = Services.dirsvc.get("ProfD", Ci.nsIFile);
+ let profileDir = currProfD.path;
+
+ // Show the profile directory.
+ let nsLocalFile = Components.Constructor(
+ "@mozilla.org/file/local;1",
+ "nsIFile",
+ "initWithPath"
+ );
+ new nsLocalFile(profileDir).reveal();
+}
+
+function openAboutConfig() {
+ window.open("about:config", "_blank");
+}
+
+function setBoolSyncListeners(checkboxid, opts, vals) {
+ setSyncFromPrefListener(checkboxid, () => readGenericBoolPrefs(opts, vals));
+ setSyncToPrefListener(checkboxid, () => writeGenericBoolPrefs(opts, vals, document.getElementById(checkboxid).checked));
+ for (let i = 1; i < opts.length; i++) {
+ Preferences.get(opts[i]).on("change", () => makeMasterCheckboxesReactive(checkboxid, () => readGenericBoolPrefs(opts, vals)));
+ }
+}
+function setSyncListeners(checkboxid, opts, onVals, offVals) {
+ setSyncFromPrefListener(checkboxid, () => readGenericPrefs(opts, onVals, offVals));
+ setSyncToPrefListener(checkboxid, () => writeGenericPrefs(opts, onVals, offVals, document.getElementById(checkboxid).checked));
+ for (let i = 1; i < opts.length; i++) {
+ Preferences.get(opts[i]).on("change", () => makeMasterCheckboxesReactive(checkboxid, () => readGenericPrefs(opts, onVals, offVals)));
+ }
+}
+
+function makeMasterCheckboxesReactive(checkboxid, func) {
+ let shouldBeChecked = func();
+ document.getElementById(checkboxid).checked = shouldBeChecked;
+}
+
+// Wrapper function in case something more is required (as I suspected in the first iteration of this)
+function getPref(pref) {
+ let retval = Preferences.get(pref);
+/* if (retval === undefined) {
+ return defaultValue;
+ } */
+ return retval._value;
+}
+// Returns true if all the preferences in prefs are equal to onVals, false otherwise TODO may need a third array for their default values because mozilla is dumb, after testing though pretty sure this was misinformation being spread by comments in default FF code that has long since been fixed
+function readGenericBoolPrefs(prefs, onVals) {
+ for (let i = 0; i < prefs.length; i++) {
+ if (getPref(prefs[i]) != onVals[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+function writeGenericBoolPrefs(opts, vals, changeToOn) {
+ valsCopy = [...vals];
+ if (!changeToOn) {
+ for (let i = 0; i < vals.length; i++) {
+ valsCopy[i] = !vals[i];
+ }
+ }
+ // Start at 1 because returning sets the last one
+ for (let i = 1; i < vals.length; i++) {
+ Services.prefs.setBoolPref(opts[i], valsCopy[i]);
+ }
+ return valsCopy[0];
+}
+
+// Returns true if all the preferences in prefs are equal to onVals, false otherwise... currently the same as for Bool as offVals is ignored
+function readGenericPrefs(prefs, onVals, offVals) {
+ for (let i = 0; i < prefs.length; i ++) {
+ let temp = getPref(prefs[i]);
+ if (getPref(prefs[i]) != onVals[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+function writeGenericPrefs(opts, onVals, offVals, changeToOn) {
+ let writeArr = (changeToOn) ? onVals : offVals;
+ for (let i = 1; i < opts.length; i++) {
+ let type = typeof(writeArr[i]);
+ if (type == "number") {
+ Services.prefs.setIntPref(opts[i], writeArr[i]);
+ } else if (type == "boolean") {
+ Services.prefs.setBoolPref(opts[i], writeArr[i]);
+ } else if (type == "string") {
+ Services.prefs.setCharPref(opts[i], writeArr[i]);
+ } else {
+ console.log("BADNESS 10000");
+ }
+ }
+ return writeArr[0];
+}
+
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
index 91e9e46..763ab49 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -8,6 +8,7 @@
/* import-globals-from search.js */
/* import-globals-from containers.js */
/* import-globals-from privacy.js */
+/* import-globals-from librewolf.js */
/* import-globals-from sync.js */
/* import-globals-from experimental.js */
/* import-globals-from findInPage.js */
@@ -117,6 +118,7 @@ function init_all() {
register_module("paneHome", gHomePane);
register_module("paneSearch", gSearchPane);
register_module("panePrivacy", gPrivacyPane);
+ register_module("paneLibrewolf", gLibrewolfPane);
register_module("paneContainers", gContainersPane);
if (Services.prefs.getBoolPref("browser.preferences.experimental")) {
// Set hidden based on previous load's hidden value.
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
index aab4a9e..907a631 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -12,6 +12,7 @@
<?xml-stylesheet href="chrome://browser/skin/preferences/search.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
+<?xml-stylesheet href="chrome://browser/skin/preferences/librewolf.css"?>
<!DOCTYPE html>
@@ -128,6 +129,17 @@
<label class="category-name" flex="1" data-l10n-id="pane-privacy-title"></label>
</richlistitem>
+ <richlistitem id="category-librewolf"
+ class="category"
+ value="paneLibrewolf"
+ helpTopic="prefs-librewolf"
+ data-l10n-id="category-librewolf"
+ data-l10n-attrs="tooltiptext"
+ align="center">
+ <image class="category-icon"/>
+ <label class="category-name" flex="1" data-l10n-id="pane-librewolf-title"></label>
+ </richlistitem>
+
<richlistitem id="category-sync"
class="category"
hidden="true"
@@ -201,6 +213,7 @@
#include home.inc.xhtml
#include search.inc.xhtml
#include privacy.inc.xhtml
+#include librewolf.inc.xhtml
#include containers.inc.xhtml
#include sync.inc.xhtml
#include experimental.inc.xhtml
diff --git a/browser/locales/en-US/browser/preferences/preferences.ftl b/browser/locales/en-US/browser/preferences/preferences.ftl
index d276f7a..39f3660 100644
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -1347,3 +1347,78 @@ choose-download-folder-title = Choose Download Folder:
# $service-name (String) - Name of a cloud storage provider like Dropbox, Google Drive, etc...
save-files-to-cloud-storage =
.label = Save files to { $service-name }
+
+## LibreWolf preferences
+
+# Sidebar
+pane-librewolf-title = LibreWolf
+category-librewolf =
+ .tooltiptext = about:config changes, logically grouped and easily accessible
+
+# Main content
+librewolf-header = Librewolf Preferences
+librewolf-warning-title = Heads up!
+librewolf-warning-description = We carefully choose default settings to focus on privacy and security. When changing these settings, read the descriptions to understand the implications of those changes.
+
+# Page Layout
+librewolf-general-heading = Browser Behavior
+librewolf-extension-update-checkbox =
+ .label = Update add-ons automatically
+librewolf-autocopy-checkbox =
+ .label = Enable middle click paste
+librewolf-styling-checkbox =
+ .label = Allow userChrome.css customization
+
+librewolf-network-heading = Networking
+librewolf-ipv6-checkbox =
+ .label = Enable IPv6
+
+librewolf-broken-heading = Fingerprinting
+librewolf-webgl-checkbox =
+ .label = Enable WebGL
+librewolf-rfp-checkbox =
+ .label = Enable ResistFingerprinting
+librewolf-auto-decline-canvas-checkbox =
+ .label = Silently block canvas access requests
+librewolf-letterboxing-checkbox =
+ .label = Enable letterboxing
+
+librewolf-security-heading = Security
+librewolf-goog-safe-checkbox =
+ .label = Enable Google Safe Browsing
+librewolf-goog-safe-download-checkbox =
+ .label = Scan downloads
+
+# In-depth descriptions
+librewolf-extension-update-description = Keep extensions up to date without manual intervention. A good choice for your security.
+librewolf-extension-update-warning1 = If you don't review the code of your extensions before every update, you should enable this option.
+
+librewolf-ipv6-description = Allow { -brand-short-name } to connect using IPv6.
+librewolf-ipv6-warning1 = Before you change this, make sure your OS uses the IPv6 privacy extension.
+
+librewolf-autocopy-description = Select some text to copy it, then paste it with a middle-mouse click.
+
+librewolf-styling-description = Enable this if you want to customize the UI with a manually loaded theme.
+librewolf-styling-warning1 = Make sure you trust the provider of the theme.
+
+librewolf-webgl-description = WebGL is a strong fingerprinting vector.
+librewolf-webgl-warning1 = If you need to enable it, consider using an extension like Canvas Blocker.
+
+librewolf-rfp-description = ResistFingerprinting is the best in class anti-fingerprinting tool.
+librewolf-rfp-warning1 = If you need to disable it, consider using an extension like Canvas Blocker.
+
+librewolf-auto-decline-canvas-description = Automatically deny canvas access to websites, without prompting the user.
+librewolf-auto-decline-canvas-warning1 = It is still possible to allow canvas access from the urlbar.
+
+librewolf-letterboxing-description = Letterboxing applies margins around your windows, in order to return a limited set of rounded resolutions.
+
+librewolf-goog-safe-description = If you are worried about malware and phishing, consider enabling it.
+librewolf-goog-safe-warning1 = Disabled over censorship concerns but recommended for less advanced users. All the checks happen locally.
+
+librewolf-goog-safe-download-description = Allow Safe Browsing to scan your downloads to identify suspicious files.
+librewolf-goog-safe-download-warning1 = All the checks happen locally.
+
+# Footer
+librewolf-footer = Useful links
+librewolf-config-link = All advanced settings (about:config)
+librewolf-open-profile = Open user profile directory
diff --git a/browser/themes/shared/jar.inc.mn b/browser/themes/shared/jar.inc.mn
index cf1ebf0..336118c 100644
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -105,6 +105,7 @@
skin/classic/browser/preferences/category-experiments.svg (../shared/preferences/category-experiments.svg)
skin/classic/browser/preferences/category-general.svg (../shared/preferences/category-general.svg)
skin/classic/browser/preferences/category-privacy-security.svg (../shared/preferences/category-privacy-security.svg)
+ skin/classic/browser/preferences/category-librewolf.svg (../shared/preferences/category-librewolf.svg)
skin/classic/browser/preferences/category-search.svg (../shared/preferences/category-search.svg)
skin/classic/browser/preferences/category-sync.svg (../shared/preferences/category-sync.svg)
skin/classic/browser/preferences/critters-postcard.jpg (../shared/preferences/critters-postcard.jpg)
@@ -119,6 +120,7 @@
skin/classic/browser/preferences/search-bar.svg (../shared/preferences/search-bar.svg)
skin/classic/browser/preferences/search.css (../shared/preferences/search.css)
skin/classic/browser/preferences/siteDataSettings.css (../shared/preferences/siteDataSettings.css)
+ skin/classic/browser/preferences/librewolf.css (../shared/preferences/librewolf.css)
* skin/classic/browser/preferences/containers.css (../shared/preferences/containers.css)
* skin/classic/browser/preferences/containers-dialog.css (../shared/preferences/containers-dialog.css)
skin/classic/browser/upgradeDialog/highlights-24.svg (../shared/upgradeDialog/highlights-24.svg)
diff --git a/browser/themes/shared/preferences/category-librewolf.svg b/browser/themes/shared/preferences/category-librewolf.svg
new file mode 100644
index 0000000..8ebf2eb
--- /dev/null
+++ b/browser/themes/shared/preferences/category-librewolf.svg
@@ -0,0 +1,96 @@
+<!-- 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/.
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="20" height="20" fill="context-fill" fill-opacity="context-fill-opacity">
+ <path d="M15.5 9 15 9l0-4A5 5 0 0 0 5 5l0 4-.5 0A2.5 2.5 0 0 0 2 11.5l0 6A2.5 2.5 0 0 0 4.5 20l11 0a2.5 2.5 0 0 0 2.5-2.5l0-6A2.5 2.5 0 0 0 15.5 9zm-9-4c0-1.93 1.57-3.5 3.5-3.5 1.93 0 3.5 1.57 3.5 3.5l0 4-7 0 0-4zm10 12.7-.8.8-11.4 0-.8-.8 0-6.4.8-.8 11.4 0 .8.8 0 6.4z"/>
+</svg>
+-->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="67.733337mm"
+ height="67.733337mm"
+ viewBox="0 0 67.733337 67.733337"
+ version="1.1"
+ id="svg8"
+ inkscape:version="0.92.4 5da689c313, 2019-01-14"
+ sodipodi:docname="LibreWolf.svg">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.9899495"
+ inkscape:cx="-15.106575"
+ inkscape:cy="110.91343"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1366"
+ inkscape:window-height="711"
+ inkscape:window-x="0"
+ inkscape:window-y="30"
+ inkscape:window-maximized="1"
+ inkscape:showpageshadow="false"
+ units="px"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <metadata
+ id="metadata5">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-42.106554,-153.8982)">
+ <circle
+ style="fill:#00acff;fill-opacity:1;stroke:none;stroke-width:0.53545821;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path875"
+ cx="75.973221"
+ cy="187.76486"
+ r="33.866669" />
+ <path
+ style="fill:#ffffff;stroke-width:0.13229167"
+ d="m 72.543594,214.67719 c -4.744093,-0.60875 -9.281981,-2.49991 -13.241953,-5.51858 -1.29157,-0.98455 -3.714943,-3.42363 -4.772834,-4.80375 -2.96241,-3.86476 -4.804479,-8.2508 -5.41218,-12.88661 -0.260164,-1.98464 -0.258719,-5.63349 0.0029,-7.44738 1.308078,-9.0677 7.01463,-16.8454 15.20915,-20.72918 3.811512,-1.80647 7.300266,-2.57114 11.730683,-2.57114 7.165903,0 13.5265,2.56749 18.680882,7.54063 2.483054,2.39575 4.148141,4.66808 5.573968,7.60677 1.92868,3.9751 2.70979,7.43276 2.70979,11.99526 0,6.00619 -1.7345,11.24407 -5.336957,16.11672 -1.070527,1.44797 -3.161747,3.64749 -4.549468,4.78507 -3.806562,3.12041 -8.658642,5.23183 -13.473174,5.86296 -1.663528,0.21807 -5.593318,0.24524 -7.120854,0.0492 z m 10.041381,-4.86547 c 2.898391,-0.91366 5.260364,-2.14146 7.540624,-3.91979 1.212494,-0.9456 3.308223,-3.06144 4.186916,-4.22711 2.38328,-3.16162 4.004927,-7.12196 4.482067,-10.94597 0.229814,-1.84182 0.09634,-5.73827 -0.2545,-7.4296 -0.9294,-4.48046 -2.931647,-8.26499 -6.086007,-11.50342 -1.966575,-2.01898 -3.756882,-3.34972 -6.060203,-4.50458 -3.495001,-1.75236 -6.489835,-2.46043 -10.423481,-2.46442 -4.164073,-0.004 -7.815325,0.95024 -11.429055,2.98766 -3.289753,1.85476 -6.690628,5.25952 -8.553227,8.563 -1.371786,2.43299 -2.37583,5.32029 -2.767595,7.95869 -0.256867,1.72991 -0.261933,5.16508 -0.01006,6.82145 0.504067,3.31489 1.761474,6.59111 3.584314,9.33904 0.995409,1.50058 0.964154,1.48393 1.842248,0.98153 1.570774,-0.8987 1.980396,-1.33342 2.836087,-3.00984 1.000624,-1.96036 2.070459,-3.6735 3.037094,-4.86332 1.115822,-1.37347 1.269228,-1.61793 1.828988,-2.9147 0.281654,-0.65249 0.786977,-1.61074 1.122938,-2.12943 l 0.61084,-0.94309 -0.79023,-0.77671 c -1.049647,-1.03168 -1.922751,-2.2016 -2.087012,-2.79651 -0.167761,-0.60758 0.03021,-0.9466 0.818744,-1.40207 0.797354,-0.46057 1.367585,-0.5929 3.498657,-0.81193 1.037629,-0.10665 2.164153,-0.30199 2.518962,-0.43681 0.353024,-0.13414 1.407825,-0.70824 2.344001,-1.27579 2.702947,-1.63863 2.931619,-1.72344 4.552111,-1.68831 1.368686,0.0297 1.371262,0.0291 2.182813,-0.46143 1.700674,-1.02802 4.14305,-2.88289 7.357044,-5.58733 0.61632,-0.5186 1.21002,-0.92569 1.31934,-0.90464 0.45462,0.0876 1.289567,2.13636 1.416407,3.47562 0.07693,0.81225 -0.08023,1.6155 -0.562014,2.87261 -0.13146,0.34301 -0.19208,0.67043 -0.134706,0.7276 0.13774,0.13726 0.610706,-0.4535 0.610706,-0.76279 0,-0.39435 0.261127,-0.43936 0.616327,-0.10623 0.258235,0.24218 0.480842,0.31151 1.000202,0.31151 0.567073,0 0.707447,0.0526 0.928773,0.3479 0.375574,0.50112 0.463647,1.86688 0.176201,2.73231 -0.279641,0.84191 -1.124801,1.81287 -1.891829,2.17341 -0.686334,0.32262 -2.075841,1.67928 -2.726081,2.66164 -0.248906,0.37604 -0.715586,1.15995 -1.037066,1.74204 -0.321487,0.58208 -0.86074,1.46154 -1.19834,1.95436 -0.664294,0.96972 -1.233147,2.3224 -1.782214,4.23798 -0.322553,1.1253 -0.34962,1.41826 -0.362953,3.92797 -0.01613,3.0317 -0.172894,3.77561 -0.9925,4.7091 -0.931805,1.06126 -1.861937,3.39186 -1.940127,4.8613 -0.04935,0.92751 -0.192246,1.83164 -0.395304,2.50122 -0.08942,0.29484 0.07752,0.2914 1.072102,-0.0221 z"
+ id="path847"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:type="star"
+ style="fill:#00acff;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path814"
+ sodipodi:sides="4"
+ sodipodi:cx="18.854025"
+ sodipodi:cy="172.98837"
+ sodipodi:r1="1.6036172"
+ sodipodi:r2="1.1339285"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.3561945"
+ inkscape:flatsided="true"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="m 18.854025,174.59199 -1.603617,-1.60362 1.603617,-1.60361 1.603617,1.60361 z"
+ transform="matrix(0.23203125,0.40188991,-0.99392962,0.57384553,246.21921,73.888081)" />
+ </g>
+</svg>
+
diff --git a/browser/themes/shared/preferences/librewolf.css b/browser/themes/shared/preferences/librewolf.css
new file mode 100644
index 0000000..aeb550c
--- /dev/null
+++ b/browser/themes/shared/preferences/librewolf.css
@@ -0,0 +1,16 @@
+.librewolf-collapse > input {
+ display: none;
+}
+.librewolf-collapse > input ~ .librewolf-collapsed {
+ display: none;
+ /* max-height: 0; */
+ transition: max-height 0.25s ease-in-out;
+}
+.librewolf-collapse > input:checked ~ .librewolf-collapsed {
+ display: block;
+ /* max-height: 20rem; */
+}
+.librewolf-warning {
+ display: inline;
+ font-size: 0.8em;
+}
diff --git a/browser/themes/shared/preferences/preferences.inc.css b/browser/themes/shared/preferences/preferences.inc.css
index 31bffd0..1f9fbcf 100644
--- a/browser/themes/shared/preferences/preferences.inc.css
+++ b/browser/themes/shared/preferences/preferences.inc.css
@@ -201,6 +201,10 @@ checkbox {
list-style-image: url("chrome://browser/skin/preferences/category-privacy-security.svg");
}
+#category-librewolf > .category-icon {
+ list-style-image: url("chrome://browser/skin/preferences/category-librewolf.svg");
+}
+
#category-sync > .category-icon {
list-style-image: url("chrome://browser/skin/preferences/category-sync.svg");
}

View file

@ -2,18 +2,18 @@ diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build
index 269dcb2..ed7c31d 100644
--- a/browser/extensions/moz.build
+++ b/browser/extensions/moz.build
@@ -5,11 +5,8 @@
@@ -5,11 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [
- "doh-rollout",
"formautofill",
"screenshots",
- "webcompat",
"webcompat",
- "report-site-issue",
"pictureinpicture",
"proxy-failover",
]
"search-detection",
diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
index 496379c..dd6f359 100644
--- a/browser/locales/Makefile.in

View file

@ -1 +1 @@
1
3

View file

@ -0,0 +1 @@
wget -O patches/librewolf-pref-pane.patch https://gitlab.com/librewolf-community/browser/librewolf-pref-pane/-/jobs/artifacts/main/raw/librewolf-pref-pane.patch?job=create-patch

View file

@ -9,7 +9,6 @@ import os
import sys
import optparse
import time
import glob
#
@ -99,17 +98,13 @@ def librewolf_patches():
exec('cp -v ../assets/search-config.json services/settings/dumps/main/search-config.json')
# read lines of .txt file into 'patches'
f = open('../assets/patches.txt'.format(version), "r")
lines = f.readlines()
f.close()
patches = []
for line in lines:
patches.append('../'+line)
for p in patches:
patch(p)
with open('../assets/patches.txt'.format(version), "r") as f:
for line in f.readlines():
patch('../'+line)
# apply xmas.patch seperately because not all builders use this repo the same way, and
# we don't want to disturbe those workflows.
patch('../patches/xmas.patch')
#
# Create the 'lw' folder, it contains the librewolf.cfg and policies.json files.
@ -117,29 +112,20 @@ def librewolf_patches():
exec('mkdir -p lw')
# insert the settings pane source (experimental)
exec('rm -rf librewolf-pref-pane')
exec('git clone https://gitlab.com/librewolf-community/browser/librewolf-pref-pane.git')
os.chdir('librewolf-pref-pane')
exec('git diff 1fee314adc81000294fc0cf3196a758e4b64dace > ../lw/librewolf-pref-pane.patch')
os.chdir('..')
exec('rm -rf librewolf-pref-pane')
# getting the librewolf settings repository
exec("cp -v ../submodules/settings/defaults/pref/local-settings.js lw/")
exec("cp -v ../submodules/settings/distribution/policies.json lw/")
exec("cp -v ../submodules/settings/librewolf.cfg lw/")
patch('lw/librewolf-pref-pane.patch')
exec('rm -f lw/librewolf-pref-pane.patch')
# provide a script that fetches and bootstraps Nightly and some mozconfigs
exec('cp -v ../scripts/mozfetch.sh lw/')
exec('cp -v ../assets/mozconfig.new ../assets/mozconfig.new.without-wasi ../scripts/setup-wasi-linux.sh lw/')
##! This is the moment in time we grab the Settings repo HEAD revision
exec('git clone https://gitlab.com/librewolf-community/settings.git')
exec("cp -v settings/defaults/pref/local-settings.js lw/")
exec("cp -v settings/distribution/policies.json lw/")
exec("cp -v settings/librewolf.cfg lw/")
exec('rm -rf settings')
# provide a script that fetches and bootstraps Nightly
exec('cp -v ../scripts/mozfetch.sh lw')
exec('cp -v ../assets/mozconfig.new ../assets/mozconfig.new.without-wasi ../scripts/setup-wasi-linux.sh lw')
# override the firefox version
for file in ["browser/config/version.txt", "browser/config/version_display.txt"]:
with open(file, "w") as f:
f.write("{}-{}".format(version,release))
leave_srcdir()
@ -149,10 +135,11 @@ def librewolf_patches():
# Main functionality in this script.. which is to call librewolf_patches()
#
if len(args) != 1:
sys.stderr.write('error: please specify version of librewolf source')
if len(args) != 2:
sys.stderr.write('error: please specify version and release of librewolf source')
sys.exit(1)
version = args[0]
release = args[1]
if not os.path.exists('librewolf-{}'.format(version) + '/configure.py'):
sys.stderr.write('error: folder doesn\'t look like a Firefox folder.')
sys.exit(1)

44
scripts/update-ubo-assets.sh Executable file
View file

@ -0,0 +1,44 @@
#!/bin/sh
set -e
echo "update-ubo-assets.sh"
echo
# Download the original assets.json from GitHub
echo "-> Downloading original assets.json"
assets=$(curl https://raw.githubusercontent.com/gorhill/uBlock/master/assets/assets.json)
# Overwrite the contentURL of assets.json so that uBO will always use the LW provided version
echo "-> Overwriting assets.json update location"
assets=$(echo "$assets" | jq '
del(.["assets.json"].cdnURLs) |
.["assets.json"].contentURL = "https://gitlab.com/librewolf-community/browser/source/-/raw/main/assets/uBOAssets.json"
')
# Enable some filter lists that are disabled by default
function enable_filter_list {
echo "-> Enabling filter list \"$1\""
assets=$(echo "$assets" | jq "del(.[\"$1\"].off)")
}
enable_filter_list "curben-phishing"
enable_filter_list "adguard-spyware-url"
# Add some custom filter lists
function add_filter_list {
echo "-> Adding custom filter list \"$1\""
assets=$(echo "$assets" | jq ".[\"$1\"] = $2")
}
add_filter_list "LegitimateURLShortener" '{
"content": "filters",
"group": "privacy",
"title": "➗ Actually Legitimate URL Shortener Tool",
"contentURL": "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt",
"supportURL": "https://github.com/DandelionSprout/adfilt/discussions/163"
}'
# Write the resulting json into line 4 of the patchfile
echo "-> Writing to assets/uBOAssets.json"
echo $assets | jq -c >./assets/uBOAssets.json
echo
echo "Done!"

1
submodules/settings Submodule

@ -0,0 +1 @@
Subproject commit 3a37e084e99e48e4bef59e5a6d5da57739554b58

View file

@ -43,13 +43,39 @@
}
#version {
font-weight: bold;
display: flex;
align-items: center;
margin-bottom: 4px;
}
#versionNumber {
font-weight: bold;
user-select: text;
-moz-user-focus: normal;
cursor: text;
margin-right: 4px;
}
#aboutText {
margin-top: 4px;
}
.loader {
width: 0.9em;
height: 0.9em;
border: 1.5px solid #fff;
border-bottom-color: transparent;
border-radius: 50%;
display: inline-block;
box-sizing: border-box;
animation: rotate 0.6s linear infinite;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View file

@ -4,19 +4,11 @@
"use strict";
/* import-globals-from aboutDialog-appUpdater.js */
// Services = object with smart getters for common XPCOM services
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
if (AppConstants.MOZ_UPDATER) {
Services.scriptloader.loadSubScript(
"chrome://browser/content/aboutDialog-appUpdater.js",
this
);
}
async function init(aEvent) {
if (aEvent.target != document) {
@ -49,33 +41,64 @@ async function init(aEvent) {
}
}
// Include the build ID and display warning if this is an "a#" (nightly or aurora) build
let versionId = "aboutDialog-version";
let versionAttributes = {
version: AppConstants.MOZ_APP_VERSION_DISPLAY,
bits: Services.appinfo.is64Bit ? 64 : 32,
};
// Display current version number
let versionField = document.getElementById("versionNumber");
versionField.innerHTML = AppConstants.MOZ_APP_VERSION_DISPLAY;
let version = Services.appinfo.version;
if (/a\d+$/.test(version)) {
versionId = "aboutDialog-version-nightly";
let buildID = Services.appinfo.appBuildID;
let year = buildID.slice(0, 4);
let month = buildID.slice(4, 6);
let day = buildID.slice(6, 8);
versionAttributes.isodate = `${year}-${month}-${day}`;
// If pref "librewolf.aboutMenu.checkVersion" is set to true,
// check for new version with the link given in "librewolf.aboutMenu.versionCheckGitlabUrl"
if (Services.prefs.getBoolPref("librewolf.aboutMenu.checkVersion", false)) {
let versionDiv = document.getElementById("version");
const loader = document.createElement("div");
loader.classList.add("loader");
versionDiv.appendChild(loader);
document.getElementById("experimental").hidden = false;
document.getElementById("communityDesc").hidden = true;
function isNewerVersion(newVersionString, oldVersionString) {
let [oldVersion, oldRelease] = oldVersionString.replace(/^v/, "").split("-");
let [newVersion, newRelease] = newVersionString.replace(/^v/, "").split("-");
console.log(oldVersionString, newVersionString)
if (oldVersion && newVersion) {
if (!oldRelease) oldRelease = "0";
if (!newRelease) newRelease = "0";
// Check version
for (let i = 0; i < newVersion.split(".").length; i++) {
if (Number(newVersion.split(".")[i]) > Number(oldVersion?.split(".")[i] || "0")) return true;
}
// Check release
if (Number(newRelease) > Number(oldRelease)) return true;
}
return false;
}
fetch(
Services.prefs.getStringPref(
"librewolf.aboutMenu.versionCheckGitlabUrl",
"https://gitlab.com/api/v4/projects/32320088/releases"
)
)
.then(response => response.json())
.then(data => {
if (data.length > 0) {
const latestVersion = data[0].tag_name;
if (isNewerVersion(latestVersion, AppConstants.MOZ_APP_VERSION_DISPLAY)) {
const updateNotice = document.createElement("a");
updateNotice.classList.add("text-link");
updateNotice.href = data[0]._links.self;
updateNotice.onclick = () => window.openWebLinkIn(data[0]._links.self, "tab")
updateNotice.innerText = "(Update available)";
versionDiv.appendChild(updateNotice);
} else {
const upToDateNotice = document.createElement("div")
upToDateNotice.innerText = "(Up to date)";
versionDiv.appendChild(upToDateNotice);
}
}
loader.remove();
})
}
// Use Fluent arguments for append version and the architecture of the build
let versionField = document.getElementById("version");
document.l10n.setAttributes(versionField, versionId, versionAttributes);
await document.l10n.translateElements([versionField]);
window.sizeToContent();
if (AppConstants.platform == "macosx") {
@ -85,3 +108,4 @@ async function init(aEvent) {
);
}
}

View file

@ -37,7 +37,9 @@
<div id="left" />
<div id="right">
<label id="wordmark">LibreWolf</label>
<label id="version" />
<div id="version">
<label id="versionNumber" />
</div >
<label id="distribution" />
<label id="distributionId" />
<label id="aboutText">

View file

@ -9,4 +9,4 @@ MOZ_APP_NAME=librewolf
MOZ_APP_BASENAME="LibreWolf"
MOZ_APP_PROFILE=librewolf
MOZ_APP_VENDOR=LibreWolf
MOZ_APP_DISPLAYNAME=LibreWolf

View file

@ -1 +0,0 @@
assets/upstream.std.mk

View file

@ -1 +1 @@
96.0.1
96.0.3