打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

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

一.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


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
vba调用外部程序,厘清shell\run\call的概念 转载
2.CEF常用接口类拦截请求回调函数
HELLO第四课(二):F2812存储器映射及CMD详解 - 日志 - eyes417 -...
CefSharp中文帮助文档
在MFC中使用Chrome浏览器控件
Adobe Flash 无法正常使用怎么办?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服