diff --git a/BaiduPanDownload/Forms/Login.cs b/BaiduPanDownload/Forms/Login.cs index 67b60d9..47b981b 100644 --- a/BaiduPanDownload/Forms/Login.cs +++ b/BaiduPanDownload/Forms/Login.cs @@ -36,6 +36,8 @@ public Login() private void Login_Load(object sender, EventArgs e) { webBrowser1.Url = new Uri("http://www.139.sh"); + webBrowser1.ScriptErrorsSuppressed = true; + } private void button1_Click(object sender, EventArgs e) @@ -59,7 +61,13 @@ private void button1_Click(object sender, EventArgs e) private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { - + if (webBrowser1.Document != null) + if (webBrowser1.Document.Window != null) + webBrowser1.Document.Window.Error += Window_Error; + } + void Window_Error(object sender, HtmlElementErrorEventArgs e) + { + e.Handled = true; } string GetCookies(string url) {