Skip to content

Commit

Permalink
Fixed referrer check. Closes #3016.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Nov 20, 2024
1 parent cd72fca commit 6ed660d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
document,
history,
} = window;
const { hostname, href } = location;
const { hostname, href, origin } = location;
const { currentScript, referrer } = document;
const localStorage = href.startsWith('data:') ? undefined : window.localStorage;

Expand Down Expand Up @@ -260,7 +260,7 @@
}

let currentUrl = parseURL(href);
let currentRef = referrer !== hostname ? referrer : '';
let currentRef = referrer.startsWith(origin) ? '' : referrer;
let title = document.title;
let cache;
let initialized;
Expand Down

0 comments on commit 6ed660d

Please sign in to comment.