Fixed referrer check. Closes #3016.

This commit is contained in:
Mike Cao 2024-11-20 15:13:02 -08:00
parent cd72fcacf4
commit 6ed660d8a7

View File

@ -6,7 +6,7 @@
document, document,
history, history,
} = window; } = window;
const { hostname, href } = location; const { hostname, href, origin } = location;
const { currentScript, referrer } = document; const { currentScript, referrer } = document;
const localStorage = href.startsWith('data:') ? undefined : window.localStorage; const localStorage = href.startsWith('data:') ? undefined : window.localStorage;
@ -260,7 +260,7 @@
} }
let currentUrl = parseURL(href); let currentUrl = parseURL(href);
let currentRef = referrer !== hostname ? referrer : ''; let currentRef = referrer.startsWith(origin) ? '' : referrer;
let title = document.title; let title = document.title;
let cache; let cache;
let initialized; let initialized;