explicitly use the current location.href

This commit is contained in:
Kilian Valkhof 2024-12-04 11:59:30 +01:00
parent c85f82819e
commit e7a7156b9a
No known key found for this signature in database
GPG Key ID: B2B7B9BA1200430E

View File

@ -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, href);
const { pathname, search, hash } = new URL(url, location.href);
url = pathname + search + hash;
} catch (e) {
/* empty */
@ -79,7 +79,6 @@
if (!url) return;
currentRef = currentUrl;
currentUrl = parseURL(url.toString());
if (currentUrl !== currentRef) {