gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 02:26:17 26 4
gpt4 key购买 nike

我正在使用 TChromium 进行授权。我有变量 Chromium1: TChromium; 。我需要销毁表单隐藏上的 Chrome 并在表单显示上显示。 (因为 chromium 有时会引发异常“模块 libcef.dll 中的 EExternal Exception”并使我的应用程序崩溃,我认为在不使用 Chromium 时销毁 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?........

它显示了所有 block 的内容,包括 <title><script>正如你在这里看到的...

我试图找到解决方案,但只发现相同的错误(我的意思是libcef.dll异常没有解决方案),这里:https://stackoverflow.com/questions/13784792/cef3-application-crash-fault-module-kernelbase-dll在评论中...

最佳答案

Chromium1.Free;是 PBM它会破坏你的 chrom 实例,你再也看不到它了

就这样做:

Chromium1.visible := false;//如果你想隐藏它

关于Delphi TChromium CEF3 运行时创建的浏览器加载页面不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15540792/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com