From cc21682d3b98b62b8db60f53e53910a1184fd8b3 Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 6 Jul 2022 22:12:59 -0400 Subject: static/js/pager: Bail when under cookie restrictions --- static/js/pager.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'static') 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"]) { -- cgit v1.2.3