Merge pull request #3087 from Kilian/fix-pushstate

fix #3083 improve the parseURL function to handle page-relative URLs
This commit is contained in:
Mike Cao authored and GitHub committed 2024-12-04 11:48:36 -08:00
commit 6b1c183077
1 file changed
+1 -1
+1 -1
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, origin);
const { pathname, search, hash } = new URL(url, location.href);
url = pathname + search + hash;
} catch (e) {
/* empty */