diff --git a/api/event.js b/api/event.js index abbd35d1..94bc7ddb 100644 --- a/api/event.js +++ b/api/event.js @@ -8,13 +8,13 @@ export default async (request, context) => { const num = new URL(request['url']).searchParams.get('num') const lang = decodeURIComponent(new URL(request['url']).searchParams.get('lang')) const nav = decodeURIComponent(new URL(request['url']).searchParams.get('nav')) - const i = new URL(request['url']).searchParams.get('i') + const ig = new URL(request['url']).searchParams.get('ig') const headers = {} if (lang) headers['Accept-Language'] = lang; if (nav) headers['User-Agent'] = nav; let url; - if (i) return; + if (ig) return; if (ns) { const ids = getStore('ids') if (!ids.get(id)) ids.set(id, '') diff --git a/src/assets/scripts/index.js b/src/assets/scripts/index.js index 73f4c006..af819c54 100644 --- a/src/assets/scripts/index.js +++ b/src/assets/scripts/index.js @@ -2,8 +2,8 @@ const id = Math.floor(Math.random() * Date.now()) let i; let url = `https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&num=${sessionStorage.getItem('id' || id)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}` if (window.sessionStorage && !window.sessionStorage?.getItem('id')) sessionStorage.setItem('id', id) -if (window.localStorage && window.localStorage.getItem('i')) { - i = localStorage.getItem('i') - url = `${url}&i=${i}` +if (window.localStorage && window.localStorage.getItem('ig')) { + ig = localStorage.getItem('ig') + url = `${url}&ig=${ig}` } -if (!window.fathom) fetch(url).then((data) => {}).catch(err => {}); \ No newline at end of file +if (!window.fathom) fetch(url).then(() => {}).catch(() => {}); \ No newline at end of file