mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-11 01:12:06 -08:00
Update uBlock Origin assets & updater
This commit is contained in:
parent
cc01ab2088
commit
e126cf379c
4 changed files with 36 additions and 79 deletions
6
Makefile
6
Makefile
|
|
@ -11,7 +11,7 @@ pacman := python python-pip p7zip go msitools wget aria2
|
||||||
.PHONY: help fetch setup setup-minimal clean set-target distclean build package \
|
.PHONY: help fetch setup setup-minimal clean set-target distclean build package \
|
||||||
build-launcher check-arch revert edits run bootstrap mozbootstrap dir \
|
build-launcher check-arch revert edits run bootstrap mozbootstrap dir \
|
||||||
package-linux package-macos package-windows vcredist_arch patch unpatch \
|
package-linux package-macos package-windows vcredist_arch patch unpatch \
|
||||||
workspace check-arg edit-cfg ff-dbg tests
|
workspace check-arg edit-cfg ff-dbg tests update-ubo-assets
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
|
|
@ -37,6 +37,7 @@ help:
|
||||||
@echo " unpatch - Remove a patch"
|
@echo " unpatch - Remove a patch"
|
||||||
@echo " workspace - Sets the workspace to a patch, assuming its applied"
|
@echo " workspace - Sets the workspace to a patch, assuming its applied"
|
||||||
@echo " tests - Runs the Playwright tests"
|
@echo " tests - Runs the Playwright tests"
|
||||||
|
@echo " update-ubo-assets - Update the uBOAssets.json file"
|
||||||
|
|
||||||
_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||||
$(eval $(_ARGS):;@:)
|
$(eval $(_ARGS):;@:)
|
||||||
|
|
@ -217,4 +218,7 @@ tests:
|
||||||
--executable-path ../$(cf_source_dir)/obj-x86_64-pc-linux-gnu/dist/bin/camoufox-bin \
|
--executable-path ../$(cf_source_dir)/obj-x86_64-pc-linux-gnu/dist/bin/camoufox-bin \
|
||||||
$(if $(filter true,$(headful)),--headful,)
|
$(if $(filter true,$(headful)),--headful,)
|
||||||
|
|
||||||
|
update-ubo-assets:
|
||||||
|
bash ./scripts/update-ubo-assets.sh
|
||||||
|
|
||||||
vcredist_arch := $(shell echo $(arch) | sed 's/x86_64/x64/' | sed 's/i686/x86/')
|
vcredist_arch := $(shell echo $(arch) | sed 's/x86_64/x64/' | sed 's/i686/x86/')
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
"tags": "ads",
|
"tags": "ads",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"adguard-mobile": {
|
"adguard-mobile": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
"ua": "mobile",
|
"ua": "mobile",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/11.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/11.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"easylist": {
|
"easylist": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
"tags": "privacy",
|
"tags": "privacy",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/17.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/17.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"adguard-spyware": {
|
"adguard-spyware": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
"title": "AdGuard Tracking Protection",
|
"title": "AdGuard Tracking Protection",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/3.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/3.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"block-lan": {
|
"block-lan": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -198,7 +198,7 @@
|
||||||
"tags": "annoyances cookies",
|
"tags": "annoyances cookies",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/18.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/18.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"ublock-cookies-adguard": {
|
"ublock-cookies-adguard": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -267,7 +267,7 @@
|
||||||
"tags": "annoyances social",
|
"tags": "annoyances social",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"fanboy-social": {
|
"fanboy-social": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
"tags": "annoyances",
|
"tags": "annoyances",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/19.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/19.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"adguard-mobile-app-banners": {
|
"adguard-mobile-app-banners": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -321,7 +321,7 @@
|
||||||
"tags": "annoyances mobile",
|
"tags": "annoyances mobile",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/20.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/20.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"adguard-other-annoyances": {
|
"adguard-other-annoyances": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -332,7 +332,7 @@
|
||||||
"tags": "annoyances",
|
"tags": "annoyances",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/21.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/21.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"adguard-widgets": {
|
"adguard-widgets": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -343,7 +343,7 @@
|
||||||
"tags": "annoyances",
|
"tags": "annoyances",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/22.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/22.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"easylist-annoyances": {
|
"easylist-annoyances": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -564,9 +564,13 @@
|
||||||
"group": "regions",
|
"group": "regions",
|
||||||
"off": true,
|
"off": true,
|
||||||
"title": "🇭🇷hr 🇷🇸rs: Dandelion Sprout's Serbo-Croatian filters",
|
"title": "🇭🇷hr 🇷🇸rs: Dandelion Sprout's Serbo-Croatian filters",
|
||||||
"tags": "ads croatian serbian",
|
"tags": "ads croatian serbian bosnian",
|
||||||
"lang": "hr sr",
|
"lang": "bs hr sr",
|
||||||
"contentURL": "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/SerboCroatianList.txt",
|
"contentURL": [
|
||||||
|
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/SerboCroatianList.txt",
|
||||||
|
"https://cdn.jsdelivr.net/gh/DandelionSprout/adfilt@master/SerboCroatianList.txt",
|
||||||
|
"https://cdn.statically.io/gl/DandelionSprout/adfilt/master/SerboCroatianList.txt"
|
||||||
|
],
|
||||||
"supportURL": "https://github.com/DandelionSprout/adfilt#readme"
|
"supportURL": "https://github.com/DandelionSprout/adfilt#readme"
|
||||||
},
|
},
|
||||||
"HUN-0": {
|
"HUN-0": {
|
||||||
|
|
@ -655,7 +659,7 @@
|
||||||
"lang": "ja",
|
"lang": "ja",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/7.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/7.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"KOR-1": {
|
"KOR-1": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -710,7 +714,7 @@
|
||||||
"lang": "af fy nl",
|
"lang": "af fy nl",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/8.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/8.txt",
|
||||||
"cdnURLs": null,
|
"cdnURLs": null,
|
||||||
"supportURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"supportURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"NOR-0": {
|
"NOR-0": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -720,9 +724,7 @@
|
||||||
"tags": "ads norwegian danish icelandic",
|
"tags": "ads norwegian danish icelandic",
|
||||||
"lang": "nb nn no da is",
|
"lang": "nb nn no da is",
|
||||||
"contentURL": [
|
"contentURL": [
|
||||||
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt"
|
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt",
|
||||||
],
|
|
||||||
"cdnURLs": [
|
|
||||||
"https://cdn.jsdelivr.net/gh/DandelionSprout/adfilt@master/NorwegianList.txt",
|
"https://cdn.jsdelivr.net/gh/DandelionSprout/adfilt@master/NorwegianList.txt",
|
||||||
"https://cdn.statically.io/gl/DandelionSprout/adfilt/master/NorwegianList.txt"
|
"https://cdn.statically.io/gl/DandelionSprout/adfilt/master/NorwegianList.txt"
|
||||||
],
|
],
|
||||||
|
|
@ -798,7 +800,7 @@
|
||||||
"lang": "an ast ca cak es eu gl gn trs pt quz",
|
"lang": "an ast ca cak es eu gl gn trs pt quz",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/9.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/9.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"SVN-0": {
|
"SVN-0": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
@ -843,7 +845,7 @@
|
||||||
"lang": "tr",
|
"lang": "tr",
|
||||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/13.txt",
|
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/13.txt",
|
||||||
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
|
||||||
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
"instructionURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||||
},
|
},
|
||||||
"VIE-1": {
|
"VIE-1": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
|
|
|
||||||
|
|
@ -4,66 +4,17 @@ set -e
|
||||||
echo "update-ubo-assets.sh"
|
echo "update-ubo-assets.sh"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Download the original assets.json from GitHub
|
# Download the LibreWolf uBOAssets.json
|
||||||
echo "-> Downloading original assets.json"
|
echo "-> Downloading LibreWolf uBOAssets.json"
|
||||||
assets=$(curl https://raw.githubusercontent.com/gorhill/uBlock/master/assets/assets.json)
|
assets=$(curl https://gitlab.com/librewolf-community/browser/source/-/raw/main/assets/uBOAssets.json)
|
||||||
|
|
||||||
# Overwrite the contentURL of assets.json so that uBO will always use the LW provided version
|
# Remove specified filter lists
|
||||||
echo "-> Overwriting assets.json update location"
|
echo "-> Removing specified filter lists"
|
||||||
assets=$(echo "$assets" | jq '
|
assets=$(echo "$assets" | jq 'del(.["ublock-badware"], .["urlhaus-1"], .["curben-phishing"])')
|
||||||
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
|
# Write the resulting json
|
||||||
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"
|
|
||||||
}'
|
|
||||||
add_filter_list "bpc-paywall-filter" '{
|
|
||||||
"content": "filters",
|
|
||||||
"group": "annoyances",
|
|
||||||
"title": "Bypass Paywalls Clean filter",
|
|
||||||
"contentURL": "https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters/-/raw/main/bpc-paywall-filter.txt",
|
|
||||||
"supportURL": "https://gitlab.com/magnolia1234/bypass-paywalls-clean-filters"
|
|
||||||
}'
|
|
||||||
add_filter_list "AntiPaywall" '{
|
|
||||||
"content": "filters",
|
|
||||||
"group": "annoyances",
|
|
||||||
"title": "Anti-paywall filters",
|
|
||||||
"contentURL": "https://raw.githubusercontent.com/liamengland1/miscfilters/master/antipaywall.txt",
|
|
||||||
"supportURL": "https://github.com/liamengland1/miscfilters"
|
|
||||||
}'
|
|
||||||
|
|
||||||
# Write the resulting json into line 4 of the patchfile
|
|
||||||
echo "-> Writing to assets/uBOAssets.json"
|
echo "-> Writing to assets/uBOAssets.json"
|
||||||
echo $assets | jq . >./assets/uBOAssets.json
|
echo $assets | jq . >./assets/uBOAssets.json
|
||||||
|
|
||||||
git diff assets/uBOAssets.json
|
|
||||||
|
|
||||||
if [[ "$(
|
|
||||||
read -e -p '-? Commit changes? [y/N] '
|
|
||||||
echo $REPLY
|
|
||||||
)" == [Yy]* ]]; then
|
|
||||||
echo "-> Committing changes"
|
|
||||||
git add assets/uBOAssets.json
|
|
||||||
git commit -m "Update uBOAssets.json with latest changes"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
@ -238,7 +238,7 @@ defaultPref("camoufox.console.logging_disabled", false);
|
||||||
|
|
||||||
defaultPref(
|
defaultPref(
|
||||||
"camoufox.uBO.assetsBootstrapLocation",
|
"camoufox.uBO.assetsBootstrapLocation",
|
||||||
"https://gitlab.com/librewolf-community/browser/source/-/raw/main/assets/uBOAssets.json"
|
"https://raw.githubusercontent.com/daijro/camoufox/refs/heads/main/assets/uBOAssets.json"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Sanitize
|
// Sanitize
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue