removed umami

This commit is contained in:
NOCanoa 2024-10-17 00:15:00 +01:00
parent bd9291a1d4
commit b269bee3f7
5 changed files with 1 additions and 189 deletions

View file

@ -1,172 +0,0 @@
!(function () {
"use strict";
((t) => {
const {
screen: { width: e, height: a },
navigator: { language: r },
location: n,
localStorage: i,
document: c,
history: o,
} = t,
{ hostname: s, href: u } = n,
{ currentScript: l, referrer: d } = c;
if (!l) return;
const f = "data-",
m = l.getAttribute.bind(l),
h = m(f + "website-id"),
p = m(f + "host-url"),
g = m(f + "tag"),
y = "false" !== m(f + "auto-track"),
b = "true" === m(f + "exclude-search"),
v = m(f + "domains") || "",
S = v.split(",").map((t) => t.trim()),
w = `${(p || "" || l.src.split("/").slice(0, -1).join("/")).replace(/\/$/, "")}/api/send`,
N = `${e}x${a}`,
T = /data-umami-event-([\w-_]+)/,
A = f + "umami-event",
x = 300,
O = (t) => {
if (t) {
try {
const e = decodeURI(t);
if (e !== t) return e;
} catch (e) {
return t;
}
return encodeURI(t);
}
},
U = (t) => {
try {
const { pathname: e, search: a } = new URL(t);
t = e + a;
} catch (t) {}
return b ? t.split("?")[0] : t;
},
j = () => ({
website: h,
hostname: s,
screen: N,
language: r,
title: O(q),
url: O(D),
referrer: O(_),
tag: g || void 0,
}),
k = (t, e, a) => {
a && ((_ = D), (D = U(a.toString())), D !== _ && setTimeout(I, x));
},
E = () =>
!h || (i && i.getItem("umami.disabled")) || (v && !S.includes(s)),
L = async (t, e = "event") => {
if (E()) return;
const a = { "Content-Type": "application/json" };
void 0 !== R && (a["x-umami-cache"] = R);
try {
const r = await fetch(w, {
method: "POST",
body: JSON.stringify({ type: e, payload: t }),
headers: a,
}),
n = await r.text();
return (R = n);
} catch (t) {}
},
$ = () => {
B ||
(I(),
(() => {
const t = (t, e, a) => {
const r = t[e];
return (...e) => (a.apply(null, e), r.apply(t, e));
};
(o.pushState = t(o, "pushState", k)),
(o.replaceState = t(o, "replaceState", k));
})(),
(() => {
const t = new MutationObserver(([t]) => {
q = t && t.target ? t.target.text : void 0;
}),
e = c.querySelector("head > title");
e &&
t.observe(e, { subtree: !0, characterData: !0, childList: !0 });
})(),
c.addEventListener(
"click",
async (t) => {
const e = (t) => ["BUTTON", "A"].includes(t),
a = async (t) => {
const e = t.getAttribute.bind(t),
a = e(A);
if (a) {
const r = {};
return (
t.getAttributeNames().forEach((t) => {
const a = t.match(T);
a && (r[a[1]] = e(t));
}),
I(a, r)
);
}
},
r = t.target,
i = e(r.tagName)
? r
: ((t, a) => {
let r = t;
for (let t = 0; t < a; t++) {
if (e(r.tagName)) return r;
if (((r = r.parentElement), !r)) return null;
}
})(r, 10);
if (!i) return a(r);
{
const { href: e, target: r } = i,
c = i.getAttribute(A);
if (c)
if ("A" === i.tagName) {
const o =
"_blank" === r ||
t.ctrlKey ||
t.shiftKey ||
t.metaKey ||
(t.button && 1 === t.button);
if (c && e)
return (
o || t.preventDefault(),
a(i).then(() => {
o || (n.href = e);
})
);
} else if ("BUTTON" === i.tagName) return a(i);
}
},
!0,
),
(B = !0));
},
I = (t, e) =>
L(
"string" == typeof t
? { ...j(), name: t, data: "object" == typeof e ? e : void 0 }
: "object" == typeof t
? t
: "function" == typeof t
? t(j())
: j(),
),
K = (t) => L({ ...j(), data: t }, "identify");
t.umami || (t.umami = { track: I, identify: K });
let R,
B,
D = U(u),
_ = d !== s ? d : "",
q = c.title;
y &&
!E() &&
("complete" === c.readyState
? $()
: c.addEventListener("readystatechange", $, !0));
})(window);
})();

View file

@ -47,15 +47,6 @@ export default async function RootLayout({
<head> <head>
<link rel="me" href="https://fosstodon.org/@zenbrowser"></link> <link rel="me" href="https://fosstodon.org/@zenbrowser"></link>
<link rel="canonical" href="https://zen-browser.app/"></link> <link rel="canonical" href="https://zen-browser.app/"></link>
{/* Analitics */}
<script
defer
src="https://cdn.jsdelivr.net/gh/zen-browser/www/public/uma.js"
data-host-url="https://uma.zen-browser.app"
data-website-id="7148ef7c-5299-4ca1-9a18-9d6964e93b53"
data-domains="zen-browser.app"
></script>
{/* End */}
<link <link
rel="alternate" rel="alternate"
type="application/rss+xml" type="application/rss+xml"

View file

@ -359,7 +359,7 @@ export default function Features() {
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
<Button data-umami-event="patreon-feature" variant="ghost"> <Button variant="ghost">
Patreon <ExternalLinkIcon className="ml-4 h-4 w-4 opacity-50" /> Patreon <ExternalLinkIcon className="ml-4 h-4 w-4 opacity-50" />
</Button> </Button>
</a> </a>
@ -369,7 +369,6 @@ export default function Features() {
target="_blank" target="_blank"
> >
<Button <Button
data-umami-event="ko-fi-feature"
className="ml-8" className="ml-8"
variant="ghost" variant="ghost"
> >

View file

@ -17,7 +17,6 @@ export default function Footer() {
<h1 className="text-2xl font-bold opacity-80">Zen Browser</h1> <h1 className="text-2xl font-bold opacity-80">Zen Browser</h1>
<a <a
target="_blank" target="_blank"
data-umami-event="footer-status"
rel="noopener noreferrer" rel="noopener noreferrer"
href="https://uptime.zen-browser.app/" href="https://uptime.zen-browser.app/"
className="mt-2 flex w-fit cursor-pointer items-center rounded-md bg-surface px-3 py-2 shadow" className="mt-2 flex w-fit cursor-pointer items-center rounded-md bg-surface px-3 py-2 shadow"
@ -92,7 +91,6 @@ export default function Footer() {
<li> <li>
<a <a
target="_blank" target="_blank"
data-umami-event="footer-discord"
href="https://discord.com/servers/mauro-s-little-sweatshop-1088172780480114748" href="https://discord.com/servers/mauro-s-little-sweatshop-1088172780480114748"
> >
Discord Discord
@ -114,7 +112,6 @@ export default function Footer() {
</li> </li>
<li className="mt-2"> <li className="mt-2">
<a <a
data-umami-event="footer-privacy-policy"
href="/privacy-policy" href="/privacy-policy"
> >
Privacy Policy Privacy Policy
@ -150,7 +147,6 @@ export default function Footer() {
<li> <li>
<a <a
target="_blank" target="_blank"
data-umami-event="patreon-fotter"
href="https://patreon.com/zen_browser" href="https://patreon.com/zen_browser"
> >
Patreon Patreon
@ -159,7 +155,6 @@ export default function Footer() {
<li className="mt-2"> <li className="mt-2">
<a <a
target="_blank" target="_blank"
data-umami-event="ko-fi-fotter"
href="https://ko-fi.com/zen_browser" href="https://ko-fi.com/zen_browser"
> >
Ko-fi Ko-fi

View file

@ -96,7 +96,6 @@ const ListItem2 = React.forwardRef<
<li> <li>
<NavigationMenuLink asChild> <NavigationMenuLink asChild>
<a <a
data-umami-event={title}
ref={ref} ref={ref}
className={ny( className={ny(
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", "block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",