diff options
author | tdro <tdro@noreply.example.com> | 2022-07-06 22:12:59 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-06 22:12:59 -0400 |
commit | cc21682d3b98b62b8db60f53e53910a1184fd8b3 (patch) | |
tree | 5321115e2aa16966d847c518e08acda42d8ec53d /static | |
parent | 8b8fd07be1f3c319df34d77595dcbeabc78fc7ed (diff) | |
download | canory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.tar.gz canory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.tar.bz2 canory-cc21682d3b98b62b8db60f53e53910a1184fd8b3.zip |
static/js/pager: Bail when under cookie restrictions
Diffstat (limited to 'static')
-rw-r--r-- | static/js/pager.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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"]) { |