moved code from branch 'webview-error-handling'.