简体   繁体   English

Delphi TChromium CEF3运行时创建的浏览器无法正确加载页面

[英]Delphi TChromium CEF3 run-time created browser loads pages incorrectly

I'm using TChromium for authorisation. 我正在使用TChromium进行授权。 I have variable Chromium1: TChromium; 我有变量Chromium1: TChromium; . I need to destroy chromium on form hide and show on form show. 我需要销毁表格皮革上的铬,然后在表格上显示。 (Because chromium some times raises exception "EExternal Exception in module libcef.dll" and crashes my app, I think that destruction of Chromium when it no uses will help). (因为铬有时会引发异常“模块libcef.dll中的EExternal异常”并使我的应用程序崩溃,因此我认为在不使用Chromium时将其销毁会有帮助)。 I have: 我有:

procedure TAuthForm.FormShow(Sender: TObject);
begin
  Chromium1 := TChromium.Create(self);
  Chromium1.Align := alClient;
  Chromium1.OnJsdialog := Chromium1Jsdialog;
  Chromium1.OnBeforePopup := Chromium1BeforePopup;
  Chromium1.DefaultUrl := 'about:blank';
  Chromium1.Parent := Self;
  Chromium1.Load(AUTH_URL);
end;

procedure TAuthForm.FormHide(Sender: TObject);
begin
  Chromium1.Free;
end;

The problem is that when TAuthForm.FormShow called first, page loads correctly, but when I hide form and show it again browser displays page incorrectly, don't now how to explain here is an example for http://google.com/ : 问题是,当第TAuthForm.FormShow调用TAuthForm.FormShow时,页面正确加载,但是当我隐藏表单并再次显示它时,浏览器显示页面不正确,现在不解释如何了http://google.com/的示例:

Google(function(){ window.google={kEI:"oKRKUZ2iHafP4QTXwYCwDw",getEI:function(a)    {for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI},https:function(){return"https:"==window.location.protocol},kEXPI:"17259,39523,4000116,4001076,4001568,4001948,4001959,4001975,4002562,4002734,4002855,4003178,4003387,4003495,4003917,4004181,4004213,4004257,4004334,4004340,4004479,4004652,4004653,4004697,4004730,4004755,4004759,4004766,4004898,4004905,4004949,4004953,4005154",kCSI:{e:"17259,39523,4000116,4001076,4001568,4001948,4001959,4001975,4002562,4002734,4002855,4003178,4003387,4003495,4003917,4004181,4004213,4004257,4004334,4004340,4004479,4004652,4004653,4004697,4004730,4004755,4004759,4004766,4004898,4004905,4004949,4004953,4005154",ei:"oKRKUZ2iHafP4QTXwYCwDw"},authuser:0,ml:function(){},pageState:"#",kHL:"ru",time:function(){return(new Date).getTime()},log:function(a, b,c,h){var d=new Image,f=google.lc,e=google.li,g="";d.onerror=d.onload=d.onabort=function(){delete f[e]};f[e]=d;!c&&-1==b.search("&ei=")&&(g="&ei="+google.getEI(h));c=c||"/gen_204?........

it shows the content of all blocks including <title> and <script> as you can see here... 它显示了包括<title><script>在内的所有块的内容,如您在此处看到的...

I've tried to find the solution, but found only the same error(I mean libcef.dll exception without solution), here: https://stackoverflow.com/questions/13784792/cef3-application-crash-fault-module-kernelbase-dll in comments... 我试图找到解决方案,但只发现了相同的错误(我的意思是没有解决方案的libcef.dll异常),在这里: https ://stackoverflow.com/questions/13784792/cef3-application-crash-fault-module- 注释中的kernelbase-dll ...

Chromium1.Free; 铬1.免费; is the pbm it destroys your chrom instance , son you can't re see it again 是pbm会破坏您的chrom实例,儿子,您再也看不到它了

just do : 做就是了 :

Chromium1.visible := false; Chromium1.visible:= false; // if you wish to hide it //如果您想隐藏它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM