Skip to content

Commit 83f6c0b

Browse files
Add platform check to cookie code (#161)
1 parent 11f8fb9 commit 83f6c0b

File tree

16 files changed

+103
-29
lines changed

16 files changed

+103
-29
lines changed

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@
18461846
const updates = [];
18471847
const features = [];
18481848

1849-
async function load$1 () {
1849+
async function load$1 (args) {
18501850
if (!shouldRun()) {
18511851
return
18521852
}
@@ -1870,7 +1870,7 @@
18701870
const filename = featureName.replace(/([a-zA-Z])(?=[A-Z0-9])/g, '$1-').toLowerCase();
18711871
const feature = __variableDynamicImportRuntime0__(`./features/${filename}.js`).then(({ init, load, update }) => {
18721872
if (load) {
1873-
load();
1873+
load(args);
18741874
}
18751875
return { featureName, init, update }
18761876
});
@@ -2135,6 +2135,10 @@
21352135
}
21362136

21372137
function load (args) {
2138+
// Feature is only relevant to the extension, we should skip for other platforms for now as the config testing is broken.
2139+
if (args.platform.name !== 'extension') {
2140+
return
2141+
}
21382142
trackerHosts.clear();
21392143

21402144
// The cookie policy is injected into every frame immediately so that no cookie will
@@ -4466,7 +4470,9 @@
44664470
return
44674471
}
44684472

4469-
contentScopeFeatures.load();
4473+
contentScopeFeatures.load({
4474+
platform: processedConfig.platform
4475+
});
44704476

44714477
contentScopeFeatures.init(processedConfig);
44724478

build/android/contentScope.js

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/chrome-mv3/inject.js

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/chrome/inject.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/firefox/inject.js

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/integration/contentScope.js

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/windows/contentScope.js

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inject/android.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ function init () {
88
return
99
}
1010

11-
contentScopeFeatures.load()
11+
contentScopeFeatures.load({
12+
platform: processedConfig.platform
13+
})
1214

1315
contentScopeFeatures.init(processedConfig)
1416

inject/apple.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ function init () {
88
return
99
}
1010

11-
contentScopeFeatures.load()
11+
contentScopeFeatures.load({
12+
platform: processedConfig.platform
13+
})
1214

1315
contentScopeFeatures.init(processedConfig)
1416

inject/chrome-mv3.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
const secret = window.crypto.randomUUID()
44

5-
contentScopeFeatures.load()
5+
contentScopeFeatures.load({
6+
platform: {
7+
name: 'extension'
8+
}
9+
})
610

711
window.addEventListener(secret, ({ detail: message }) => {
812
if (!message) return

0 commit comments

Comments
 (0)