diff options
-rw-r--r-- | assets/js/index.js | 6 | ||||
-rw-r--r-- | static/js/pager.ts | 7 |
2 files changed, 13 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"]) { diff --git a/static/js/pager.ts b/static/js/pager.ts index 49f3b2d..c77ba40 100644 --- a/static/js/pager.ts +++ b/static/js/pager.ts @@ -1,7 +1,14 @@ (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"]) { |