Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove build tooling for static declarativeNetRequest rulesets #2505

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ cd -
npm run bundle-config
```

### Updating the MV3 blocklists

Manifest v3 (MV3) builds of the extension contain bundled static declarativeNetRequest rulesets and corresponding block lists for Tracker Blocking. Both the default (aka current)
and a fallback blocklist are included. The fallback blocklist serves as a backup in case the current blocklist is catastrophically broken. To ensure that builds are reproducible,
the current and fallback blocklist versions are defined in `shared/data/etags.json`. The blocklists are fetched and rulesets generated automatically when the extension is built.

To update the blocklist versions, use the `npm run update-mv3-blocklists` command. Remember to then commit the changes to `shared/data/etags.json` and rebuild the extension.

**Note: The migration to static Tracker Blocking rulesets is in progress. They are not created or used, but will be soon.**

### Development flow

The `shared` directory contains JS, CSS, and images that are shared by all browsers for things like the options
Expand Down
35 changes: 0 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -296,41 +296,6 @@ ifeq ('$(browser)','chrome-mv3')
BUILD_TARGETS += $(BUILD_DIR)/data/bundled/smarter-encryption-rules.json
endif

## Generate Tracker Blocking declarativeNetRequest rulesets for MV3 builds.

# Necessary since "&:" grouped target syntax is not supported currently with
# versions (< 4.3) of Make shipped with macOS. See $(LAST_COPY) comment above
# for more context.
LAST_MV3_BLOCKLIST_FETCH = build/.last-mv3-blocklist-fetch
LAST_MV3_RULESET_BUILD = build/.last-mv3-ruleset-build-$(browser)-$(type)

$(LAST_MV3_BLOCKLIST_FETCH): shared/data/etags.json
node scripts/fetchMV3Blocklists.mjs
touch $@

.SECONDARY:
$(INTERMEDIATES_DIR)/current-mv3-tds.json $(INTERMEDIATES_DIR)/fallback-mv3-tds.json: $(LAST_MV3_BLOCKLIST_FETCH)
touch $@

$(BUILD_DIR)/data/bundled/current-mv3-tds.json: $(INTERMEDIATES_DIR)/current-mv3-tds.json
cp $< $@

$(BUILD_DIR)/data/bundled/fallback-mv3-tds.json: $(INTERMEDIATES_DIR)/fallback-mv3-tds.json
cp $< $@

$(LAST_MV3_RULESET_BUILD): $(INTERMEDIATES_DIR)/current-mv3-tds.json $(INTERMEDIATES_DIR)/fallback-mv3-tds.json $(INTERMEDIATES_DIR)/surrogates.json
npx ddg2dnr tds $(INTERMEDIATES_DIR)/current-mv3-tds.json $(INTERMEDIATES_DIR)/surrogates.json \
$(BUILD_DIR)/data/bundled/current-tds-rules.json $(BUILD_DIR)/data/bundled/current-ctl-allowing-rules.json
npx ddg2dnr tds $(INTERMEDIATES_DIR)/fallback-mv3-tds.json $(INTERMEDIATES_DIR)/surrogates.json \
$(BUILD_DIR)/data/bundled/fallback-tds-rules.json $(BUILD_DIR)/data/bundled/fallback-ctl-allowing-rules.json
touch $@

# TODO: Uncomment this for the switch to static tracker blocking declarativeNetRequest rulesets.
# ifeq ('$(browser)','chrome-mv3')
# BUILD_TARGETS += $(LAST_MV3_RULESET_BUILD)
# BUILD_TARGETS += $(BUILD_DIR)/data/bundled/current-mv3-tds.json $(BUILD_DIR)/data/bundled/fallback-mv3-tds.json
# endif

# Generate the list of "surrogate" (stub) scripts.
$(BUILD_DIR)/data/surrogates.txt: $(BUILD_DIR)/web_accessible_resources $(LAST_COPY)
node scripts/generateListOfSurrogates.js -i $</ > $@
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"beta-firefox": "make beta-firefox browser=firefox type=release",
"release-chrome": "make browser=chrome type=release && make chrome-release-zip",
"release-chrome-mv3": "make browser=chrome-mv3 type=release && make chrome-mv3-release-zip",
"beta-chrome-mv3": "make chrome-mv3-beta browser=chrome-mv3 type=release",
"update-mv3-blocklists": "node scripts/updateMV3Blocklists.mjs"
"beta-chrome-mv3": "make chrome-mv3-beta browser=chrome-mv3 type=release"
},
"devDependencies": {
"@fingerprintjs/fingerprintjs": "^4.2.2",
Expand Down
47 changes: 0 additions & 47 deletions scripts/fetchMV3Blocklists.mjs

This file was deleted.

52 changes: 0 additions & 52 deletions scripts/updateMV3Blocklists.mjs

This file was deleted.

Loading