C# : CEF操作
代码挺差的,仅供学习、参考
class CEFGlueLoader
{
class CefAppImpl : CefApp
{
protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
{
commandLine.AppendArgument("enable-npapi");
commandLine.AppendSwitch("enable-media-stream", "enable-media-stream");
commandLine.AppendSwitch("process-per-site");
commandLine.AppendSwitch("ppapi-flash-version", "23.0.0.185");//PepperFlash\manifest.json中的version
commandLine.AppendSwitch("ppapi-flash-path", "PepperFlash\\pepflashplayer.dll");
}
} public static void InitCEF()
{
#if !_ORG_MANAGER && !_MBMAKER
CefRuntime.Load();
string[] args = new string[];
var mainArgs = new CefMainArgs(args);
var app = new CefAppImpl();
var exitCode = CefRuntime.ExecuteProcess(mainArgs, app);
System.Diagnostics.Trace.WriteLine("CefRuntime.ExecuteProcess return: " + exitCode);
if (exitCode != -)
{
return;
} var settings = new CefSettings
{
BrowserSubprocessPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\Cef3Process.exe"),
SingleProcess = false,
MultiThreadedMessageLoop = true,
LogSeverity = CefLogSeverity.Default,
LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"log\CefGlue.log"),
CachePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"cache"),
CommandLineArgsDisabled = true,
Locale = "zh_CN",
LocalesDirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\locales"),
RemoteDebuggingPort = , };
CefRuntime.Initialize(mainArgs, settings, app); if (!settings.MultiThreadedMessageLoop)
{
System.Windows.Forms.Application.Idle += (sender, e) => { CefRuntime.DoMessageLoopWork(); };
}
#endif
} private static string GetPath(string v)
{
return Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, v));
} public static void ShutDownCEF()
{
#if !_ORG_MANAGER && !_MBMAKER
try
{
CefRuntime.Shutdown();
}
catch (Exception)
{
}
#endif
}
}
C# : CEF操作的更多相关文章
- CEF 支持JSON操作
转载:https://blog.csdn.net/foruok/article/details/50687864(解析json) 转载:https://blog.csdn.net/foruok/art ...
- cisco 下CEF(简介)[转载]
cisco 下CEF(简介) 转自:http://blog.51cto.com/chengmingshu/803358 cms_cmd1人评论2570人阅读2012-03-12 00:09:29 ...
- qt添加cef库嵌入web [转]
qt cef嵌入web 原文http://blog.sina.com.cn/s/blog_9e59cf590102vnfc.html 最近项目需要,研究了下libcef库. Cef(Chromium ...
- 使用C#在CEF中拦截并响应请求
一.前言 忙里偷闲,研究了一下如何在CEF中拦截请求,并作出响应.这个功能对某些需要修改服务器响应的需求来说必不可少,可以直接读取本地文件作为响应内容. C#的CEF封装项目有很多,我使用的是Chro ...
- Duilib嵌入CEF以及JavaScript与C++交互
转载:http://blog.csdn.net/foruok/article/details/50573612 转载:http://blog.csdn.net/foruok/article/detai ...
- 初识CEF
介绍 CEF全称Chromium Embedded Framework,是一个基于Google Chromium 的开源项目.Google Chromium项目主要是为Google Chrome应用开 ...
- CEF使用的几个注意点
CEF为chrome浏览器的切入其他浏览器中的轻量级框架. 开发的客户端的时候,这是作为界面显示的首先,可以增强客户的易变性,可塑性. 在开发的过程中(侧重于C,C++解决),遇到的几个问题,以及自己 ...
- 允许CEF跨域访问iframe
默认情况下,如果嵌入本地Web页面,并在页面内部使用iframe来显示一个在线页面,加载的过程中会触发一个未捕获异常,虚函数CefV8ContextHandler::OnUncaughtExcepti ...
- CEF中文教程(google chrome浏览器控件) -- Windows下编译Chromium
CEF中文教程(google chrome浏览器控件) -- CEF简介 2013-04-10 16:48 42928人阅读 评论(4) 收藏 举报 分类: CEF(2) 目录(?)[+] ...
随机推荐
- px与rem关系及转换
PX特点 1. IE无法调整那些使用px作为单位的字体大小:2. 国外的大部分网站能够调整的原因在于其使用了em或rem作为字体单位:3. Firefox能够调整px和em,rem,但是96%以上的中 ...
- 创建两个对象的两种方法,一中\new,另外一种不new
方法一: String s1=new String("hello"); String s2=new String("hello"); 这里是new了 ...
- Mac 安装activate-power-mode atom
Mac 安装activate-power-mode atom 标签: atommac 2015-12-02 14:53 308人阅读 评论(0) 收藏 举报 分类: git(2) 版权声明:本文为 ...
- web自动化测试中绕开验证码登陆的方式
web自动化测试中登陆需验证码是很大的一个困扰.现推荐一种简单的避开验证码登陆的方式,先代码进入登录页,人工输入验证码登录后浏览器自动保存cookie,再在新的标签中登录. 具体代码如下: publi ...
- 数值分析之QR因子分解篇
在数值线性代数中,QR因子分解的思想比其他所有算法的思想更为重要[1]. --Lloyd N. Trefethen & ...
- 在将 varchar 值 '' 转换成数据类型 int 时失败
我们有时候用in语句的时候,发现存在Sql注入漏洞,想参数化处理一下,遇到语句执行问题!! declare @ids varchar() set @ids='216,218' select * fro ...
- Alamofire 的使用
最近,AFNetworking 的作者Mattt Thompson提交了一个新的类似于 AFNetworking 的网络 基础库,并且是专门使用最新的 Swift 语言来编写的,名为:Alamofir ...
- iscroll 加载不全解决方案
例如上图中,get_kaijiang 中如果执行一段ajax跨域传输的话 function get_kaijiang(){ ajax------- $('#div').append(html); -- ...
- Python学习【第八篇】Set集合
Set集合 set集合是无序,不能重复,可嵌套的序列 如何创建 li = [] dic = {"k1":123} se = {"123","456&q ...
- 利用tween.js算法生成缓动效果
在讲tween类之前,不得不提的是贝塞尔曲线了.首先,贝塞尔曲线是指依据四个位置任意的点坐标绘制出的一条光滑曲线.它在作图工具或动画中中运用得比较多,例如PS中的钢笔工具,firework中的画笔等等 ...