This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/assets/scripts/index.js
2024-03-25 10:10:39 -07:00

7 lines
No EOL
404 B
JavaScript

let ignore;
let url = `https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}`
if (window.localStorage && window.localStorage.getItem('ignore')) {
ignore = localStorage.getItem('ignore')
url = `${url}&ignore=${ignore}`
}
if (!window.fathom) fetch(url).then(() => {}).catch(() => {});