Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:56:20+00:00 2026-05-28T19:56:20+00:00

Is there a way to detect if a browser window is closed using GWT.

  • 0

Is there a way to detect if a browser window is closed using GWT. For example a window opened through GWT using this code:

Window.open("some_url", "__blank", null);

I need to detect wether this windows opened through gwt is closed. Is there a way to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:56:21+00:00Added an answer on May 28, 2026 at 7:56 pm

    I think, it is a real problem making it cross-browser.
    GWT has

     Window.addCloseHandler(new CloseHandler<Window>() {
                public void onClose(CloseEvent<Window> windowCloseEvent) {
    
                }
            });
    

    Which handles the onunload event(occurs before the browser closes the document).
    However it does not work for handling browser close event with all browsers, because when refreshing the page, this event is fired as well.

    Since GWT also generates JavaScript see this article: Window Close Event of Browser
    Here is conclusion of that article:

    Conclusion

    As we have already discussed that there is no 100% fool proof way to
    detect the browser close event in a lot of cases, the above technique
    can fail. For example if the user kills the browser’s process from
    task manager, there could be many more cases. Yet in a lot of cases,
    this technique can be handy. Best of luck and happy programming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way with JQUERY or Javascript, to detect anytime the browser window
Is there a jquery way or plugin to detect the visitor's browser window size
Possible Duplicate: Is there a way to detect if a browser window is not
Is there a way to detect what browser the request is made in the
Is there any way that I can detect browser type on routing and use
Is there a way to create a winforms app, that detects an open browser
Is there a way to detect whether or not a browser has SVG capability
Is there any way to detect 302 redirects within the web browser control that
Currently I'm using following PHP+JavaScript code to detect clients browser windows size $url=http://.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if(isSet($_GET['w'])
Is there a way to detect whether a browser supports CSS3 transitions ( -webkit-

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.