Merge pull request #2960 from DDDDD12138/feat-support-hash-route

feat: Add support for hash-based routing tracking
This commit is contained in:
Mike Cao 2024-10-29 09:26:34 -07:00 committed by GitHub
commit 9758b5523a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,8 +53,9 @@
const parseURL = url => {
try {
const { pathname, search } = new URL(url);
url = pathname + search;
// use location.origin as the base to handle cases where the url is a relative path
const { pathname, search, hash } = new URL(url, location.origin);
url = pathname + search + hash;
} catch (e) {
/* empty */
}