Skip to content

Commit 8a34279

Browse files
authored
Add nonTracking3pCookies script (#72)
1 parent d112cfb commit 8a34279

File tree

7 files changed

+256
-198
lines changed

7 files changed

+256
-198
lines changed

build/apple/contentScope.js

Lines changed: 81 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@
955955
case './features/google-rejected.js': return Promise.resolve().then(function () { return googleRejected; });
956956
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
957957
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
958+
case './features/non-tracking-3p-cookies.js': return Promise.resolve().then(function () { return nonTracking3pCookies; });
958959
case './features/referrer.js': return Promise.resolve().then(function () { return referrer; });
959960
case './features/tracking-cookies-1p.js': return Promise.resolve().then(function () { return trackingCookies1p; });
960961
case './features/tracking-cookies-3p.js': return Promise.resolve().then(function () { return trackingCookies3p; });
@@ -990,6 +991,7 @@
990991
'fingerprintingCanvas',
991992
'trackingCookies3p',
992993
'trackingCookies1p',
994+
'nonTracking3pCookies',
993995
'googleRejected',
994996
'gpc',
995997
'fingerprintingHardware',
@@ -1011,7 +1013,7 @@
10111013
}
10121014
}
10131015

1014-
async function init$d (args) {
1016+
async function init$e (args) {
10151017
initArgs = args;
10161018
if (!shouldRun()) {
10171019
return
@@ -1050,7 +1052,7 @@
10501052
});
10511053
}
10521054

1053-
function init$c (args) {
1055+
function init$d (args) {
10541056
const { sessionKey, site } = args;
10551057
const domainKey = site.domain;
10561058
const featureName = 'fingerprinting-audio';
@@ -1155,15 +1157,15 @@
11551157

11561158
var fingerprintingAudio = /*#__PURE__*/Object.freeze({
11571159
__proto__: null,
1158-
init: init$c
1160+
init: init$d
11591161
});
11601162

11611163
/**
11621164
* Overwrites the Battery API if present in the browser.
11631165
* It will return the values defined in the getBattery function to the client,
11641166
* as well as prevent any script from listening to events.
11651167
*/
1166-
function init$b (args) {
1168+
function init$c (args) {
11671169
if (globalThis.navigator.getBattery) {
11681170
const BatteryManager = globalThis.BatteryManager;
11691171

@@ -1190,7 +1192,7 @@
11901192

11911193
var fingerprintingBattery = /*#__PURE__*/Object.freeze({
11921194
__proto__: null,
1193-
init: init$b
1195+
init: init$c
11941196
});
11951197

11961198
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -2326,7 +2328,7 @@
23262328
return false
23272329
}
23282330

2329-
function init$a (args) {
2331+
function init$b (args) {
23302332
const { sessionKey, site } = args;
23312333
const domainKey = site.domain;
23322334
const featureName = 'fingerprinting-canvas';
@@ -2508,10 +2510,10 @@
25082510

25092511
var fingerprintingCanvas = /*#__PURE__*/Object.freeze({
25102512
__proto__: null,
2511-
init: init$a
2513+
init: init$b
25122514
});
25132515

2514-
function init$9 (args) {
2516+
function init$a (args) {
25152517
const Navigator = globalThis.Navigator;
25162518
const navigator = globalThis.navigator;
25172519

@@ -2534,7 +2536,7 @@
25342536

25352537
var fingerprintingHardware = /*#__PURE__*/Object.freeze({
25362538
__proto__: null,
2537-
init: init$9
2539+
init: init$a
25382540
});
25392541

25402542
/**
@@ -2619,7 +2621,7 @@
26192621
}
26202622
}
26212623

2622-
function init$8 (args) {
2624+
function init$9 (args) {
26232625
const Screen = globalThis.Screen;
26242626
const screen = globalThis.screen;
26252627

@@ -2662,10 +2664,10 @@
26622664

26632665
var fingerprintingScreenSize = /*#__PURE__*/Object.freeze({
26642666
__proto__: null,
2665-
init: init$8
2667+
init: init$9
26662668
});
26672669

2668-
function init$7 () {
2670+
function init$8 () {
26692671
const navigator = globalThis.navigator;
26702672
const Navigator = globalThis.Navigator;
26712673

@@ -2693,10 +2695,10 @@
26932695

26942696
var fingerprintingTemporaryStorage = /*#__PURE__*/Object.freeze({
26952697
__proto__: null,
2696-
init: init$7
2698+
init: init$8
26972699
});
26982700

2699-
function init$6 () {
2701+
function init$7 () {
27002702
try {
27012703
if ('browsingTopics' in Document.prototype) {
27022704
delete Document.prototype.browsingTopics;
@@ -2723,11 +2725,11 @@
27232725

27242726
var googleRejected = /*#__PURE__*/Object.freeze({
27252727
__proto__: null,
2726-
init: init$6
2728+
init: init$7
27272729
});
27282730

27292731
// Set Global Privacy Control property on DOM
2730-
function init$5 (args) {
2732+
function init$6 (args) {
27312733
try {
27322734
// If GPC on, set DOM property prototype to true if not already true
27332735
if (args.globalPrivacyControlValue) {
@@ -2754,10 +2756,10 @@
27542756

27552757
var gpc = /*#__PURE__*/Object.freeze({
27562758
__proto__: null,
2757-
init: init$5
2759+
init: init$6
27582760
});
27592761

2760-
function init$4 (args) {
2762+
function init$5 (args) {
27612763
try {
27622764
if (navigator.duckduckgo) {
27632765
return
@@ -2783,10 +2785,67 @@
27832785

27842786
var navigatorInterface = /*#__PURE__*/Object.freeze({
27852787
__proto__: null,
2788+
init: init$5
2789+
});
2790+
2791+
function blockCookies (debug) {
2792+
// disable setting cookies
2793+
defineProperty(globalThis.document, 'cookie', {
2794+
configurable: false,
2795+
set: function (value) {
2796+
if (debug) {
2797+
postDebugMessage('jscookie', {
2798+
action: 'block',
2799+
reason: 'tracker frame',
2800+
documentUrl: globalThis.document.location.href,
2801+
scriptOrigins: [],
2802+
value: value
2803+
});
2804+
}
2805+
},
2806+
get: () => {
2807+
if (debug) {
2808+
postDebugMessage('jscookie', {
2809+
action: 'block',
2810+
reason: 'tracker frame',
2811+
documentUrl: globalThis.document.location.href,
2812+
scriptOrigins: [],
2813+
value: 'getter'
2814+
});
2815+
}
2816+
return ''
2817+
}
2818+
});
2819+
}
2820+
2821+
function init$4 (args) {
2822+
args.cookie.debug = args.debug;
2823+
if (globalThis.top !== globalThis && args.cookie.isTrackerFrame && args.cookie.shouldBlockTrackerCookie && args.cookie.isThirdParty) {
2824+
// overrides expiry policy with blocking - only in subframes
2825+
blockCookies(args.debug);
2826+
}
2827+
}
2828+
2829+
var trackingCookies3p = /*#__PURE__*/Object.freeze({
2830+
__proto__: null,
2831+
blockCookies: blockCookies,
27862832
init: init$4
27872833
});
27882834

27892835
function init$3 (args) {
2836+
args.cookie.debug = args.debug;
2837+
if (globalThis.top !== globalThis && !args.cookie.isTrackerFrame && args.cookie.shouldBlockNonTrackerCookie && args.cookie.isThirdParty) {
2838+
// overrides expiry policy with blocking - only in subframes
2839+
blockCookies(args.debug);
2840+
}
2841+
}
2842+
2843+
var nonTracking3pCookies = /*#__PURE__*/Object.freeze({
2844+
__proto__: null,
2845+
init: init$3
2846+
});
2847+
2848+
function init$2 (args) {
27902849
// Unfortunately, we only have limited information about the referrer and current frame. A single
27912850
// page may load many requests and sub frames, all with different referrers. Since we
27922851
if (args.referrer && // make sure the referrer was set correctly
@@ -2812,7 +2871,7 @@
28122871

28132872
var referrer = /*#__PURE__*/Object.freeze({
28142873
__proto__: null,
2815-
init: init$3
2874+
init: init$2
28162875
});
28172876

28182877
class Cookie {
@@ -2990,7 +3049,7 @@
29903049
applyCookieExpiryPolicy();
29913050
}
29923051

2993-
function init$2 (args) {
3052+
function init$1 (args) {
29943053
args.cookie.debug = args.debug;
29953054
loadedPolicyResolve(args.cookie);
29963055
}
@@ -3004,53 +3063,10 @@
30043063
var trackingCookies1p = /*#__PURE__*/Object.freeze({
30053064
__proto__: null,
30063065
load: load,
3007-
init: init$2,
3066+
init: init$1,
30083067
update: update
30093068
});
30103069

3011-
function blockCookies (debug) {
3012-
// disable setting cookies
3013-
defineProperty(globalThis.document, 'cookie', {
3014-
configurable: false,
3015-
set: function (value) {
3016-
if (debug) {
3017-
postDebugMessage('jscookie', {
3018-
action: 'block',
3019-
reason: 'tracker frame',
3020-
documentUrl: globalThis.document.location.href,
3021-
scriptOrigins: [],
3022-
value: value
3023-
});
3024-
}
3025-
},
3026-
get: () => {
3027-
if (debug) {
3028-
postDebugMessage('jscookie', {
3029-
action: 'block',
3030-
reason: 'tracker frame',
3031-
documentUrl: globalThis.document.location.href,
3032-
scriptOrigins: [],
3033-
value: 'getter'
3034-
});
3035-
}
3036-
return ''
3037-
}
3038-
});
3039-
}
3040-
3041-
function init$1 (args) {
3042-
args.cookie.debug = args.debug;
3043-
if (globalThis.top !== globalThis && args.cookie.isTrackerFrame && args.cookie.shouldBlock && args.cookie.isThirdParty) {
3044-
// overrides expiry policy with blocking - only in subframes
3045-
blockCookies(args.debug);
3046-
}
3047-
}
3048-
3049-
var trackingCookies3p = /*#__PURE__*/Object.freeze({
3050-
__proto__: null,
3051-
init: init$1
3052-
});
3053-
30543070
/**
30553071
* Fixes incorrect sizing value for outerHeight and outerWidth
30563072
*/
@@ -3089,7 +3105,7 @@
30893105
init: init
30903106
});
30913107

3092-
exports.init = init$d;
3108+
exports.init = init$e;
30933109
exports.load = load$1;
30943110
exports.update = update$1;
30953111

build/chrome/inject.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)