+ // Cancel the request if the SSL error handler is not null. This resets the WebView so it is not waiting on a response to the error handler if it is restarted in the background.
+ // Otherwise, after restart, the dialog is no longer displayed, but the error handler is still pending and there is no way to cause the dialog to redisplay for that URL in that tab.
+ if (httpAuthHandler != null)
+ httpAuthHandler!!.cancel()