Skip to content

Commit 8f7c6d2

Browse files
don't track request if page is served from local filesystem (instead of over http). closes #190
1 parent 9b7acf2 commit 8f7c6d2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

assets/src/js/tracker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@
128128

129129
// parse request, use canonical if there is one
130130
let req = window.location;
131+
132+
// do not track if not served over HTTP or HTTPS (eg from local filesystem)
133+
if(req.host === '') {
134+
return;
135+
}
136+
137+
// find canonical URL
131138
let canonical = document.querySelector('link[rel="canonical"][href]');
132139
if(canonical) {
133140
let a = document.createElement('a');

0 commit comments

Comments
 (0)