summaryrefslogtreecommitdiffstats
path: root/browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js')
-rw-r--r--browser/extensions/webcompat/injections/js/bug1665035-dckids.com-cookieEnabled.js30
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,
+ });
+}