diff --git a/assets/modules/cookie-consent.js b/assets/modules/cookie-consent.js index 820f47b..3ff188a 100644 --- a/assets/modules/cookie-consent.js +++ b/assets/modules/cookie-consent.js @@ -13,48 +13,10 @@ function setCookie(name, value, days) { document.cookie = name + '=' + value + ';expires=' + date.toUTCString() + ';path=/;SameSite=Lax;Secure' } -function loadAnalytics() { - if (document.querySelector('script[data-analytics]')) { - return - } - - if (document.body.dataset.env === 'dev') { - return - } - - const script = document.createElement('script') - script.defer = true - script.src = 'https://tools-security.esy-web.dev/script.js' - script.dataset.websiteId = 'a1f85dd5-741f-4df7-840a-7ef0931ed0cc' - script.dataset.hostUrl = 'https://tools-security.esy-web.dev' - script.dataset.analytics = '1' - document.head.appendChild(script) - - loadCloudflareTunnel() -} - -function loadCloudflareTunnel() { - if (document.querySelector('script[data-cf-beacon]')) { - return - } - - const script = document.createElement('script') - script.defer = true - script.src = 'https://static.cloudflareinsights.com/beacon.min.js' - script.dataset.cfBeacon = '{"token":"5f2f3b8e1f824be6984a348fe31d2f04","spa":true}' - document.head.appendChild(script) -} - export function initCookieConsent() { const consent = getCookie(COOKIE_NAME) - if ('accepted' === consent) { - loadAnalytics() - - return - } - - if ('refused' === consent) { + if ('accepted' === consent || 'refused' === consent) { return } @@ -72,7 +34,6 @@ export function initCookieConsent() { acceptBtn.addEventListener('click', () => { setCookie(COOKIE_NAME, 'accepted', COOKIE_DAYS) banner.classList.add('hidden') - loadAnalytics() }) } diff --git a/bun.lock b/bun.lock index 77b1477..03527b6 100644 --- a/bun.lock +++ b/bun.lock @@ -10,7 +10,6 @@ "@sentry/browser": "^10.38.0", "@tailwindcss/vite": "^4.1.18", "autoprefixer": "^10.4.24", - "insights-js": "^1.2.11", "tailwindcss": "^4.1.18", "vite-plugin-compression": "^0.5.1", "vite-plugin-favicon": "^1.0.8", @@ -774,8 +773,6 @@ "inquirer": ["inquirer@3.0.6", "", { "dependencies": { "ansi-escapes": "^1.1.0", "chalk": "^1.0.0", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", "external-editor": "^2.0.1", "figures": "^2.0.0", "lodash": "^4.3.0", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rx": "^4.1.0", "string-width": "^2.0.0", "strip-ansi": "^3.0.0", "through": "^2.3.6" } }, "sha512-thluxTGBXUGb8DuQcvH9/CM/CrcGyB5xUpWc9x6Slqcq1z/hRr2a6KxUpX4ddRfmbe0hg3E4jTvo5833aWz3BA=="], - "insights-js": ["insights-js@1.2.11", "", {}, "sha512-rmNnMM2LnOmKVJAZOMmeZ6GYMm98ztGMC4nA7KUOTBoPBpce8uUx++ZPJDnU02ORH6lCzBCy0AOLwsC/v1dp1Q=="], - "inversify": ["inversify@5.0.1", "", {}, "sha512-Ieh06s48WnEYGcqHepdsJUIJUXpwH5o5vodAX+DK2JA/gjy4EbEcQZxw+uFfzysmKjiLXGYwNG3qDZsKVMcINQ=="], "ip-regex": ["ip-regex@1.0.3", "", {}, "sha512-HjpCHTuxbR/6jWJroc/VN+npo5j0T4Vv2TAI5qdEHQx7hsL767MeccGFSsLtF694EiZKTSEqgoeU6DtGFCcuqQ=="], diff --git a/package.json b/package.json index c75d2da..e070733 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "@sentry/browser": "^10.38.0", "@tailwindcss/vite": "^4.1.18", "autoprefixer": "^10.4.24", - "insights-js": "^1.2.11", "tailwindcss": "^4.1.18", "vite-plugin-compression": "^0.5.1", "vite-plugin-favicon": "^1.0.8"