mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 06:22:03 -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 \
|
||||
build-launcher check-arch revert edits run bootstrap mozbootstrap dir \
|
||||
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:
|
||||
@echo "Available targets:"
|
||||
|
|
@ -37,6 +37,7 @@ help:
|
|||
@echo " unpatch - Remove a patch"
|
||||
@echo " workspace - Sets the workspace to a patch, assuming its applied"
|
||||
@echo " tests - Runs the Playwright tests"
|
||||
@echo " update-ubo-assets - Update the uBOAssets.json file"
|
||||
|
||||
_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
$(eval $(_ARGS):;@:)
|
||||
|
|
@ -217,4 +218,7 @@ tests:
|
|||
--executable-path ../$(cf_source_dir)/obj-x86_64-pc-linux-gnu/dist/bin/camoufox-bin \
|
||||
$(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/')
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
"tags": "ads",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
"ua": "mobile",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/11.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
"tags": "privacy",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/17.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
"title": "AdGuard Tracking Protection",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/3.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -198,7 +198,7 @@
|
|||
"tags": "annoyances cookies",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/18.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -267,7 +267,7 @@
|
|||
"tags": "annoyances social",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -310,7 +310,7 @@
|
|||
"tags": "annoyances",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/19.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -321,7 +321,7 @@
|
|||
"tags": "annoyances mobile",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/20.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
"tags": "annoyances",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/21.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -343,7 +343,7 @@
|
|||
"tags": "annoyances",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/22.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -564,9 +564,13 @@
|
|||
"group": "regions",
|
||||
"off": true,
|
||||
"title": "🇭🇷hr 🇷🇸rs: Dandelion Sprout's Serbo-Croatian filters",
|
||||
"tags": "ads croatian serbian",
|
||||
"lang": "hr sr",
|
||||
"contentURL": "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/SerboCroatianList.txt",
|
||||
"tags": "ads croatian serbian bosnian",
|
||||
"lang": "bs hr sr",
|
||||
"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"
|
||||
},
|
||||
"HUN-0": {
|
||||
|
|
@ -655,7 +659,7 @@
|
|||
"lang": "ja",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/7.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -710,7 +714,7 @@
|
|||
"lang": "af fy nl",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/8.txt",
|
||||
"cdnURLs": null,
|
||||
"supportURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
||||
"supportURL": "https://adguard.com/kb/general/ad-filtering/adguard-filters/"
|
||||
},
|
||||
"NOR-0": {
|
||||
"content": "filters",
|
||||
|
|
@ -720,9 +724,7 @@
|
|||
"tags": "ads norwegian danish icelandic",
|
||||
"lang": "nb nn no da is",
|
||||
"contentURL": [
|
||||
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt"
|
||||
],
|
||||
"cdnURLs": [
|
||||
"https://raw.githubusercontent.com/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"
|
||||
],
|
||||
|
|
@ -798,7 +800,7 @@
|
|||
"lang": "an ast ca cak es eu gl gn trs pt quz",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/9.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
@ -843,7 +845,7 @@
|
|||
"lang": "tr",
|
||||
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/13.txt",
|
||||
"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": {
|
||||
"content": "filters",
|
||||
|
|
|
|||
|
|
@ -4,66 +4,17 @@ 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)
|
||||
# Download the LibreWolf uBOAssets.json
|
||||
echo "-> Downloading LibreWolf uBOAssets.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
|
||||
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"
|
||||
')
|
||||
# Remove specified filter lists
|
||||
echo "-> Removing specified filter lists"
|
||||
assets=$(echo "$assets" | jq 'del(.["ublock-badware"], .["urlhaus-1"], .["curben-phishing"])')
|
||||
|
||||
# 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"
|
||||
}'
|
||||
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
|
||||
# Write the resulting json
|
||||
echo "-> Writing to 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 "Done!"
|
||||
echo "Done!"
|
||||
|
|
@ -238,7 +238,7 @@ defaultPref("camoufox.console.logging_disabled", false);
|
|||
|
||||
defaultPref(
|
||||
"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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue