summaryrefslogtreecommitdiff
path: root/backend/instance/nocookies/data/js/common2.js
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-02-17 22:39:42 +0100
committeraura <nw@moneybot.cc>2026-02-17 22:39:42 +0100
commit636b0323075225c584b62719ed51e75521bb7ffb (patch)
tree61b02271b6d0695a4beffc23fb6eb062a7da22c3 /backend/instance/nocookies/data/js/common2.js
push source
Diffstat (limited to 'backend/instance/nocookies/data/js/common2.js')
-rw-r--r--backend/instance/nocookies/data/js/common2.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/backend/instance/nocookies/data/js/common2.js b/backend/instance/nocookies/data/js/common2.js
new file mode 100644
index 0000000..a5f936b
--- /dev/null
+++ b/backend/instance/nocookies/data/js/common2.js
@@ -0,0 +1,31 @@
+function getItem(hostname)
+{
+ switch (hostname)
+ {
+ case 'pepephone.com': return {strict: true, key: 'cookiesChosen', value: 'done'};
+ }
+
+
+ const parts = hostname.split('.');
+
+ if (parts.length > 2)
+ {
+ parts.shift();
+ return getItem(parts.join('.'));
+ }
+
+ return false;
+}
+
+
+let hostname = document.location.hostname.replace(/^w{2,3}\d*\./i, ''),
+ item = getItem(hostname);
+
+if (item) {
+ let value = sessionStorage.getItem(item.key);
+
+ if (value == null || (item.strict && value != item.value)) {
+ sessionStorage.setItem(item.key, item.value);
+ document.location.reload();
+ }
+} \ No newline at end of file