Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix #3083 improve the parseURL function to handle page-relative URLs like pushState

Kilian Valkhofc85f82819e59
diff --git a/src/tracker/index.js b/src/tracker/index.js
index c17a76e8d..f0cf700d2 100644
--- a/src/tracker/index.js
+++ b/src/tracker/index.js
@@ -54,7 +54,7 @@
const parseURL = url => {
try {
// use location.origin as the base to handle cases where the url is a relative path
- const { pathname, search, hash } = new URL(url, origin);
+ const { pathname, search, hash } = new URL(url, href);
url = pathname + search + hash;
} catch (e) {
/* empty */
@@ -79,6 +79,7 @@
if (!url) return;
currentRef = currentUrl;
+
currentUrl = parseURL(url.toString());
if (currentUrl !== currentRef) {