Skip to content
Permalink
Browse files

don't track request if page is served from local filesystem (instead …

…of over http). closes #190
  • Loading branch information...
dannyvankooten committed Nov 30, 2018
1 parent 9b7acf2 commit 8f7c6d2e45ebb28651208e2a7320e29948ecdb2c
Showing with 7 additions and 0 deletions.
  1. +7 −0 assets/src/js/tracker.js
@@ -128,6 +128,13 @@

// parse request, use canonical if there is one
let req = window.location;

// do not track if not served over HTTP or HTTPS (eg from local filesystem)
if(req.host === '') {
return;
}

// find canonical URL
let canonical = document.querySelector('link[rel="canonical"][href]');
if(canonical) {
let a = document.createElement('a');

0 comments on commit 8f7c6d2

Please sign in to comment.
You can’t perform that action at this time.