mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
link[href] is already an absolute URL
a[href] and link[href] will both normalize to an absolute URL so there is no need to create an extra a element here.
This commit is contained in:
parent
6a27475faf
commit
c6ec64a267
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user