Skip to content

Commit a4d5a25

Browse files
Add navigatorCredentials (#5)
1 parent 343b122 commit a4d5a25

File tree

6 files changed

+147
-56
lines changed

6 files changed

+147
-56
lines changed

build/apple/contentScope.js

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ var contentScopeFeatures = (function (exports) {
857857
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
858858
case './features/floc.js': return Promise.resolve().then(function () { return floc; });
859859
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
860+
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
860861
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
861862
case './features/referrer.js': return Promise.resolve().then(function () { return referrer; });
862863
case './features/tracking-cookies-1p.js': return Promise.resolve().then(function () { return trackingCookies1p; });
@@ -897,7 +898,8 @@ var contentScopeFeatures = (function (exports) {
897898
'referrer',
898899
'fingerprintingScreenSize',
899900
'fingerprintingTemporaryStorage',
900-
'navigatorInterface'
901+
'navigatorInterface',
902+
'navigatorCredentials'
901903
];
902904

903905
for (const featureName of featureNames) {
@@ -912,7 +914,7 @@ var contentScopeFeatures = (function (exports) {
912914
}
913915
}
914916

915-
async function init$c (args) {
917+
async function init$d (args) {
916918
initArgs = args;
917919
if (!shouldRun()) {
918920
return
@@ -951,7 +953,7 @@ var contentScopeFeatures = (function (exports) {
951953
});
952954
}
953955

954-
function init$b (args) {
956+
function init$c (args) {
955957
const { sessionKey, site } = args;
956958
const domainKey = site.domain;
957959
const featureName = 'fingerprinting-audio';
@@ -1056,15 +1058,15 @@ var contentScopeFeatures = (function (exports) {
10561058

10571059
var fingerprintingAudio = /*#__PURE__*/Object.freeze({
10581060
__proto__: null,
1059-
init: init$b
1061+
init: init$c
10601062
});
10611063

10621064
/**
10631065
* Overwrites the Battery API if present in the browser.
10641066
* It will return the values defined in the getBattery function to the client,
10651067
* as well as prevent any script from listening to events.
10661068
*/
1067-
function init$a (args) {
1069+
function init$b (args) {
10681070
if (navigator.getBattery) {
10691071
const spoofedValues = {
10701072
charging: true,
@@ -1089,7 +1091,7 @@ var contentScopeFeatures = (function (exports) {
10891091

10901092
var fingerprintingBattery = /*#__PURE__*/Object.freeze({
10911093
__proto__: null,
1092-
init: init$a
1094+
init: init$b
10931095
});
10941096

10951097
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -2165,7 +2167,7 @@ var contentScopeFeatures = (function (exports) {
21652167
return false
21662168
}
21672169

2168-
function init$9 (args) {
2170+
function init$a (args) {
21692171
const { sessionKey, site } = args;
21702172
const domainKey = site.domain;
21712173
const featureName = 'fingerprinting-canvas';
@@ -2280,10 +2282,10 @@ var contentScopeFeatures = (function (exports) {
22802282

22812283
var fingerprintingCanvas = /*#__PURE__*/Object.freeze({
22822284
__proto__: null,
2283-
init: init$9
2285+
init: init$a
22842286
});
22852287

2286-
function init$8 (args) {
2288+
function init$9 (args) {
22872289
overrideProperty('keyboard', {
22882290
object: Navigator.prototype,
22892291
origValue: navigator.keyboard,
@@ -2303,7 +2305,7 @@ var contentScopeFeatures = (function (exports) {
23032305

23042306
var fingerprintingHardware = /*#__PURE__*/Object.freeze({
23052307
__proto__: null,
2306-
init: init$8
2308+
init: init$9
23072309
});
23082310

23092311
/**
@@ -2385,7 +2387,7 @@ var contentScopeFeatures = (function (exports) {
23852387
}
23862388
}
23872389

2388-
function init$7 (args) {
2390+
function init$8 (args) {
23892391
origPropertyValues.availTop = overrideProperty('availTop', {
23902392
object: Screen.prototype,
23912393
origValue: screen.availTop,
@@ -2425,10 +2427,10 @@ var contentScopeFeatures = (function (exports) {
24252427

24262428
var fingerprintingScreenSize = /*#__PURE__*/Object.freeze({
24272429
__proto__: null,
2428-
init: init$7
2430+
init: init$8
24292431
});
24302432

2431-
function init$6 () {
2433+
function init$7 () {
24322434
/**
24332435
* Temporary storage can be used to determine hard disk usage and size.
24342436
* This will limit the max storage to 4GB without completely disabling the
@@ -2453,10 +2455,10 @@ var contentScopeFeatures = (function (exports) {
24532455

24542456
var fingerprintingTemporaryStorage = /*#__PURE__*/Object.freeze({
24552457
__proto__: null,
2456-
init: init$6
2458+
init: init$7
24572459
});
24582460

2459-
function init$5 () {
2461+
function init$6 () {
24602462
if ('interestCohort' in Document.prototype) {
24612463
try {
24622464
delete Document.prototype.interestCohort;
@@ -2468,11 +2470,11 @@ var contentScopeFeatures = (function (exports) {
24682470

24692471
var floc = /*#__PURE__*/Object.freeze({
24702472
__proto__: null,
2471-
init: init$5
2473+
init: init$6
24722474
});
24732475

24742476
// Set Global Privacy Control property on DOM
2475-
function init$4 (args) {
2477+
function init$5 (args) {
24762478
try {
24772479
// If GPC on, set DOM property prototype to true if not already true
24782480
if (args.globalPrivacyControlValue) {
@@ -2498,6 +2500,28 @@ var contentScopeFeatures = (function (exports) {
24982500
}
24992501

25002502
var gpc = /*#__PURE__*/Object.freeze({
2503+
__proto__: null,
2504+
init: init$5
2505+
});
2506+
2507+
function init$4 (args) {
2508+
try {
2509+
const value = {
2510+
get () {
2511+
return Promise.reject(new Error())
2512+
}
2513+
};
2514+
defineProperty(Navigator.prototype, 'credentials', {
2515+
value,
2516+
configurable: true,
2517+
enumerable: true
2518+
});
2519+
} catch {
2520+
// Ignore exceptions that could be caused by conflicting with other extensions
2521+
}
2522+
}
2523+
2524+
var navigatorCredentials = /*#__PURE__*/Object.freeze({
25012525
__proto__: null,
25022526
init: init$4
25032527
});
@@ -2797,7 +2821,7 @@ var contentScopeFeatures = (function (exports) {
27972821
init: init
27982822
});
27992823

2800-
exports.init = init$c;
2824+
exports.init = init$d;
28012825
exports.load = load$1;
28022826
exports.update = update$1;
28032827

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: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ var contentScopeFeatures = (function (exports) {
871871
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
872872
case './features/floc.js': return Promise.resolve().then(function () { return floc; });
873873
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
874+
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
874875
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
875876
case './features/referrer.js': return Promise.resolve().then(function () { return referrer; });
876877
case './features/tracking-cookies-1p.js': return Promise.resolve().then(function () { return trackingCookies1p; });
@@ -911,7 +912,8 @@ var contentScopeFeatures = (function (exports) {
911912
'referrer',
912913
'fingerprintingScreenSize',
913914
'fingerprintingTemporaryStorage',
914-
'navigatorInterface'
915+
'navigatorInterface',
916+
'navigatorCredentials'
915917
];
916918

917919
for (const featureName of featureNames) {
@@ -926,7 +928,7 @@ var contentScopeFeatures = (function (exports) {
926928
}
927929
}
928930

929-
async function init$c (args) {
931+
async function init$d (args) {
930932
initArgs = args;
931933
if (!shouldRun()) {
932934
return
@@ -965,7 +967,7 @@ var contentScopeFeatures = (function (exports) {
965967
});
966968
}
967969

968-
function init$b (args) {
970+
function init$c (args) {
969971
const { sessionKey, site } = args;
970972
const domainKey = site.domain;
971973
const featureName = 'fingerprinting-audio';
@@ -1070,15 +1072,15 @@ var contentScopeFeatures = (function (exports) {
10701072

10711073
var fingerprintingAudio = /*#__PURE__*/Object.freeze({
10721074
__proto__: null,
1073-
init: init$b
1075+
init: init$c
10741076
});
10751077

10761078
/**
10771079
* Overwrites the Battery API if present in the browser.
10781080
* It will return the values defined in the getBattery function to the client,
10791081
* as well as prevent any script from listening to events.
10801082
*/
1081-
function init$a (args) {
1083+
function init$b (args) {
10821084
if (navigator.getBattery) {
10831085
const spoofedValues = {
10841086
charging: true,
@@ -1103,7 +1105,7 @@ var contentScopeFeatures = (function (exports) {
11031105

11041106
var fingerprintingBattery = /*#__PURE__*/Object.freeze({
11051107
__proto__: null,
1106-
init: init$a
1108+
init: init$b
11071109
});
11081110

11091111
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -2179,7 +2181,7 @@ var contentScopeFeatures = (function (exports) {
21792181
return false
21802182
}
21812183

2182-
function init$9 (args) {
2184+
function init$a (args) {
21832185
const { sessionKey, site } = args;
21842186
const domainKey = site.domain;
21852187
const featureName = 'fingerprinting-canvas';
@@ -2294,10 +2296,10 @@ var contentScopeFeatures = (function (exports) {
22942296

22952297
var fingerprintingCanvas = /*#__PURE__*/Object.freeze({
22962298
__proto__: null,
2297-
init: init$9
2299+
init: init$a
22982300
});
22992301

2300-
function init$8 (args) {
2302+
function init$9 (args) {
23012303
overrideProperty('keyboard', {
23022304
object: Navigator.prototype,
23032305
origValue: navigator.keyboard,
@@ -2317,7 +2319,7 @@ var contentScopeFeatures = (function (exports) {
23172319

23182320
var fingerprintingHardware = /*#__PURE__*/Object.freeze({
23192321
__proto__: null,
2320-
init: init$8
2322+
init: init$9
23212323
});
23222324

23232325
/**
@@ -2399,7 +2401,7 @@ var contentScopeFeatures = (function (exports) {
23992401
}
24002402
}
24012403

2402-
function init$7 (args) {
2404+
function init$8 (args) {
24032405
origPropertyValues.availTop = overrideProperty('availTop', {
24042406
object: Screen.prototype,
24052407
origValue: screen.availTop,
@@ -2439,10 +2441,10 @@ var contentScopeFeatures = (function (exports) {
24392441

24402442
var fingerprintingScreenSize = /*#__PURE__*/Object.freeze({
24412443
__proto__: null,
2442-
init: init$7
2444+
init: init$8
24432445
});
24442446

2445-
function init$6 () {
2447+
function init$7 () {
24462448
/**
24472449
* Temporary storage can be used to determine hard disk usage and size.
24482450
* This will limit the max storage to 4GB without completely disabling the
@@ -2467,10 +2469,10 @@ var contentScopeFeatures = (function (exports) {
24672469

24682470
var fingerprintingTemporaryStorage = /*#__PURE__*/Object.freeze({
24692471
__proto__: null,
2470-
init: init$6
2472+
init: init$7
24712473
});
24722474

2473-
function init$5 () {
2475+
function init$6 () {
24742476
if ('interestCohort' in Document.prototype) {
24752477
try {
24762478
delete Document.prototype.interestCohort;
@@ -2482,11 +2484,11 @@ var contentScopeFeatures = (function (exports) {
24822484

24832485
var floc = /*#__PURE__*/Object.freeze({
24842486
__proto__: null,
2485-
init: init$5
2487+
init: init$6
24862488
});
24872489

24882490
// Set Global Privacy Control property on DOM
2489-
function init$4 (args) {
2491+
function init$5 (args) {
24902492
try {
24912493
// If GPC on, set DOM property prototype to true if not already true
24922494
if (args.globalPrivacyControlValue) {
@@ -2512,6 +2514,28 @@ var contentScopeFeatures = (function (exports) {
25122514
}
25132515

25142516
var gpc = /*#__PURE__*/Object.freeze({
2517+
__proto__: null,
2518+
init: init$5
2519+
});
2520+
2521+
function init$4 (args) {
2522+
try {
2523+
const value = {
2524+
get () {
2525+
return Promise.reject(new Error())
2526+
}
2527+
};
2528+
defineProperty(Navigator.prototype, 'credentials', {
2529+
value,
2530+
configurable: true,
2531+
enumerable: true
2532+
});
2533+
} catch {
2534+
// Ignore exceptions that could be caused by conflicting with other extensions
2535+
}
2536+
}
2537+
2538+
var navigatorCredentials = /*#__PURE__*/Object.freeze({
25152539
__proto__: null,
25162540
init: init$4
25172541
});
@@ -2811,7 +2835,7 @@ var contentScopeFeatures = (function (exports) {
28112835
init: init
28122836
});
28132837

2814-
exports.init = init$c;
2838+
exports.init = init$d;
28152839
exports.load = load$1;
28162840
exports.update = update$1;
28172841

0 commit comments

Comments
 (0)