Skip to content

Commit

Permalink
Merge pull request #2960 from DDDDD12138/feat-support-hash-route
Browse files Browse the repository at this point in the history
feat: Add support for hash-based routing tracking
  • Loading branch information
mikecao authored Oct 29, 2024
2 parents 586d223 + 3fb68e1 commit 9758b55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down

0 comments on commit 9758b55

Please sign in to comment.