title: GWT: windowClosing handler not properly handled in chrome
body: <p>Window closing handler is not working on my code under Chrome (I'm on it's last version, 26)</p>
  
  <p>I have a class that listens to the <code>Window.ClosingEvent</code>. If the window is being closed while the user is uploading a file (close the window, the user types another url...) the application prompts the user "are you sure?".</p>
  
  <p>GWT 2.5.0 and 2.5.1
  IExplorer 10 ok
  Firefox 21 ok
  Opera doesn't support the event yet.
  Chrome 26 is not working.</p>
  
  <p>Here's the GWT code:</p>
  
  <pre><code>public abstract class ActiveUploadTransitionController extends TransitionController implements ClosingHandler {
  
  ...
  
  @Override
      public void onWindowClosing(Window.ClosingEvent event){
          if(showMessage()){
              if(folder != null &amp;&amp; folder.hasActiveFileUploads()){
                  event.setMessage(getUploadActiveLeavingMessage());
              }
          }
      }
  
  ...
  protected ActiveUploadTransitionController()
      {
  ...
  Window.addWindowClosingHandler(this);
  ...
  }
  }
  </code></pre>
  
  <p>The above code complies and works properly in Explorer, Firefox so I think the code is ok.</p>
  
  <p>The funny thing is that if I implement an isolated test in JavaScript it works fine in Explorer, Firefox and Chrome browsers.</p>
  
  <p><code>//JavaScript</code></p>
  
  <pre><code>var handler = function(e){
          var show = true;
          if(show){
              var msg = "messageTest";
              (e || window.event).returnValue = msg;
              return msg;
          }
          return;
      }
  
      if(window.addEventListener){
          window.addEventListener("beforeunload", handler);
      }
  </code></pre>
  
  <p>Because the isolated JavaScript works I also tryed to implement it in native way. The same problem. Works in IExplorer, FireFox but not in Chrome.</p>
  
  <pre><code>var handler = function (e) {
      var showMessage = that.@com.skydox.client.home.ActiveUploadTransitionController::showMessage()();
      if(showMessage){
          var confirmationMessage = that.@com.skydox.client.home.ActiveUploadTransitionController::getUploadActiveLeavingMessage()();
          (e || window.event).returnValue = confirmationMessage;
          return confirmationMessage;
      }
      tmpBeforeUnload(e);
      return;
  }
  if($wnd.addEventListener){
       $wnd.onbeforeunload = handler;
  }
  </code></pre>
  
  <p>This issue is getting me crazy. Any idea guys?</p>
  
  <p>Thanks folks!</p>