• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Computing / How to Disable beforeunload Event Listeners

How to Disable beforeunload Event Listeners

Last updated on August 4, 2022 by Sal Ferrarello

I was doing some troubleshooting and wanted to disable the beforeunload event listeners on a page. This is how I accomplished it with the Chrome browser.

  1. Open the Chrome Developer Tools
  2. Go to the Sources tab
  3. In the right most column, find the Global Listeners collapsible area and expand it
    Chrome Developer tools under the Sources tab, Global Listeners.
  4. Expand the beforeunload Global Listener section
  5. Click the Remove button for each Event Listener you want to remove
    Chrome developer tools removing global event listeners from beforeunload.
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: Chrome, JavaScript

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in