| 1 |
# https://developer.chrome.com/docs/extensions/how-to/distribute/host-on-linux |
| 2 |
crx: |
| 3 |
$(eval TMPFILE := $(shell mktemp)) |
| 4 |
cp src/manifest.json $(TMPFILE) |
| 5 |
./scripts/patch_manifest.py src/manifest.json set update_url http://localhost:9999/updates.xml |
| 6 |
google-chrome --pack-extension=./src --pack-extension-key=./release-utils/dummy-chromium.pem |
| 7 |
mv src.crx release-utils/privacy-badger.crx |
| 8 |
mv $(TMPFILE) src/manifest.json |
| 9 |
|
| 10 |
lint: |
| 11 |
./node_modules/.bin/eslint . |
| 12 |
|
| 13 |
minimages: |
| 14 |
npx @j9t/[email protected] |
| 15 |
|
| 16 |
updatepsl: |
| 17 |
scripts/updatepsl.sh |
| 18 |
|
| 19 |
updateseed: |
| 20 |
scripts/updateseeddata.sh |
| 21 |
|
| 22 |
apply_effdntlist: |
| 23 |
scripts/apply_effdntlist.py src/data/seed.json |
| 24 |
|
| 25 |
updategoogle: |
| 26 |
scripts/updategoogle.sh |
| 27 |
|
| 28 |
updatecnames: |
| 29 |
scripts/updatecnames.sh |
| 30 |
|
| 31 |
upload: |
| 32 |
# pbconfig |
| 33 |
cp src/data/pbconfig.json ../privacybadger_assets/files/pbconfig.json |
| 34 |
# DNT policy hashes (legacy) |
| 35 |
$(eval HASHES_TMP := $(shell mktemp)) |
| 36 |
python -c 'import json,sys; print(json.dumps(json.load(sys.stdin)["dnt_policy_hashes"]))' < src/data/pbconfig.json > $(HASHES_TMP) |
| 37 |
cp $(HASHES_TMP) ../privacybadger_assets/files/dnt-policies.json |
| 38 |
rm $(HASHES_TMP) |
| 39 |
# yellowlist (legacy) |
| 40 |
$(eval YLIST_TMP := $(shell mktemp)) |
| 41 |
python -c 'import json,sys; print("\n".join(json.load(sys.stdin)["yellowlist"]))' < src/data/pbconfig.json > $(YLIST_TMP) |
| 42 |
cp $(YLIST_TMP) ../privacybadger_assets/files/cookieblocklist_new.txt |
| 43 |
# yellowlist (very legacy) |
| 44 |
$(eval OLD_YLIST_TMP := $(shell mktemp)) |
| 45 |
scripts/generate-legacy-yellowlist.sh $(YLIST_TMP) > $(OLD_YLIST_TMP) |
| 46 |
cp $(OLD_YLIST_TMP) ../privacybadger_assets/files/cookieblocklist.txt |
| 47 |
rm $(OLD_YLIST_TMP) |
| 48 |
rm $(YLIST_TMP) |
| 49 |
|
| 50 |
# get the Transifex CLI client from https://github.com/transifex/cli/releases/latest |
| 51 |
tx: |
| 52 |
tx pull -f |
| 53 |
scripts/fix_placeholders.py |
| 54 |
|
| 55 |
runch: |
| 56 |
./node_modules/.bin/web-ext run --target chromium --arg="--disable-component-update" --arg="--disable-blink-features=AutomationControlled" --arg="--enable-features=AllowLegacyMV2Extensions" --start-url "chrome://extensions" -s src/ |
| 57 |
|
| 58 |
runfa: |
| 59 |
./node_modules/.bin/web-ext run -s src/ --target firefox-android --adb-bin $$ADB_BIN --android-device $$ANDROID_DEVICE_ID --firefox-apk org.mozilla.firefox --verbose |
| 60 |
|
| 61 |
runff: |
| 62 |
./node_modules/.bin/web-ext run --start-url "about:debugging#/runtime/this-firefox" -s src/ |
| 63 |
|
| 64 |
runfn: |
| 65 |
./node_modules/.bin/web-ext run --start-url "about:debugging#/runtime/this-firefox" -s src/ -f nightly |
| 66 |
|
| 67 |
test: |
| 68 |
BROWSER=chrome ENABLE_XVFB=1 pytest -s tests/ |
| 69 |
|
| 70 |
.PHONY: crx lint minimages updatepsl updateseed apply_effdntlist updategoogle updatecnames tx runch runfa runff runfn test |