Rank: Newbie Groups: Member
Joined: 10/21/2018 Posts: 5
|
I created a console application , then only the following code :
//Create a ThreadRunner object ThreadRunner threadRunner = new ThreadRunner();
//Create a WebView through the ThreadRunner WebView webView = threadRunner.CreateWebView(); Console.WriteLine(webView.Engine.Version); if (webView.Engine.IsDefault) { Console.WriteLine(webView.Engine.State.ToString()); } Console.WriteLine("设置cookie"); Cookie cookie = new Cookie("aaa", "aaa"); cookie.Expires = DateTime.Parse("2020-10-10"); try { webView.Engine.CookieManager.SetCookie("www.google.com", cookie); } catch(Exception e) {
}
the message is showed on console "62.0.3302.9" "Running"
and then stoped at the line "webView.Engine.CookieManager.SetCookie("www.google.com", cookie);" without any information . looks like it's in a dead loop. what's wrong with my code ?
|
Rank: Newbie Groups: Member
Joined: 10/21/2018 Posts: 5
|
I tried again and again. it still runs uncorrectly
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,258
|
Hi,
We have confirmed this to be a bug. To avoid the problem, you must use a valid Url with protocol. For example, "http://www.google.com", not just "www.google.com". This is necessary because cookies are protocol sensitive. As such when you do not specify protocol, the operation would fail. However it should fail instead of hang. This will be fixed in our next build.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 10/21/2018 Posts: 5
|
Got it ! thanks
|