Skip to content

Commit

Permalink
don't track request if page is served from local filesystem (instead …
Browse files Browse the repository at this point in the history
…of over http). closes #190
  • Loading branch information
dannyvankooten committed Nov 30, 2018
1 parent 9b7acf2 commit 8f7c6d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/src/js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 8f7c6d2

Please sign in to comment.