Skip to content

Commit 83864cc

Browse files
committed
Add script to prevent unwanted unload handlers for improved Lighthouse scores
1 parent 9fbad39 commit 83864cc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/layouts/BaseLayout.astro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,10 @@ const { pageTitle } = Astro.props;
8484
<Footer />
8585
</body>
8686
</html>
87+
88+
<script>
89+
// Prevent any unwanted unload handlers for improved Lighthouse scores
90+
window.addEventListener("load", () => {
91+
window.removeEventListener("unload", () => {});
92+
});
93+
</script>

0 commit comments

Comments
 (0)