Closed baby-Jie closed 6 years ago
Welcome! If you're reporting a bug, please make sure you have completed the bug report template see https://github.com/cefsharp/CefSharp/blob/master/ISSUE_TEMPLATE.md#bug-report. Please make sure you provide enough detail that someone else can reproduce the issue you are experiencing.
We prefer to keep this issue track just for bug reports. If you have a question or need help with something I'd ask that you self close this issue and have a read over https://github.com/cefsharp/CefSharp/blob/master/ISSUE_TEMPLATE.md it contains background information, details on where to ask your questions (hint, Gitter is one such place)
It's also reportant to remember that CefSharp
is just a wrapper around the Chromium Embedded Framework(CEF)
, a lot of questions people have aren't actually CefSharp
specific, they're generic to CEF
and for those CEF
has it's own support forum at http://magpcss.org/ceforum/index.php and issue tracker at https://bitbucket.org/chromiumembedded/cef
It's important to remember that CefSharp
is just a wrapper around the Chromium Embedded Project (CEF)
, the upstream CEF
forum is a valuable resource. Also CEF
has it's own Issue Tracker. Please take the time to research your own problem, including Googling
, searching on ceforum
, etc.
--
Debug.log
file? (Should be located in your apps executing folder by default)chromium
as a keyword).cefclient
? (cefclient
is the reference implementation provided by CEF
)--
cefclient
?CEF
your actually using, easiest way is to check your packages.config
file, look for the cef.redist.x86
package, it's version will be something like 3.2526.1362
, that's the exact version of CEF
you'll need to download for comparison. You can also open chrome://version
in the browser to determine the version.Branch
you require, for the example above the branch is 2526
, all the versions follow a similar patternWindows 32bit
or Windows 64bit
item, if you don't see the exact version, then click more revisions
WPF/Offscreen
or WinForms
? This next part is key
cefclient --multi-threaded-message-loop --off-screen-rendering-enabled
cefclient --multi-threaded-message-loop
@amaitland hello amaitland, i am using WinForms.The verision i am using is "3.3239.1723"(63.0.3).
it's simple in my code:
private void btnGo_Click(object sender, EventArgs e)
{
string url = textBox1.Text.Trim();
browser.Load(url);
//Thread.Sleep(30);
browser.Load(url);
}
change the url:
1,"www.google.com" -> "about:blank"
2, "about:blank" -> "www.google.com"
it does not work at step 2, it also at the page of "about:blank", but if i use Thread.Sleep between Load(Url), it will work properly.
there is no useful information in debug.log. it only write dome warning when the browser start like this: [0605/095707.569:WARNING:angle_platform_impl.cc(51)] rx::HLSLCompiler::compileToBinary(228): C:\fakepath(30,8-58): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them C:\fakepath(35,8-28): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
[0605/095708.579:WARNING:angle_platform_impl.cc(51)] rx::HLSLCompiler::compileToBinary(228): C:\fakepath(48,8-58): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them C:\fakepath(53,8-28): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
can you give me some suggestions about how to deal with it?
about:blank is treated as a special case by Chromium, in newer version I don't believe it triggers a navigation.
http://magpcss.org/ceforum/viewtopic.php?f=6&t=15989&p=38465&hilit=about%3Ablank#p38465 http://magpcss.org/ceforum/viewtopic.php?f=10&t=15950&p=38246&hilit=about%3Ablank#p38246
From a CefSharp point of view this is unlikely a bug. You should test with cefclient if you wish to confirm, see above for details.
You can always use a data encoded uri, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#loading-htmlcssjavascriptetc-from-diskdatabaseembedded-resourcestream for an example, it's at the bottom of that section
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
@amaitland it's ok, thanks a lot
You can try with 65.0.0-pre01 and see if it behaves differently, in general I suggest avoiding using about:blank
@amaitland hello, i find another problem. first: browser.Load(blankHtmlFilePath); second: //browser.Load("www.google.com"); //browser.Load("www.google.com"); browser.Load(testHtmlFilePath); browser.Load(testHtmlFilePath);
At the second part, it does not work. If i load "www.google.com", it is ok. if i use data encoded uri at the first step, suach as : const string html = "
@amaitland I try it in cefclient(3.3239.1723"). It also exists this problem. And all is ok in 65.0.0-pre01
my code: browser.Load(url); if (!url.Equals("about:blank")) { browser.Load(url); browser.BringToFront(); }
Notes: When the page is in the about:blank state, Load(url) twice , it will go wrong