Remove all trackers (Umami, Cloudflare, insights-js) from cookie consent

Strip loadAnalytics, loadCloudflareTunnel and insights-js dependency.
Cookie consent banner kept for future use without any tracking scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-26 11:29:22 +01:00
parent 3bb676bfda
commit 3a85b6ef68
3 changed files with 1 additions and 44 deletions

View File

@@ -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()
})
}

View File

@@ -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=="],

View File

@@ -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"