Skip to content

Commit 89ccf8f

Browse files
Add window sizing fix for outerWidth and outerHeight (#52)
1 parent a7c6f41 commit 89ccf8f

File tree

6 files changed

+162
-97
lines changed

6 files changed

+162
-97
lines changed

build/apple/contentScope.js

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,11 @@
954954
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
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; });
957-
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
958957
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
959958
case './features/referrer.js': return Promise.resolve().then(function () { return referrer; });
960959
case './features/tracking-cookies-1p.js': return Promise.resolve().then(function () { return trackingCookies1p; });
961960
case './features/tracking-cookies-3p.js': return Promise.resolve().then(function () { return trackingCookies3p; });
961+
case './features/web-compat.js': return Promise.resolve().then(function () { return webCompat; });
962962
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));
963963
}
964964
}
@@ -984,6 +984,7 @@
984984
return
985985
}
986986
const featureNames = [
987+
'webCompat',
987988
'fingerprintingAudio',
988989
'fingerprintingBattery',
989990
'fingerprintingCanvas',
@@ -995,8 +996,7 @@
995996
'referrer',
996997
'fingerprintingScreenSize',
997998
'fingerprintingTemporaryStorage',
998-
'navigatorInterface',
999-
'navigatorCredentials'
999+
'navigatorInterface'
10001000
];
10011001

10021002
for (const featureName of featureNames) {
@@ -2758,28 +2758,6 @@
27582758
});
27592759

27602760
function init$4 (args) {
2761-
try {
2762-
const value = {
2763-
get () {
2764-
return Promise.reject(new Error())
2765-
}
2766-
};
2767-
defineProperty(Navigator.prototype, 'credentials', {
2768-
value,
2769-
configurable: true,
2770-
enumerable: true
2771-
});
2772-
} catch {
2773-
// Ignore exceptions that could be caused by conflicting with other extensions
2774-
}
2775-
}
2776-
2777-
var navigatorCredentials = /*#__PURE__*/Object.freeze({
2778-
__proto__: null,
2779-
init: init$4
2780-
});
2781-
2782-
function init$3 (args) {
27832761
try {
27842762
if (navigator.duckduckgo) {
27852763
return
@@ -2805,10 +2783,10 @@
28052783

28062784
var navigatorInterface = /*#__PURE__*/Object.freeze({
28072785
__proto__: null,
2808-
init: init$3
2786+
init: init$4
28092787
});
28102788

2811-
function init$2 (args) {
2789+
function init$3 (args) {
28122790
// Unfortunately, we only have limited information about the referrer and current frame. A single
28132791
// page may load many requests and sub frames, all with different referrers. Since we
28142792
if (args.referrer && // make sure the referrer was set correctly
@@ -2834,7 +2812,7 @@
28342812

28352813
var referrer = /*#__PURE__*/Object.freeze({
28362814
__proto__: null,
2837-
init: init$2
2815+
init: init$3
28382816
});
28392817

28402818
class Cookie {
@@ -3012,7 +2990,7 @@
30122990
applyCookieExpiryPolicy();
30132991
}
30142992

3015-
function init$1 (args) {
2993+
function init$2 (args) {
30162994
args.cookie.debug = args.debug;
30172995
loadedPolicyResolve(args.cookie);
30182996
}
@@ -3026,7 +3004,7 @@
30263004
var trackingCookies1p = /*#__PURE__*/Object.freeze({
30273005
__proto__: null,
30283006
load: load,
3029-
init: init$1,
3007+
init: init$2,
30303008
update: update
30313009
});
30323010

@@ -3060,7 +3038,7 @@
30603038
});
30613039
}
30623040

3063-
function init (args) {
3041+
function init$1 (args) {
30643042
args.cookie.debug = args.debug;
30653043
if (globalThis.top !== globalThis && args.cookie.isTrackerFrame && args.cookie.shouldBlock && args.cookie.isThirdParty) {
30663044
// overrides expiry policy with blocking - only in subframes
@@ -3069,6 +3047,44 @@
30693047
}
30703048

30713049
var trackingCookies3p = /*#__PURE__*/Object.freeze({
3050+
__proto__: null,
3051+
init: init$1
3052+
});
3053+
3054+
/**
3055+
* Fixes incorrect sizing value for outerHeight and outerWidth
3056+
*/
3057+
function windowSizingFix () {
3058+
window.outerHeight = window.innerHeight;
3059+
window.outerWidth = window.innerWidth;
3060+
}
3061+
3062+
/**
3063+
* Add missing navigator.credentials API
3064+
*/
3065+
function navigatorCredentialsFix () {
3066+
try {
3067+
const value = {
3068+
get () {
3069+
return Promise.reject(new Error())
3070+
}
3071+
};
3072+
defineProperty(Navigator.prototype, 'credentials', {
3073+
value,
3074+
configurable: true,
3075+
enumerable: true
3076+
});
3077+
} catch {
3078+
// Ignore exceptions that could be caused by conflicting with other extensions
3079+
}
3080+
}
3081+
3082+
function init () {
3083+
windowSizingFix();
3084+
navigatorCredentialsFix();
3085+
}
3086+
3087+
var webCompat = /*#__PURE__*/Object.freeze({
30723088
__proto__: null,
30733089
init: init
30743090
});

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: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,11 @@
923923
case './features/fingerprinting-temporary-storage.js': return Promise.resolve().then(function () { return fingerprintingTemporaryStorage; });
924924
case './features/google-rejected.js': return Promise.resolve().then(function () { return googleRejected; });
925925
case './features/gpc.js': return Promise.resolve().then(function () { return gpc; });
926-
case './features/navigator-credentials.js': return Promise.resolve().then(function () { return navigatorCredentials; });
927926
case './features/navigator-interface.js': return Promise.resolve().then(function () { return navigatorInterface; });
928927
case './features/referrer.js': return Promise.resolve().then(function () { return referrer; });
929928
case './features/tracking-cookies-1p.js': return Promise.resolve().then(function () { return trackingCookies1p; });
930929
case './features/tracking-cookies-3p.js': return Promise.resolve().then(function () { return trackingCookies3p; });
930+
case './features/web-compat.js': return Promise.resolve().then(function () { return webCompat; });
931931
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));
932932
}
933933
}
@@ -953,6 +953,7 @@
953953
return
954954
}
955955
const featureNames = [
956+
'webCompat',
956957
'fingerprintingAudio',
957958
'fingerprintingBattery',
958959
'fingerprintingCanvas',
@@ -964,8 +965,7 @@
964965
'referrer',
965966
'fingerprintingScreenSize',
966967
'fingerprintingTemporaryStorage',
967-
'navigatorInterface',
968-
'navigatorCredentials'
968+
'navigatorInterface'
969969
];
970970

971971
for (const featureName of featureNames) {
@@ -2727,28 +2727,6 @@
27272727
});
27282728

27292729
function init$4 (args) {
2730-
try {
2731-
const value = {
2732-
get () {
2733-
return Promise.reject(new Error())
2734-
}
2735-
};
2736-
defineProperty(Navigator.prototype, 'credentials', {
2737-
value,
2738-
configurable: true,
2739-
enumerable: true
2740-
});
2741-
} catch {
2742-
// Ignore exceptions that could be caused by conflicting with other extensions
2743-
}
2744-
}
2745-
2746-
var navigatorCredentials = /*#__PURE__*/Object.freeze({
2747-
__proto__: null,
2748-
init: init$4
2749-
});
2750-
2751-
function init$3 (args) {
27522730
try {
27532731
if (navigator.duckduckgo) {
27542732
return
@@ -2774,10 +2752,10 @@
27742752

27752753
var navigatorInterface = /*#__PURE__*/Object.freeze({
27762754
__proto__: null,
2777-
init: init$3
2755+
init: init$4
27782756
});
27792757

2780-
function init$2 (args) {
2758+
function init$3 (args) {
27812759
// Unfortunately, we only have limited information about the referrer and current frame. A single
27822760
// page may load many requests and sub frames, all with different referrers. Since we
27832761
if (args.referrer && // make sure the referrer was set correctly
@@ -2803,7 +2781,7 @@
28032781

28042782
var referrer = /*#__PURE__*/Object.freeze({
28052783
__proto__: null,
2806-
init: init$2
2784+
init: init$3
28072785
});
28082786

28092787
class Cookie {
@@ -2981,7 +2959,7 @@
29812959
applyCookieExpiryPolicy();
29822960
}
29832961

2984-
function init$1 (args) {
2962+
function init$2 (args) {
29852963
args.cookie.debug = args.debug;
29862964
loadedPolicyResolve(args.cookie);
29872965
}
@@ -2995,7 +2973,7 @@
29952973
var trackingCookies1p = /*#__PURE__*/Object.freeze({
29962974
__proto__: null,
29972975
load: load,
2998-
init: init$1,
2976+
init: init$2,
29992977
update: update
30002978
});
30012979

@@ -3029,7 +3007,7 @@
30293007
});
30303008
}
30313009

3032-
function init (args) {
3010+
function init$1 (args) {
30333011
args.cookie.debug = args.debug;
30343012
if (globalThis.top !== globalThis && args.cookie.isTrackerFrame && args.cookie.shouldBlock && args.cookie.isThirdParty) {
30353013
// overrides expiry policy with blocking - only in subframes
@@ -3038,6 +3016,44 @@
30383016
}
30393017

30403018
var trackingCookies3p = /*#__PURE__*/Object.freeze({
3019+
__proto__: null,
3020+
init: init$1
3021+
});
3022+
3023+
/**
3024+
* Fixes incorrect sizing value for outerHeight and outerWidth
3025+
*/
3026+
function windowSizingFix () {
3027+
window.outerHeight = window.innerHeight;
3028+
window.outerWidth = window.innerWidth;
3029+
}
3030+
3031+
/**
3032+
* Add missing navigator.credentials API
3033+
*/
3034+
function navigatorCredentialsFix () {
3035+
try {
3036+
const value = {
3037+
get () {
3038+
return Promise.reject(new Error())
3039+
}
3040+
};
3041+
defineProperty(Navigator.prototype, 'credentials', {
3042+
value,
3043+
configurable: true,
3044+
enumerable: true
3045+
});
3046+
} catch {
3047+
// Ignore exceptions that could be caused by conflicting with other extensions
3048+
}
3049+
}
3050+
3051+
function init () {
3052+
windowSizingFix();
3053+
navigatorCredentialsFix();
3054+
}
3055+
3056+
var webCompat = /*#__PURE__*/Object.freeze({
30413057
__proto__: null,
30423058
init: init
30433059
});

0 commit comments

Comments
 (0)