Giter Site home page Giter Site logo

fpcef3's Introduction

fpCEF3

Chromium Embedded Framework for Free Pascal

How to get started

  • Install cef3.lpk into Lazarus
  • Download CEF3 (standard or minimal distribution). Make sure to use the correct CEF3 version (see the changelog / release tag); other versions (older or newer) usually don't work and are not recommended
  • Create a new project or use one of the projects in the Examples folder. LCLSimple is a good starting point
  • Read the following section on how to correctly set up the file layout

Important:
Most examples use build modes. Make sure to select the correct one, otherwise compilation will fail.

CEF setup

macOS

Follow the instructions on the wiki.

Windows and Linux

A CEF package contains

  • the CEF library itself and related binaries in the Release or Debug folder and
  • resources in the Resources folder.

By default CEF expects the library and binaries in PATH (Windows) or LD_LIBRARY_PATH (Linux) and the the resources in the same folder as the executable. A custom path for the library can be set using CefLibraryDirPath. The path for the resources can be changed by setting CefResourcesDirPath and CefLocalesDirPath. However, some files cannot be moved:

Windows

  • chrome_elf.dll has to be in PATH or the same folder as the executable
  • icudtl.dat has to be in PATH

Linux

  • icudtl.dat and *_blob.bin have to be in the same folder as the executable

Important:
Make sure to include cthreads as the first unit in your main program.
If you build CEF3 yourself make sure tcmalloc is disabled.

Hints

Don't use --single-process or change CefSingleProcess to True. This mode is not officially supported by Chromium.

If the browser goes "blank" (e.g. when loading a page), the render process crashed. See Debugging on how to debug the render process. The render process restarts automatically on the next page request.

SubProcess

If CEF is initialized a subprocess is started. By default a second instance of the main program is used as the subprocess. Nevertheless, the preferred way is to define an own (minimal) subprocess executable. In fpCEF3 this can be done by setting CefBrowserSubprocessPath to the path of the subprocess executable. In the LCLSimple example this setting can be found in the Initialization section at the end of main.pas.

A minimal subprocess can be found in the folder /Examples/SubProcess. The subprocess also needs the CEF3 library and resources in its path, so it is recommended to put the subprocess executable in the same folder as the main exe.
More details can be found here.

Debugging

Sometimes it is useful to debug the subprocesses spawned by cef. On Linux this can be done by adding

--renderer-cmd-prefix='xterm -title renderer -e gdb --args'

to the command line.
Further details can be found here.

Supported platforms

  • Windows
  • Linux (Gtk2 or Qt4)
  • macOS (Cocoa)

Documentation

You can find comments and usage information in

  • cef3lib.pas / cef3api.pas
  • the example projects in the Examples folder
  • the official api docs here
  • the official cefclient example program here

Links:

Donate

fpcef3's People

Contributors

dliw avatar klesh- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.