Skip to content

Commit 1ab692c

Browse files
authored
Replace FLOC with browsingTopics (#17)
* Replace FLOC with browsingTopics * Add FLEDGE
1 parent b0604d6 commit 1ab692c

File tree

7 files changed

+95
-35
lines changed

7 files changed

+95
-35
lines changed

build/apple/contentScope.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@
914914
case './features/fingerprinting-hardware.js': return Promise.resolve().then(function () { return fingerprintingHardware; });
915915
case './features/fingerprinting-screen-size.js': return Promise.resolve().then(function () { return fingerprintingScreenSize; });
916916
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
917-
case './features/floc.js': return Promise.resolve().then(function () { return floc; });
917+
case './features/google-rejected.js': return Promise.resolve().then(function () { return googleRejected; });
918918
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
919919
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
920920
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
@@ -951,7 +951,7 @@
951951
'fingerprintingCanvas',
952952
'trackingCookies3p',
953953
'trackingCookies1p',
954-
'floc',
954+
'googleRejected',
955955
'gpc',
956956
'fingerprintingHardware',
957957
'referrer',
@@ -2532,16 +2532,31 @@
25322532
});
25332533

25342534
function init$6 () {
2535-
if ('interestCohort' in Document.prototype) {
2536-
try {
2537-
delete Document.prototype.interestCohort;
2538-
} catch {
2539-
// Throw away this exception, it's likely a confict with another extension
2535+
try {
2536+
if ('browsingTopics' in Document.prototype) {
2537+
delete Document.prototype.browsingTopics;
2538+
}
2539+
if ('joinAdInterestGroup' in Navigator.prototype) {
2540+
delete Navigator.prototype.joinAdInterestGroup;
2541+
}
2542+
if ('leaveAdInterestGroup' in Navigator.prototype) {
2543+
delete Navigator.prototype.leaveAdInterestGroup;
25402544
}
2545+
if ('updateAdInterestGroup' in Navigator.prototype) {
2546+
delete Navigator.prototype.updateAdInterestGroup;
2547+
}
2548+
if ('runAdAuction' in Navigator.prototype) {
2549+
delete Navigator.prototype.runAdAuction;
2550+
}
2551+
if ('adAuctionComponents' in Navigator.prototype) {
2552+
delete Navigator.prototype.adAuctionComponents;
2553+
}
2554+
} catch {
2555+
// Throw away this exception, it's likely a confict with another extension
25412556
}
25422557
}
25432558

2544-
var floc = /*#__PURE__*/Object.freeze({
2559+
var googleRejected = /*#__PURE__*/Object.freeze({
25452560
__proto__: null,
25462561
init: init$6
25472562
});

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.

build/firefox/inject.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@
881881
case './features/fingerprinting-hardware.js': return Promise.resolve().then(function () { return fingerprintingHardware; });
882882
case './features/fingerprinting-screen-size.js': return Promise.resolve().then(function () { return fingerprintingScreenSize; });
883883
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
884-
case './features/floc.js': return Promise.resolve().then(function () { return floc; });
884+
case './features/google-rejected.js': return Promise.resolve().then(function () { return googleRejected; });
885885
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
886886
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
887887
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
@@ -918,7 +918,7 @@
918918
'fingerprintingCanvas',
919919
'trackingCookies3p',
920920
'trackingCookies1p',
921-
'floc',
921+
'googleRejected',
922922
'gpc',
923923
'fingerprintingHardware',
924924
'referrer',
@@ -2499,16 +2499,31 @@
24992499
});
25002500

25012501
function init$6 () {
2502-
if ('interestCohort' in Document.prototype) {
2503-
try {
2504-
delete Document.prototype.interestCohort;
2505-
} catch {
2506-
// Throw away this exception, it's likely a confict with another extension
2502+
try {
2503+
if ('browsingTopics' in Document.prototype) {
2504+
delete Document.prototype.browsingTopics;
2505+
}
2506+
if ('joinAdInterestGroup' in Navigator.prototype) {
2507+
delete Navigator.prototype.joinAdInterestGroup;
2508+
}
2509+
if ('leaveAdInterestGroup' in Navigator.prototype) {
2510+
delete Navigator.prototype.leaveAdInterestGroup;
25072511
}
2512+
if ('updateAdInterestGroup' in Navigator.prototype) {
2513+
delete Navigator.prototype.updateAdInterestGroup;
2514+
}
2515+
if ('runAdAuction' in Navigator.prototype) {
2516+
delete Navigator.prototype.runAdAuction;
2517+
}
2518+
if ('adAuctionComponents' in Navigator.prototype) {
2519+
delete Navigator.prototype.adAuctionComponents;
2520+
}
2521+
} catch {
2522+
// Throw away this exception, it's likely a confict with another extension
25082523
}
25092524
}
25102525

2511-
var floc = /*#__PURE__*/Object.freeze({
2526+
var googleRejected = /*#__PURE__*/Object.freeze({
25122527
__proto__: null,
25132528
init: init$6
25142529
});

build/integration/contentScope.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@
865865
case './features/fingerprinting-hardware.js': return Promise.resolve().then(function () { return fingerprintingHardware; });
866866
case './features/fingerprinting-screen-size.js': return Promise.resolve().then(function () { return fingerprintingScreenSize; });
867867
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
868-
case './features/floc.js': return Promise.resolve().then(function () { return floc; });
868+
case './features/google-rejected.js': return Promise.resolve().then(function () { return googleRejected; });
869869
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
870870
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
871871
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
@@ -902,7 +902,7 @@
902902
'fingerprintingCanvas',
903903
'trackingCookies3p',
904904
'trackingCookies1p',
905-
'floc',
905+
'googleRejected',
906906
'gpc',
907907
'fingerprintingHardware',
908908
'referrer',
@@ -2483,16 +2483,31 @@
24832483
});
24842484

24852485
function init$6 () {
2486-
if ('interestCohort' in Document.prototype) {
2487-
try {
2488-
delete Document.prototype.interestCohort;
2489-
} catch {
2490-
// Throw away this exception, it's likely a confict with another extension
2486+
try {
2487+
if ('browsingTopics' in Document.prototype) {
2488+
delete Document.prototype.browsingTopics;
2489+
}
2490+
if ('joinAdInterestGroup' in Navigator.prototype) {
2491+
delete Navigator.prototype.joinAdInterestGroup;
2492+
}
2493+
if ('leaveAdInterestGroup' in Navigator.prototype) {
2494+
delete Navigator.prototype.leaveAdInterestGroup;
24912495
}
2496+
if ('updateAdInterestGroup' in Navigator.prototype) {
2497+
delete Navigator.prototype.updateAdInterestGroup;
2498+
}
2499+
if ('runAdAuction' in Navigator.prototype) {
2500+
delete Navigator.prototype.runAdAuction;
2501+
}
2502+
if ('adAuctionComponents' in Navigator.prototype) {
2503+
delete Navigator.prototype.adAuctionComponents;
2504+
}
2505+
} catch {
2506+
// Throw away this exception, it's likely a confict with another extension
24922507
}
24932508
}
24942509

2495-
var floc = /*#__PURE__*/Object.freeze({
2510+
var googleRejected = /*#__PURE__*/Object.freeze({
24962511
__proto__: null,
24972512
init: init$6
24982513
});

src/content-scope-features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function load () {
2626
'fingerprintingCanvas',
2727
'trackingCookies3p',
2828
'trackingCookies1p',
29-
'floc',
29+
'googleRejected',
3030
'gpc',
3131
'fingerprintingHardware',
3232
'referrer',

src/features/floc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/features/google-rejected.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export function init () {
2+
try {
3+
if ('browsingTopics' in Document.prototype) {
4+
delete Document.prototype.browsingTopics
5+
}
6+
if ('joinAdInterestGroup' in Navigator.prototype) {
7+
delete Navigator.prototype.joinAdInterestGroup
8+
}
9+
if ('leaveAdInterestGroup' in Navigator.prototype) {
10+
delete Navigator.prototype.leaveAdInterestGroup
11+
}
12+
if ('updateAdInterestGroup' in Navigator.prototype) {
13+
delete Navigator.prototype.updateAdInterestGroup
14+
}
15+
if ('runAdAuction' in Navigator.prototype) {
16+
delete Navigator.prototype.runAdAuction
17+
}
18+
if ('adAuctionComponents' in Navigator.prototype) {
19+
delete Navigator.prototype.adAuctionComponents
20+
}
21+
} catch {
22+
// Throw away this exception, it's likely a confict with another extension
23+
}
24+
}

0 commit comments

Comments
 (0)