Check for instance at the very beginning
This commit is contained in:
parent
5f0e28e506
commit
445908b34a
1 changed files with 24 additions and 25 deletions
17
src/count.js
17
src/count.js
|
@ -32,20 +32,18 @@
|
|||
|
||||
// Check if the default GC URL resolves
|
||||
// This allows us to not track people with ad blockers
|
||||
fetch("//gc.zgo.at/", { method: "HEAD" })
|
||||
|
||||
if (
|
||||
window.location.host === "toot.kytta.dev" ||
|
||||
window.location.host === "s2f.kytta.dev" ||
|
||||
window.location.host === "share2fedi.kytta.dev"
|
||||
) {
|
||||
fetch("//gc.zgo.at/", { method: "HEAD" })
|
||||
.then((result) => {
|
||||
if (!result.ok) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
window.location.host !== "toot.kytta.dev" &&
|
||||
window.location.host !== "s2f.kytta.dev" &&
|
||||
window.location.host !== "share2fedi.kytta.dev"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const screen = encodeURIComponent(
|
||||
[
|
||||
window.screen.width,
|
||||
|
@ -61,3 +59,4 @@ fetch("//gc.zgo.at/", { method: "HEAD" })
|
|||
);
|
||||
})
|
||||
.catch((_) => {});
|
||||
}
|
||||
|
|
Reference in a new issue