Merge pull request #98 from da2x/patch-5

link[href] is already an absolute URL
This commit is contained in:
Danny van Kooten 2018-07-23 07:28:26 +02:00 committed by GitHub
commit c8eef57e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -73,11 +73,7 @@ function trackPageview() {
// parse canonical, if page has one // parse canonical, if page has one
let canonical = document.querySelector('link[rel="canonical"][href]'); let canonical = document.querySelector('link[rel="canonical"][href]');
if(canonical) { if(canonical) {
let a = document.createElement('a'); req = canonical.href;
a.href = canonical.href;
// use parsed canonical as location object
req = a;
} }
// get path and pathname from location or canonical // get path and pathname from location or canonical