Skip to content

Web Guide I : Cef

Dani John edited this page Jun 20, 2021 · 55 revisions

Chromium Embedded Framework

Lively bundles lightweight chromium rendering engine CEF.

Everything that works on regular browser will work the same, including some added features such as retrieving system information.

Why bundle a full web browser, why not use already installed browser on the system?

Namely two reasons:

  • To avoid --allow-file-access-from-files flag or server setup.
  • Fullcontrol

--allow-file-access-from-files

Web browsers block local disk file access to webpages for security reasons, inorder to make html files on disk work offline it is required to either set up a server or use the browser flag --allow-file-access-from-files. The flag option is highly dangerous because it exposes all your disk data to the website.

There is a third option, you can make a custom function that scans the subdirectories of the parent html and load only the required files which is what lively is doing with Cefsharp RegisterScheme() function.

Fullcontrol

Lively has complete control over the browser instance and its actions.

Some difference between Lively browser from regular browser behavior

  • Video/audio autoplay is allowed, no need to mute audio.
  • Lively API support for System Data and Input.
  • Hyperlinks open in the same window.
  • Custom link handling for Shadertoy and Youtube.
  • Right click menu is disabled.
  • File downloading is disabled.
  • Uses memory cache, settings and cookie gets removed on exit (disk cache can be configured in lively settings.)
  • Minimal - no extension support, less RAM usage...

WebView2 (Microsoft Edge)

Uses the native operating system Chromium Edge browser, currently under development.

Requires installation of WebView2 runtime on system if missing:

https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section