2e4525fe3c
The `urltransform` option allows to redirect a non-blocked network request to another URL. There are restrictions on its usage: - require a trusted source -- thus uBO-maintained lists or user filters - the `urltransform` value must start with a `/` If at least one of these conditions is not fulfilled, the filter will be invalid and rejected. The requirement to start with `/` is to enforce that only the path part of a URL can be modified, thus ensuring the network request is redirected to the same scheme and authority (as defined at https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax). Usage example (redirect requests for CSS resources to a non-existing resource, for demonstration purpose): ||iana.org^$css,urltransform=/notfound.css Name of this option is inspired from DNR API: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/URLTransform This commit required to bring the concept of "trusted source" to the static network filtering engine. |
||
---|---|---|
.. | ||
chromium | ||
description | ||
extension | ||
firefox | ||
scriptlets | ||
make-rulesets.js | ||
make-scriptlets.js | ||
package.json | ||
README.md | ||
safe-replace.js | ||
ubo-version |
How to build MV3 uBO Lite
Instructions for reviewers.
The following assumes a linux environment.
- Open Bash console
git clone https://github.com/gorhill/uBlock.git
cd uBlock
make mv3-[platform]
, where[platform]
is eitherchromium
orfirefox
- This will fully build uBO Lite, and during the process filter lists will be downloaded from their respective remote servers
Upon completion of the script, the resulting extension package will become present in:
- Chromium:
dist/build/uBOLite.chromium
- Firefox:
dist/build/uBOLite.firefox
The folder dist/build/mv3-data
will cache data fetched from remote server, so as to avoid fetching repeatedly from remote server with repeated build commands. Remove dist/build/mv3-data
if you want to build with latest versions of filter lists.
The file dist/build/mv3-data/log.txt
will contain information about what happened during the build process.
The entry in the Makefile
which implement the build process is tools/make-mv3.sh [platform]
.[1] This Bash script copy various files from uBlock Origin branch and MV3-specific branch into a single folder which will be the final extension package.
Notably, tools/make-mv3.sh [platform]
calls a Nodejs script which purpose is to convert the filter lists into various rulesets to be used in a declarative way. The Nodejs version required is 17.5.0 or above.
All the final rulesets are present in the dist/build/uBOLite.[platform]/rulesets
in the final extension package.
[1] c4d324362f/tools/make-mv3.sh
[2] c4d324362f/tools/make-mv3.sh (L103)