【WebKit内核 CEF3 】 第一篇:下载分支代码并本地编译

关于CEF  Chromium Embedded Framework 简单说就是  WebKit内核的 对外绑定。

当前主流浏览器内核

  1. 一、Trident内核代表产品Internet Explorer,又称其为IE内核。Trident(又称为MSHTML),是微软开发的一种排版引擎。使用Trident渲染引擎的浏览器包括:IE、傲游、世界之窗浏览器、Avant、腾讯TT、Netscape 8、NetCaptor、Sleipnir、GOSURF、GreenBrowser和KKman等。
  2.  

    二、Gecko内核代表作品Mozilla FirefoxGecko是一套开放源代码的、以C++编写的网页排版引擎。Gecko是最流行的排版引擎之一,仅次于Trident。使用它的最著名浏览器有Firefox、Netscape6至9。

  3.  

    三、WebKit内核代表作品Safari、Chromewebkit 是一个开源项目,包含了来自KDE项目和苹果公司的一些组件,主要用于Mac OS系统,它的特点在于源码结构清晰、渲染速度极快。缺点是对网页代码的兼容性不高,导致一些编写不标准的网页无法正常显示。主要代表作品有Safari和Google的浏览器Chrome。

虽然  win 10后 ,微软开发了 edge  这个兼容 Trident webkit  ,但是不得不说,WebKit内核真快!

webkit 早起于苹果公司的safari .苹果把webkit 开放出去后,谷歌 把这东东优化了,还把自己家的V8引擎集成到自己的浏览器里了。。谷歌浏览器,速度真快。

WebKit is the web browser engine used by Safari, App Store, and many other OS X, iOS, and Linux applications. Web developers can stay updated on feature supportfollow development on the blog,

浏览器对于web应用起到了决定性的作用。微软捆绑自己操作系统。。自带IE 。。。。不仅慢 卡顿假死 响应慢 兼容差 迭代慢..........一堆问题。谷歌浏览器迅速占领了一部分市场。

把 Chrome 的内核嵌入到桌面程序 ,混合式的开发,越来越常见。

1 基于微软的Web 交互 mshtml 提供了COM接口。但是 卡的要命,兼容差。老版本的上个淘宝都不行........

2 基于其他浏览器内核的 主要是webkit的绑定。提供对其他开发语言的支持。CEF wekit.net 等

3 NW.JS ,这个集成了 node.js 和webkit内核的东东,可以使用html  js 开发本地应用。最新版本的饿了么上家客户端 就是这个技术。

看具体场景,选择合适的技术。

我们先说 CEF 3。。。。。

其实就是libcef

libcef 
Chromium嵌入式框架对于嵌入chromium浏览器的其他应用程序来说是一个简单的框架。。其遵循建立于2008年Marshall Greenblatt 的BSD许可协议。基于Google Chromium工程。不像Chromium工程本身,主要集中开发Google Chrome应用程序,CEF聚焦于使用第三方嵌入浏览器的应用程序, 通过提供稳定的API,CEF将chromium底层以及复杂的Blink代码隔离开来,分支发布紧跟chromium发布,以及二进制发布。大多数CEF的特性都有默认的实现,其功能了丰富的功能,较少甚至没有集成工作需要去做。目前全球有超过1亿CEF运行实例,其嵌入在广泛公司和企业的嵌入式产品中。

下载代码

https://bitbucket.org/chromiumembedded/cef/downloads/?tab=branches

从上面的官方站点 下载合适版本的代码

注意:分支 2623 是支持XP的最后一个分支。以后都是不支持XP的。

开始配置编译环境:参考:http://blog.csdn.net/wangshubo1989/article/details/50167045

http://www.cnblogs.com/visio/p/6295451.html

Using CMake 
Starting with 2171 branch the CEF3 sample applications can be built using CMake, a cross-platform open-source build system that can generate project files in many different formats. See the comments at the top of the CMakeLists.txt file included with the binary distribution for platform-specific CMake usage instructions.

这个时候,需要下载CMake了,这是什么鬼? 
CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程)。他能够输出各种各样的makefile或者project文件,能测试编译器所支持的C++特性,类似UNIX下的automake。 
下载地址: 
https://cmake.org/

下载后安装,没有什么特别的地方。

接下来就是使用cmake了: 

Browse Source选择刚刚解压的libcef文件夹,最外面的奥!! 
Browse Build选择要把生成的工程放在哪里。 
点击Generate,然后选择现在使用的VS版本,就可完成。 

接下来就可以打开cef.sln了,然后可以运行里面的例子。

The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromium-based browsers in other applications. This repository hosts a sample project called "cef-project" that can be used as the starting point for third-party applications built using CEF.

Quick Links

Setup

First install some necessary tools and download the cef-project source code.

1. Install CMake, a cross-platform open-source build system. Version 2.8.12.1 or newer is required.

2. Install Python. Version 2.x is required. If Python is not installed to the default location you can set the PYTHON_EXECUTABLE environment variable before running CMake (watch for errors during the CMake generation step below).

3. Install platform-specific build tools.

  • Linux: Currently supported distributions include Debian Wheezy, Ubuntu Precise, and related. Ubuntu 14.04 64-bit is recommended. Newer versions will likely also work but may not have been tested. Required packages include: build-essential, libgtk2.0-dev, libgtkglext1-dev.
  • macOS: Xcode 6 or newer building on macOS 10.9 (Mavericks) or newer is required. Xcode 8.3 and macOS 10.12 (Sierra) are recommended. The Xcode command-line tools must also be installed. Only 64-bit builds are supported on macOS.
  • Windows: Visual Studio 2013 or newer building on Windows 7 or newer is required. Visual Studio 2015 Update 3 and Windows 10 64-bit are recommended.

4. Download the cef-project source code from the Downloads page or by using Git command-line tools:

git clone https://bitbucket.org/chromiumembedded/cef-project.git

Build

Now run CMake which will download the CEF binary distribution from the Spotify automated builder and generate build files for your platform. Then build using platform build tools. For example, using the most recent tool versions on each platform:

cd /path/to/cef-project

# Create and enter the build directory.
mkdir build
cd build

# To perform a Linux build using a 32-bit CEF binary distribution on a 32-bit
# Linux platform or a 64-bit CEF binary distribution on a 64-bit Linux platform:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4 cefclient cefsimple

# To perform a macOS build using a 64-bit CEF binary distribution:
cmake -G "Xcode" ..
# Then, open build\cef.xcodeproj in Xcode and select Product > Build.

# To perform a Windows build using a 32-bit CEF binary distribution:
cmake -G "Visual Studio 14" ..
# Then, open build\cef.sln in Visual Studio 2015 and select Build > Build Solution.

# To perform a Windows build using a 64-bit CEF binary distribution:
cmake -G "Visual Studio 14 Win64" ..
# Then, open build\cef.sln in Visual Studio 2015 and select Build > Build Solution.

CMake supports different generators on each platform. Run cmake --help to list all supported generators. Generators that have been tested with CEF include:

  • Linux: Ninja, Unix Makefiles
  • macOS: Ninja, Xcode 6+
  • Windows: Ninja, Visual Studio 2013+

Ninja is a cross-platform open-source tool for running fast builds using pre-installed platform toolchains (GNU, clang, Xcode or MSVC). See comments in the "third_party/cef/cef_binary_*/CMakeLists.txt" file for Ninja usage instructions.

Next Steps

Here are some activities you might want to try next to gain a better understanding of CEF:

1. Update the CEF version used to build your local copy of cef-project:

2. Add your own project source code:

  • Create a new "myproject" directory in the root cef-project directory (e.g. "/path/to/cef-project/myproject").
  • Copy the contents of the "third_party/cef/cef_binary_*/cefsimple" directory to "myproject" as a starting point.
  • Add a new add_subdirectory(myproject) command near the end of top-level CMakeLists.txt file after the existing add_subdirectory commands.
  • Change the "CEF_TARGET" and "CEF_HELPER_TARGET" values in "myproject/CMakeLists.txt" from "cefsimple" to "myproject".
  • (Windows only) Rename the "cefclient.exe.manifest" file to "myproject.exe.manifest" in both "myproject/CMakeLists.txt" and the "myproject" directory.
  • Re-run the cmake and build commands.

3. Gain a better understanding of the cefsimple application by reading the Tutorial Wiki page.

4. Fork the cef-project repository using Bitbucket and Git to store the source code for your own CEF-based project. See the ContributingWithGit Wiki page for details (replace all instances of "cef" with "cef-project" in those instructions).

5. Review the GeneralUsage Wiki page for additional details on CEF implementation and usage.

Support and Contributions

If you have any questions about CEF or cef-project please ask on the CEF Forum. If you would like to make contributions please see the "Helping Out" section of the CEF Main Page.

时间: 2024-07-28 20:32:57

【WebKit内核 CEF3 】 第一篇:下载分支代码并本地编译的相关文章

git clone新项目后如何拉取其他分支代码到本地

1.git clone [email protected]:xxx/xxx.git 2.git fetch origin dev    命令来把远程dev分支拉到本地 3.checkout -b dev origin/dev   在本地创建分支dev并切换到该分支 4.git pull origin dev 就可以把远程dev分支上的内容都拉取到本地了 注:当本地代码是dev分支时,需要先 git pull origin dev 更新远程分支代码到本地,然后再git pull (即拉取远程mas

github下载项目代码到本地,不能运行 本地改完代码 再上传

首先用git bash here,在指定目录下执行, git clone 将项目拉取下来, 试运行: 发现需要配置idea的SDK/jdk, 还要选择language level, 建立输出目录target,并配置, 其次找到Project->Modules, 基本的java se项目就可以运行啦, 在有main方法的文件上右键,有run,可以运行这个main方法~ 新建Xxx.java文件, 编写代码, idea提示,是否add? idea在问你是否将该文件添加到git 下次提交的文件堆里?

【记录】git 拉取远程分支代码,同步到另一个git上

最近有需求从某git 上拉取所有分支代码同步到另一git上,现记录操作步骤,以便日后使用: 1:先克隆其中一个分支代码到本地环境 git clone -b test http://账号:密码@XXX.git 2:查看本地分支 git brach 3:查看远程分支 git branch -r 4:查看远程所有分支  远程分支会用红色表示出来(如果你开了颜色支持的话 git branch -a 5:-a命令并没有每一次都从远程更新仓库信息,我们可以手动更新一下 git fetch origin gi

深入了解webkit内核第一篇:JavaScript引擎深度解析

看到HorkeyChen写的文章<[WebKit] JavaScriptCore解析--基础篇(三)从脚本代码到JIT编译的代码实现>,写的很好,深受启发.想补充一些Horkey没有写到的细节比如字节码是如何生成的等等,为此成文. JSC对JavaScript的处理,其实与Webkit对CSS的处理许多地方是类似的,它这么几个部分: (1)词法分析->出来词语(Token): (2)语法分析->出来抽象语法树(AST:Abstract Syntax Tree): (3)遍历抽象语法

Eclipse插件开发 学习笔记 PDF 第一篇到第四篇 免分下载 开发基础 核心技术 高级进阶 综合实例

<<Eclipse插件开发 学习笔记>>,本书由浅入深.有重点.有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章.第一篇介绍Eclipse平台界面开发的基础知识.包含SWT控件的使用.界面布局.事件处理等内容:第二篇是插件开发核心技术,主要介绍插件开发的核心知识要点,包含行为(Action).视图(ViewPart).编辑器(Editor).透视图(Perspective)等10章的内容.第三篇主要讲述插件开发的高级内容,包含开发高级内容.富client平台技术(R

[WebKit内核] JavaScript引擎深度解析--基础篇(一)字节码生成及语法树的构建详情分析

[WebKit内核] JavaScript引擎深度解析--基础篇(一)字节码生成及语法树的构建详情分析 标签: webkit内核JavaScriptCore 2015-03-26 23:26 2285人阅读 评论(1) 收藏 举报  分类: Webkit(34)  JavascriptCore/JIT(3)  版权声明:本文为博主原创文章,未经博主允许不得转载. 看到HorkeyChen写的文章<[WebKit] JavaScriptCore解析--基础篇(三)从脚本代码到JIT编译的代码实现>

[WebKit内核] JavaScriptCore深度解析--基础篇(一)字节码生成及语法树的构建

看到HorkeyChen写的文章<[WebKit] JavaScriptCore解析--基础篇(三)从脚本代码到JIT编译的代码实现>,写的很好,深受启发.想补充一些Horkey没有写到的细节比如字节码是如何生成的等等,为此成文. JSC对JavaScript的处理,其实与Webkit对CSS的处理许多地方是类似的,它这么几个部分: (1)词法分析->出来词语(Token): (2)语法分析->出来抽象语法树(AST:Abstract Syntax Tree): (3)遍历抽象语法

第一篇CodeIgniter框架的下载及安装

初次学习Php,网上搜了很多php框架,最后选择了CodeIgniter. 安装环境:php5+mysql6.5+iis7 我的电脑是用来办公写文档用的,win7系统,不想换系统,所以就安装了win7自带的iis7. php下载的是最新的php-5.3.28-nts-Win32-VC9-x86 mysql也是下载最新的. 下载地址: php:http://windows.php.net/downloads/releases/ mysql:http://dev.mysql.com/download

nginx之旅第一篇:nginx下载安装、nginx配置文件详解、nginx默认网站

一.nginx下载安装 版本nginx 1.15.5 系统环境centos7.5(本机ip192.168.199.228) 关闭selinux 和防火墙firewall 1.下载 wget http://nginx.org/download/nginx-1.15.5.tar.gz -P /usr/src 2.安装 安装大概过程 配置---编译---安装 配置 1)检查环境 是否 满足安装条件 依赖解决 2)指定安装方式 配置文件 命令文件 各种文件放哪里 开启模块功能[内 置模块 三方模块] 3