Skip to content

Commit 7e6b570

Browse files
committed
Skip tracking for local development
1 parent 5a6cc41 commit 7e6b570

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

index.html

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,29 @@
6767
<link rel="stylesheet" href="src/styles.css" />
6868
<link rel="stylesheet" href="src/visit/visit.css" />
6969
<script type="text/javascript">
70-
(function (c, l, a, r, i, t, y) {
71-
c[a] =
72-
c[a] ||
73-
function () {
74-
(c[a].q = c[a].q || []).push(arguments);
75-
};
76-
t = l.createElement(r);
77-
t.async = 1;
78-
t.src = "https://www.clarity.ms/tag/" + i;
79-
y = l.getElementsByTagName(r)[0];
80-
y.parentNode.insertBefore(t, y);
81-
})(window, document, "clarity", "script", "wwtq25g4z0");
70+
(function () {
71+
var host = window.location.hostname;
72+
var isLocal =
73+
host === "localhost" ||
74+
host === "127.0.0.1" ||
75+
host === "[::1]" ||
76+
host.endsWith(".localhost");
77+
if (isLocal || navigator.webdriver) {
78+
return;
79+
}
80+
(function (c, l, a, r, i, t, y) {
81+
c[a] =
82+
c[a] ||
83+
function () {
84+
(c[a].q = c[a].q || []).push(arguments);
85+
};
86+
t = l.createElement(r);
87+
t.async = 1;
88+
t.src = "https://www.clarity.ms/tag/" + i;
89+
y = l.getElementsByTagName(r)[0];
90+
y.parentNode.insertBefore(t, y);
91+
})(window, document, "clarity", "script", "wwtq25g4z0");
92+
})();
8293
</script>
8394
</head>
8495

0 commit comments

Comments
 (0)