我正在使用 TChromium 进行授权。我有变量Chromium1: TChromium;
。我需要在表单隐藏上销毁铬并在表单显示上显示。(因为 chromium 有时会引发异常“模块 libcef.dll 中的 EExternal Exception”并使我的应用程序崩溃,我认为在不使用 Chromium 时销毁它会有所帮助)。我有:
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;
问题是,当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?........
它显示了所有块的内容,包括<title>
和<script>
你可以在这里看到的......
我试图找到解决方案,但只发现相同的错误(我的意思是没有解决方案的 libcef.dll 异常),这里:https ://stackoverflow.com/questions/13784792/cef3-application-crash-fault-module- kernelbase-dll在评论中...