diff options
Diffstat (limited to 'backend/instance/nocookies/data/js/common2.js')
| -rw-r--r-- | backend/instance/nocookies/data/js/common2.js | 31 |
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 |
