diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js b/browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js new file mode 100644 index 0000000000..a243fae54a --- /dev/null +++ b/browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js @@ -0,0 +1,30 @@ +"use strict"; + +/** + * Bug 1665035 - enable navigator.cookieEnabled and spoof window.navigator on Linux + * + * Some of the games are not starting because navigator.cookieEnabled + * returns false for trackers with ETP strict. Overwriting the value allows + * to play the games. In addition, Linux desktop devices are incorrectly + * flagged as mobile devices (even if ETP is disabled), so spoofing + * window.navigator.platform here. + */ + +console.info( + "window.cookieEnabled has been overwritten for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1665035 for details." +); + +Object.defineProperty(window.navigator.wrappedJSObject, "cookieEnabled", { + value: true, + writable: false, +}); + +if (navigator.platform.includes("Linux")) { + console.info( + "navigator.platform has been overwritten for compatibility reasons. See https://bugzilla.mozilla.org/show_bug.cgi?id=1665035 for details." + ); + Object.defineProperty(window.navigator.wrappedJSObject, "platform", { + value: "Win64", + writable: false, + }); +} |