From ef207c3936dd29153760346b0c08a69841fd7f47 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 19 Apr 2026 15:18:31 -0400 Subject: [PATCH] Fix "onbeforeunload not a function" should be window.onbeforeunload = xyz. However in this case, it's not needed anyway since we are only adding the event listener once on page load, which already gets cleared when you reload the page. --- client/homebrew/brewRenderer/brewRenderer.jsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index e5f5eb1ef..202c1a375 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -273,13 +273,7 @@ const BrewRenderer = (props)=>{ const frameDidMount = ()=>{ //This triggers when iFrame finishes internal "componentDidMount" scrollToHash(window.location.hash); - window.addEventListener('hashchange', ()=>{ - scrollToHash(window.location.hash); - }); - - window.onbeforeunload(()=>{ - window.removeEventListener('hashchange'); - }); + window.addEventListener('hashchange', ()=>scrollToHash(window.location.hash)); setTimeout(()=>{ //We still see a flicker where the style isn't applied yet, so wait 100ms before showing iFrame renderPages(); //Make sure page is renderable before showing