@Override
 public boolean onJsBeforeUnload(WebView view, String url, String message, JsResult result) {
   if (originalWebChromeClient.onJsBeforeUnload(view, url, message, result)) {
     return originalWebChromeClient.onJsBeforeUnload(view, url, message, result);
   }
   return true;
 }
 @Override
 public void handleJsBeforeUnload(String url, String message, JsResultReceiver receiver) {
   TraceEvent.begin();
   if (mWebChromeClient != null) {
     final JsPromptResult res = new JsPromptResultReceiverAdapter(receiver).getPromptResult();
     if (TRACE) Log.d(TAG, "onJsBeforeUnload");
     if (!mWebChromeClient.onJsBeforeUnload(mWebView, url, message, res)) {
       new JsDialogHelper(res, JsDialogHelper.UNLOAD, null, message, url)
           .showDialog(mWebView.getContext());
     }
   } else {
     receiver.cancel();
   }
   TraceEvent.end();
 }