Skip to content

Conditionally load tracker lookup data #477

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

Merged
merged 1 commit into from
Apr 27, 2023
Merged
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
8 changes: 6 additions & 2 deletions scripts/utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ export async function rollupScript (params) {
supportsMozProxies = false
} = params

const trackerLookupData = readFileSync('./build/tracker-lookup.json', 'utf8')
const extensions = ['firefox', 'chrome', 'chrome-mv3']
const trackerLookup = extensions.includes(platform) ? '$TRACKER_LOOKUP$' : trackerLookupData
const isExtension = extensions.includes(platform)
let trackerLookup = '$TRACKER_LOOKUP$'
if (!isExtension) {
const trackerLookupData = readFileSync('./build/tracker-lookup.json', 'utf8')
trackerLookup = trackerLookupData
}
// The code is using a global, that we define here which means once tree shaken we get a browser specific output.
const mozProxies = supportsMozProxies
const plugins = [
Expand Down