简介
Chromium Embedded Framework (CEF)是由 Marshall Greenblatt 在2008年创办的开源项目,致力于基于Google Chromium项目开发一个Web控件。 CEF目前已支持多种编程语言和操作系统,能方便地集成到现有或者新的应用程序中,设计上,它追求高性能的同时,也追求易于使用,它的基本框架通过原生库提供C和C++的编程接口,这些接口将宿主程序与Chromium与WebKit的实现细节隔离,能让浏览器与应用程序无缝集成,并支持自定义插件、协议、Javascript对象与扩展。宿主程序还能根据需要控制资源加载、页面跳转、上下文菜单、打印等等。这些好处都是在支持Google Chrome同等效率与HTML5技术可用的基本上提供的。大量的个人与组织为CEF的开发提供了时间与资源上的贡献,但是我们需要社区更多的投入,来支持CEF核心项目与扩展地对其它语言与框架提供支持的项目(参见扩展项目一节)。如果你有兴趣为CEF提供时间与金钱上的支持,请参见
页面。
编译发行版本
编译发行版本,包涵所有构建基于CEF应用程序所需的文件,在下载章节提供下载,该版本是可以独立使用的,不依赖于CEF或者Chromium的源代码。
源代码发行版本
CEF项目是Chromium项目(http://chromium.org)的扩展项目,因此,要编译CEF源代码需要先下载Chromium源代码(下载方式见http://dev.chromium.org/developers/how-tos/get-the-code)并且根据你所选的系统与编译指示安装所有依赖的项目;然后,将CEF的文件放在Chromium的src目录顶层,跟base/chrome/thrid-party这些目录一起,比方说如果你的Chromium安装目录是C:\svn\Chromium\src那么CEF的文件应该在C:\svn\Chromium\src\cef。 文件有CEF与Chromium版本兼容性的说明信息,如果要将Chromium升级某一版本,使用
gclient sync --revision src@#### --force,此外,DEPS文件将确保其它目录以合适的形式下载。在大多数系统下,编译需要提供至少4GB内存。
在Windows下编译
跟随你的Visual Studio版本的 ,运行CEF根目录下的cef_create_projects.bat脚本,根据的配置生成Visual Stodio项目文件。如果你机器上同时安装了VS2005和VS2008,那么在运行cef_create_projects脚本前,可通过设置GYP_MSVS_VERSION 环境变量为"2005" 或"2008"来指定版本。
通过将gclient工具集成到CEF,可以自动在Chromium源代码更新后下载CEF源代码更新和运行cef_create_projects。编辑位于Chromium src目录父目录(上例中是"C:\svn\Chromium") 的.gclient文件,在已有的solutions数组中添加如下的行:
solutions = [ { #Existing definitions here... }, # BEGIN NEW LINES { "name" : "src/cef", "url" : "http://chromiumembedded.googlecode.com/svn/trunk", }, #END NEW LINES ]
Mac OS X下编译
目前仅支持Mac OS X 10.6 (Snow Leopard) 和10.7 (Lion) ,编译结果可运行于10.5, 10.6 and 10.7。根据正确的配置系统,如果是10.7和Xcode 4,请遵循中额外的编译指示。
运行CEF根目录下的cef_create_projects.sh可根据的配置生成XCode项目文件。
Linux下的编译
开发中。
扩展项目
CEF基础框架支持C和C++语言,感谢其它维护者的努力工作,CEF可以支持更多的编程语言与框架。这些扩展项目并非由CEF团队维护,所以如果你有任何问题,请直接联系各项目的维护者。
- .Net -
- .Net -
- Delphi -
- Java -
如果你维护着一个不在这个列表中的项目,请到发贴或者直接联系Marshall。
支持
提供使用CEF的概览,CEF支持与相关讨论在中进行。
帮助
CEF仍有大量工作需要开展,如果你想为CEF做出贡献请查看Open状态的Issue,或者在CEF的源代码中搜索TODO,我们还需要人为所有支持的功能编写测试用例。
重大更改
此处并未列出所有的版本,完整版本列表请查看 。
9月 23, 2011: 编译版本293,添加对VS2010的支持,并包含以下改进与Bug修复:
- 将char16_t更名为char16修复VS2010因char16_t变成内建类型造成的编译错误 ().
- 自定义Sheme支持异步处理响应 ().
- 添加CefDragHandler支持拖放数据与取消拖放请求的体验().
- 添加CefBrowser::HasDocument()方法,用于测试document是否已完成加载 ().
- CefBase类添加虚析构函数().
- 修复使用V8造成的内存泄漏 ().
- 提升 V8 字符串转换效率 ().
- 增加V8存取器的异常返回能力().
- 如果V8处理程序没有返回值,返回undefined取代返回null().
- 由于实现bug的问题,默认情况下关闭合成加速(, , ).
August 9, 2011: Binary release 275 contains the following enhancements and bug fixes.
- 关闭触摸屏的支持,以使Google Map API功能正常().
- 修复一个执行大量同步加载请求时死循环的bug ().
- 修复OnResourceResponse拼写错误().
- 修复一个在某些情况下关机时会造成Crash的线程问题().
- 增加accelerated_video_enabled, accelerated_drawing_enabled 和accelerated_plugins_enabled浏览器设置().
- 添加在某些windows机器上加速内容需要的d3dx9_43.dll和d3dcompiler_43.dll文件().
- 清理模态窗口回调实现 ().
- 关闭语音输入,避免在Google搜索页面点话筒图标会crash的问题。 ().
- 当将drag_drop_disabled 设为true时禁用HTML5 drag().
- 修复在取消popup窗口时crash的问题().
June 14, 2011: Binary release 259 significantly revamps the CEF API and contains the following enhancements and bug fixes.
- 使用angle库支持GL ().
- CefV8Value 添加Date类型支持().
- Add a workaround for the SyncRequestProxy deadlock problem ().
- Replace CefHandler with a new CefClient interface and separate handler interfaces ().
- Add support for virtual inheritance to allow multiple CefBase parented interfaces to be implemented in the same class ().
- Replace CefThreadSafeBase with IMPLEMENT macros to support virtual inheritance and to only provide locking implementations when needed ().
- Move the CefBrowserSettings parameter from CefInitialize to CreateBrowser ().
- Add a new cef_build.h header that provides platform-specific and OS defines ().
- Introduce the use of OVERRIDE to generate compiler errors on Windows if a child virtual method declaration doesn't match the parent declaration ().
- Move CEF header files that should not be directly included by the client to the "include/internal" folder ().
- Add support for navigator.onLine and online/offline window events ().
- Use NDEBUG instead of _DEBUG because _DEBUG is not defined on Mac ().
- Add OnResourceReponse and CefContentFilter for viewing and filtering response content ().
- Add support for setting response header values ().
- Break CefRegisterScheme into separate CefRegisterCustomScheme and CefRegisterSchemeHandlerFactory functions ().
- Allow registration of handlers for built-in schemes ().
- Supply scheme and request information to CefSchemeHandlerFactory::Create ().
- Add CrossOriginWhitelist functions for bypassing the same-origin policy with both built-in and custom standard schemes ().
- Add support for modal dialogs ().
- Add support for IME-aware applications ().
- Restore keyboard focus on window activation ().
- Fix bug when dragging to a window before mouse events have been detected ().
May 10, 2011: Binary release 231 contains the following enhancements and bug fixes.
- Add cookie get/set support ().
- Allow custom schemes to cause redirects ().
- Set the libcef.dll version number to the build revision number ().
- Add support for returning an HTTP status code from HandleBeforeResourceLoad and custom scheme handlers via the CefResponse class ().
- Add support for V8 accessors and entering a V8 context asynchronously ().
- Don't load URLs twice for popup windows ().
- Make modal popup windows behave the same as non-modal popup windows ().
- Force Flash and Silverlight plugins to use windowless mode when rendering off-screen ().
- Don't download files that will be loaded by a plugin ().
- Add a CefDOMNode::IsSame() method for comparing CefDOMNode objects.
March 25, 2011: Binary release 212 contains the following enhancements and bug fixes.
- Add off-screen rendering support ().
- Add persistent storage support for cookie data ().
- Allow registration of non-standard schemes ().
- Improve the behavior of HandleAddressChange, HandleTitleChange, HandleLoadStart and HandleLoadEnd notifications ().
- Respect the WS_VISIBLE flag when creating browser windows ().
- Fix a bug in CefWebURLRequest that could result in inappropriate calls to CefHandler methods ().
- Add a history entry when navigating to anchors within the same page ().
- Add a HandleNavStateChange notification for back/forward state changes ().
- Fix crash when using WebKit inspector break points ().
- Add support for retrieving values from DOM form elements using CefDOMNode::GetValue.
- Add the CefRunMessageLoop() function for efficient message loop processing in single-threaded message loop mode.
February 28, 2011: Binary release 195 contains the following enhancements and bug fixes.
- Add the CefWebURLRequest class that supports direct loading of URL resources from client applications ().
- Add CefDOM classes and the CefFrame::VisitDOM method that allow direct access to and modification of the DOM ().
- Add support for the HTML5 drag and drop API and support for dragging content to other applications or the desktop ().
- Add a CefV8Context object and CefV8Value::ExecuteFunctionWithContext method to support asynchronous V8 callbacks ().
- CefRegisterPlugin now only supports a single mime type per registration.
- Fix a bug where URL and title change notifications were not being sent for CefFrame::LoadString.
February 1, 2011: Binary release 181 will be the last binary release that includes libraries for VS2005. It contains the following enhancements and bug fixes.
- Improve thread safety by making some methods only callable on the UI thread ().
- Add NewCefRunnableMethod and NewCefRunnableFunction templates (in cef_runnable.h) that simplify task posting ().
- Add a boolean argument to the HandleLoadStart and HandleLoadEnd events that will be true while the main content frame is loading (, ).
- Add an HTTP status code argument to the HandleLoadEnd event ().
- Only call the HandleAddressChange and HandleTitleChange events for the main content frame load ()
- Pass the URL for new popup windows to the HandleBeforeCreated event ().
- Add members to the CefSettings structure for specifying log file location and severity level ().
- Add single sign-on support ().
- Add zooming support ().
- Add developer tools support ().
- Add a HandleProtocolExecution event for handling unregistered protocols ().
- Add a HandleStatus event for status messages, mouse over URLs and keyboard focus URLs ().
- Add support for creating and parsing URLs via CefCreateURL and CefParseURL ().
- Fix the problem with frame activation when displaying SELECT list popups ().
- Accelerated compositing and HTML5 video now work together ().
November 22, 2010: introduces a number of long-awaited features and a few important bug fixes.
- The API now uses CefString and cef_string_t types instead of std::wstring and wchar_t. The new types support conversion between ASCII, UTF-8, UTF-16 and UTF-32 character formats and the default character type can be changed by recompiling CEF ().
- Allow customization of global and per-browser settings for everything from User-Agent and plugin search paths to specific WebKit features ().
- Add support for accelerated compositing and fast WebGL (). You will need to disable accelerated compositing to watch HTML5 video with this release ().
- Expose popup window feature information via the CefPopupFeatures argument passed to CefHandler::HandleBeforeCreated ().
- Fix a crash caused by Flash-related JavaScript ().
November 15, 2010: provides the first working build of CEF for the Mac OS X platform (). There's still a lot of work required to bring it up to par with the Windows port. Missing features are indicated by "TODO(port)" comments in the source code. Help with fixing bugs and implementing missing features is welcome.
October 24, 2010: disables WebGL support due to performance problems with the default Chromium implementation. WebGL support will be re-enabled once a better-performing implementation is available ().
- Add a CefHandler::HandleDownloadResponse() method for handling Content-Disposition initiated file downloads ().
- Add XML parsing support with CefXmlReader and CefXmlObject classes ().
- Add Zip archive reading support with CefZipReader and CefZipArchive classes ().
- Add a new cef_wrapper.h header file that exposes helpful utility classes provided as part of the libcef_dll_wrapper target.
October 15, 2010: causes CEF to ignore the "Automatically detect settings" option under LAN Settings in order to fix a problem with slow resource loading on Windows (). Manual configuration under LAN Settings is still respected.
- Add a CefBrowser::ReloadIgnoreCache() method and MENU_ID_NAV_RELOAD_NOCACHE menu support. ().
- Add support for audio playback with HTML5 video ().
- Fix back/forward navigation when the history contains pages that failed to load ().
- Change the CEF User-Agent product version to "Chrome/7.0.517.0"
August 31, 2010: re-introduces the CefHandler::HandleJSBinding method. The memory leaks that necessitated the elimination of this method have now been fixed ().
- The CefRequest argument to CefHandler::HandleBeforeResourceLoad can now be modified allowing the request to be changed on the fly ().
- A default tooltip implementation is now provided and tooltip text can be modified using CefHandler::HandleTooltip ().
- Printing paper size, orientation and margins can now be changed using CefHandler::HandlePrintOptions ().
- Find in page with result highlighting is now supported using CefBrowser::Find, CefBrowser::StopFinding and CefHandler::HandleFindResult.
- The binary release of provides libraries for both Visual Studio 2005 and Visual Studio 2008. It can be downloaded from the project Downloads page.
April 7, 2010: eliminates the CefHandler::HandleJSBinding method. This modification addresses memory leaks that many users have been reporting. For more information see .
October 2, 2009: adds for generating the CEF project files. This makes it easy to build CEF with both VS2005 and VS2008. See the "Source Distributions" section above for additional details.
August 21, 2009: adds support for custom scheme handlers. Use the new CefRegisterScheme() function in combination with the CefSchemeHandlerFactory and CefSchemeHandler classes to create handlers for requests using custom schemes such as myscheme://mydomain.
July 24, 2009: helps to speed up the addition of new features and bug fixes to CEF. It adds the CEF Patch Application Tool and the "patch" project which together support automatic application of patches to the Chromium and WebKit source trees as part of the build process. See the README.txt file in the new patch directory for additional information.
July 8, 2009: CEF now has a dedicated build bot thanks to Nicolas Sylvain and Darin Fisher over at Google. The build bot synchronizes to each Chromium revision and then builds CEF, reporting on any compile errors that occur. Having a build bot for CEF will help the Chromium developers avoid accidentally breaking API features required by CEF, and help the CEF developers keep up with the frequently changing Chromium HEAD revision. You can view the build bot output at
June 20, 2009: adds the CEF Translator Tool which facilitates automatic generation of the C API header file (cef_capi.h) and CToCpp/CppToC wrapper classes. See the translator.README.txt file in the new tools directory for additional information. Introduction of this tool required minor changes to the CEF C++ and C APIs.
- The C++ 'arguments' attribute of CefV8Handler::Execute() and CefV8Value::ExecuteFunction() now has the 'const' qualifier.
- C API global function names that were previously in the cef_create_classname() format are now in the cef_classname_create() format.
- The C API cef_frame_t::get_frame_names() member function now has return type 'void' instead of 'size_t'.
- The C API cef_frame_t::execute_javascript() member function has been renamed to cef_frame_t::execute_java_script().
May 27, 2009: introduces two major changes to the CEF framework.
- Frame-dependent functions such as loading content and executing JavaScript have been moved to a new CefFrame class. Use the new CefBrowser::Get*Frame() methods to retrieve the appropriate CefFrame instance. A CefFrame instance will now also be passed to CefHandler callback methods as appropriate.
- The CEF JavaScript API now uses the V8 framework directly instead of creating NPObjects. JavaScript object hierarchies can be written in native C++ code and exported to the JavaScript user-space, and user-space object hierarchies can be accessed from native C++ code. Furthermore, support for the V8 extension framework has been added via the new CefRegisterExtension() function. The CefJSHandler and CefVariant classes have been removed in favor of new CefV8Handler and CefV8Value classes. To attach values to the JavaScript 'window' object you must now implement the CefHandler::HandleJSBinding() callback method instead of calling the (now removed) CefBrowser::AddJSHandler() method.