博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Delphi中Chrome Chromium、Cef3学习笔记(六)
阅读量:6894 次
发布时间:2019-06-27

本文共 1847 字,大约阅读时间需要 6 分钟。

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

转载于:https://www.cnblogs.com/xtfnpgy/p/9285377.html

你可能感兴趣的文章
对不同部门设置不同的共享盘符
查看>>
tcp有限状态机分析
查看>>
工作组和域
查看>>
Linux内核线程
查看>>
yarn和cnpm 配置
查看>>
第四题小案例3
查看>>
设计模式-策略模式
查看>>
Ubuntu 下Rsync配置及使用
查看>>
ipad开发需要投入更多的精力
查看>>
Linux服务器性能评估与优化
查看>>
C#往文件中追加文本内容信息
查看>>
让Openwrt在U盘运行
查看>>
openwrt交叉编译环境
查看>>
金蝶kis记账王管理用户权限的方法
查看>>
分布式设计与开发(二)------几种必须了解的分布式算法
查看>>
JS中typeof与instanceof的区别
查看>>
PHP中str_replace函数使用小结
查看>>
Oracle用户、角色、授权和表空间
查看>>
linux下修改SWAP空间大小
查看>>
我的友情链接
查看>>