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

Fix the TrackerDB metainformation domain lookup #1889

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

philipp-classen
Copy link
Member

@philipp-classen philipp-classen commented Sep 18, 2024

Include also the subdomain information when doing a TrackerDB lookup.

For instance, the request to
https://global.ketchcdn.com/web/v3/config/avant/website_smart_tag/boot.js has
hostname=global.ketchcdn.com and domain=ketchcdn.com

The current TrackerDB entry is for "global.ketchcdn.com", so the lookup by domain does not return a result. The adblocker implementation will still do a lookup for the parent domain. So, it will also try out "ketchcdn.com". Because of that, there should be no need to fallback to the (parent) domain in the extension.

Test page: https://www.avantassessment.com/

This is the lookup code in the adblocker: https://github.com/ghostery/adblocker/blob/5f04d7ae0cdbdfd569ed8a9bcd14cf916f026aa1/packages/adblocker/src/engine/metadata.ts#L173

It will start with the most specific subdomain and work its way up. So, the caller can safely pass the subdomain; it will still do the lookup for the parent.

@philipp-classen philipp-classen added the Bug Something isn't working label Sep 18, 2024
For instance, the request to
https://global.ketchcdn.com/web/v3/config/avant/website_smart_tag/boot.js
has
hostname=global.ketchcdn.com and domain=ketchcdn.com

The current TrackerDB entry is for "global.ketchcdn.com", so the lookup
by domain does not return a result. The adblocker implementation will
still do a lookup for the parent domain. So, it will also try out
"ketchcdn.com". Because of that, there should be no need to fallback
to the (parent) domain in the extension.
@philipp-classen philipp-classen force-pushed the use_full_domain_for_trackerdb_matching branch from d07fb56 to 7347ff4 Compare September 18, 2024 16:57
@chrmod chrmod merged commit 0336733 into main Sep 18, 2024
2 checks passed
@chrmod chrmod deleted the use_full_domain_for_trackerdb_matching branch September 18, 2024 18:03
@smalluban smalluban mentioned this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants