aboutsummaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-07-06 22:12:59 -0400
committertdro <tdro@noreply.example.com>2022-07-06 22:12:59 -0400
commitcc21682d3b98b62b8db60f53e53910a1184fd8b3 (patch)
tree5321115e2aa16966d847c518e08acda42d8ec53d /assets/js
parent8b8fd07be1f3c319df34d77595dcbeabc78fc7ed (diff)
downloadcanory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.tar.gz
canory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.tar.bz2
canory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.zip
static/js/pager: Bail when under cookie restrictions
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index 1c2715b..77c52a6 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -4,9 +4,15 @@
(function() {
const url = self.location.href.split("#")[0];
+ const cookiesDisabled = !navigator.cookieEnabled;
let settings = {
pager: {}
};
+ if (cookiesDisabled) {
+ document.cookie = "disabled";
+ document.cookie.indexOf("disabled");
+ return console.log("Pager is disabled due to cookie restrictions.");
+ }
self.addEventListener("DOMContentLoaded", function() {
if (history.scrollRestoration) history.scrollRestoration = "manual";
if (localStorage["settings"]) {