• Detect when a user is closing the browser

    Home » Forums » Developers, developers, developers » Web design and development » Detect when a user is closing the browser

    Author
    Topic
    #469619

    Is there a way to detect if the user is trying to x-out of the browser and spawn an alert asking to confirm whether they want to do this? I know you can do the javascript window.close() but what about just shutting browser down?

    Viewing 1 reply thread
    Author
    Replies
    • #1229042

      I think you would still use window.onunload. I don’t think there is any object that represents the browser itself that has any useful events.

    • #1229139

      thanks – will give it a try.

    Viewing 1 reply thread
    Reply To: Detect when a user is closing the browser

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: