Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: make telemetry opt-in by default

Abdullah Attab6f922eb9226
diff --git a/apps/web/src/components/dialogs/onboarding-dialog.js b/apps/web/src/components/dialogs/onboarding-dialog.js
index 1742e056b..5c46d6caf 100644
--- a/apps/web/src/components/dialogs/onboarding-dialog.js
+++ b/apps/web/src/components/dialogs/onboarding-dialog.js
@@ -41,7 +41,6 @@ import { useCallback, useState } from "react";
import Config from "../../utils/config";
import { getAllAccents } from "@notesnook/theme";
import { isMacStoreApp } from "../../utils/platform";
-import { doNotTrack } from "../../utils/telemetry";
const newUserSteps = [
{
@@ -49,7 +48,7 @@ const newUserSteps = [
subtitle: "Write with freedom. Never compromise on privacy again.",
buttonText: "Get started",
image: <Note width={120} />,
- component: doNotTrack() ? null : TrackingConsent
+ component: TrackingConsent
},
{
title: "Choose your style",
@@ -400,7 +399,7 @@ function ThemeSelector() {
function TrackingConsent() {
const [enableTelemetry, setEnableTelemetry] = usePersistentState(
"telemetry",
- true
+ false
);
return (
<Label variant="text.subBody" my={4} sx={{ width: "80%" }}>
diff --git a/apps/web/src/utils/telemetry.ts b/apps/web/src/utils/telemetry.ts
index 028453d5d..fd70a72fd 100644
--- a/apps/web/src/utils/telemetry.ts
+++ b/apps/web/src/utils/telemetry.ts
@@ -23,31 +23,9 @@ export function isTelemetryEnabled() {
// telemetry is always disabled in DEBUG/TEST mode
if (process.env.NODE_ENV !== "production") return false;
- return Config.get("telemetry", !doNotTrack());
+ return Config.get("telemetry", false);
}
export function setTelemetry(state: boolean) {
Config.set("telemetry", state);
}
-
-export function doNotTrack() {
- const { navigator, external } = window;
-
- const msTrackProtection = "msTrackingProtectionEnabled";
- const msTracking = () => {
- return (
- external &&
- msTrackProtection in external &&
- typeof external[msTrackProtection] === "function" &&
- external[msTrackProtection]()
- );
- };
-
- const dnt =
- ("doNotTrack" in window && window.doNotTrack) ||
- navigator.doNotTrack ||
- ("msDoNotTrack" in navigator && navigator.doNotTrack) ||
- msTracking();
-
- return dnt == "1" || dnt === "yes";
-}