Fix JavaScript errors in webview