Skip to content

Latest commit

 

History

History
116 lines (90 loc) · 4.54 KB

Examples-README.md

File metadata and controls

116 lines (90 loc) · 4.54 KB

Examples README

Table of contents:

Hello World!

Instructions to install the cefpython3 package, clone the repository and run the hello_world.py example:

pip --no-cache-dir install cefpython3==49.0
git clone https://github.com/cztomczak/cefpython.git
cd cefpython/examples/
python hello_world.py

Please note that if you were previously installing cefpython3 package it is required to use the --no-cache-dir flag, otherwise pip will end up with error message No matching distribution found for cefpython3==49.0. This happens because 49.0 release occured after 57.0 and 66.0 releases.

Supported examples

Examples provided in the examples/ root directory are actively maintained. If there are any issues in examples read top comments in sources to see whether this is a known issue with available workarounds.

Featured

Snippets

See small code snippets that show various CEF features in the examples/snippets/ directory:

  • javascript_bindings.py - Communicate between Python and Javascript asynchronously using inter-process messaging with the use of Javascript Bindings.
  • javascript_errors.py - Two ways for intercepting Javascript errors.
  • network_cookies.py - Implement interfaces to block or allow cookies over network requests.
  • onbeforeclose.py - Implement interface to execute custom code before browser window closes.
  • ondomready.py - Execute custom Python code on a web page as soon as DOM is ready.
  • onpagecomplete.py - Execute custom Python code on a web page when page loading is complete.
  • window_size.py - Set initial window size without use of any third party GUI framework.

GUI frameworks

Examples of embedding using various GUI frameworks:

Unit tests

There are also available unit tests and its usage of the API can be of some use. See:

More examples

There are even more examples available, some of them are externally maintained.

There are ongoing efforts to add these examples to the official examples/ directory, see issues in the tracker.