• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Delphi中Chrome Chromium、Cef3学习笔记(六)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

一.CEF加载网页时空白

  chrm1.Load(‘你的网址’);

出现空白,跟踪进去:

    frm := FBrowser.MainFrame;  //此时为nil ,可改为:

    frm := FBrowser.GetMainFrame;  

其他地方同上;


后续待更新。。

二、CEF程序退出时报错

 {$R *.res}
 
procedure RegisterSchemes(const registrar: ICefSchemeRegistrar);
begin
  registrar.AddCustomScheme(\'local\', True, True, False);
end;


begin
//  CefCache := getEnvironmentVariable(\'USERPROFILE\')+\'\GetTBData\cookies\\';
  
  CefCache := \'cache\';
  CefOnRegisterCustomSchemes := RegisterSchemes;
  CefSingleProcess := False;
  if not CefLoadLibDefault then
    Exit;


//  CefUserAgent := \'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0;\';
//  CefUserAgent := \'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\';
  Application.Initialize;
  Application.CreateForm(TuMain, uMain);
  Application.Run;
end.

三、Cef3加载flash网页方法:

修改ceflib.pas:

  procedure TInternalApp.OnBeforeCommandLineProcessing(const processType: ustring;
      const commandLine: ICefCommandLine);
  begin
    CommandLine.AppendSwitch(\'ppapi-out-of-process\');
    CommandLine.AppendSwitchWithValue(\'ppapi-flash-version\', \'22.0.0.168\');
    CommandLine.AppendSwitchWithValue(\'ppapi-flash-path\', \'Plugins\\pepflashplayer.dll\');


    if Assigned(CefOnBeforeCommandLineProcessing) then
      CefOnBeforeCommandLineProcessing(processType, commandLine);
  end;

网上下载pepflashplayer.dll放入..\Plugins\\目录下面。

四、cef3启动加载flash网页时Dos窗口闪一下的问题

网上的解决方法,参考此文。

http://blog.csdn.net/zx2356/article/details/51514403

按照该文及提供的下载挂钩createProcessA,在xp上无效。

2.解决方法

有可能createprocessw也得挂钩。但懒得修改了。因此决定改为反编译flash插件,看看显示命令行窗口的逻辑。

反编译flash插件。发现显示cmd的逻辑是,读取环境变量comspec(cmd.exe的全路径),读取到就执行它,读取不到执行cmd.exe.

用winhex修改flash插件,搜索comspec为soms1ec,修改cmd.exe为cm1.exe.

重新测试,成功。


修改后插件下载链接

http://download.csdn.net/detail/qsy2000/9768385


转载请注明出处,原文地址:

http://blog.csdn.net/xtfnpgy/article/details/71703317



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi中Chrome Chromium、Cef3学习笔记(三)发布时间:2022-07-18
下一篇:
Delphi与DirectX之DelphiX(74):TDIB.EncryptDecrypt();发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap