Catch an exception if document.referrer is empty
This commit is contained in:
parent
658eecfa1e
commit
06819504c2
1 changed files with 6 additions and 4 deletions
|
@ -9,8 +9,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
}
|
||||
siteHeader.classList.add("visible");
|
||||
|
||||
const documentReferrer = new URL(document.referrer);
|
||||
if (documentReferrer.pathname === "/") {
|
||||
siteHeader.classList.add("animated");
|
||||
}
|
||||
try {
|
||||
const documentReferrer = new URL(document.referrer);
|
||||
if (documentReferrer.pathname === "/") {
|
||||
siteHeader.classList.add("animated");
|
||||
}
|
||||
} catch { }
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue