The difference between chromium and CEF


The difference between chromium and CEF

Why are most browsers on the market based on chromium rather than CEF.

The difference and relation between chromium and CEF

  • Chrome is an open source browser project led by Google. A browser can be customized quickly and conveniently based on chrome, and most browsers at home and abroad are also developed based on it.
  • CEF is a branch of chromium project. It separates WebKit and kernel layer, provides API interface on content layer, encapsulates complex underlying interface, and makes it more user-friendly. It is mostly used for client development, and realizes rapid development of client interface through built-in page. At present, nailing, enterprise wechat, vscode and many other clients use this framework for development.
  • They can render web pages. They are all open-source frameworks. Chromium is an open-source application of the browser, and has done a lot of work for the common functions of the browser. CEF separates the rendering part and applies it to the embedded web scene of the client, castrating some functions, which is convenient for users to learn and use.

Can browser be developed based on CEF

2.1 what are the advantages and problems

If CEF can satisfy the daily web browsing and is convenient for users, the following argument is made based on this assumption.

1. The reason is that the isolation of CEF interface is relatively friendly, providing a small amount of API can meet the requirements of rendering a page

2. Fast kernel upgrade, the reason: isolation is better, CEF itself will isolate the underlying kernel out of a set of interfaces, the upper application to castrate.

3. Difficulties

If you want to implement a browser with common functions, you need to think about how to solve the following problems.

Because CEF will castrate most of the application layer functions, such as UI, chrome, content and so on, the current browser common functions need to be implemented by themselves in CEF.

3.1 the following technical points are not supported by CEF at present, so we need to think about how to realize them

1. How to realize the UI framework, support all kinds of UI display, right-click menu, banner, bubble, this UI framework involves the most widely, and has higher requirements for performance and scalability, development friendly and so on.

2. How to support the address bar and realize various functions of the address bar, such as association prompt, historical record association, search text association, Collection Association, address bar security logo, etc

3. How to support collection, collection history, collection search, collection synchronization, collection local saving and collection interface display

4. How to support the development of this mode, such as debugging various HTML5 functions such as F12. This function can be implemented through the open interface in CEF. CEF itself supports part of the development mode, which is disabled by default and needs to recapture messages

5. How to support all kinds of built-in pages, JS extension interface, home page setting, and various options setting pages. There are dozens of these pages, which are the function entrance of Chrome browser

6. How to support plug-in function, plug-in drag, unload and run, etc

7. How to manage tags, drag tags, such as: drag tags out to open a new browser, drag tags in to merge two browser windows, etc

8. How to implement browser synchronization mechanism

9. How to realize browser translation function

10. How to realize download module, multi window module and recovery list

11. How to realize mouse gesture and favicon module

12. UA function, new tab