Skip to content

Commit

Permalink
Update cefpython to Chromium v49 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed Aug 26, 2018
1 parent 7a587f5 commit d3d9b3c
Show file tree
Hide file tree
Showing 94 changed files with 2,017 additions and 2,187 deletions.
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# CEF Python

## About 'cefpython49-winxp' branch

This is a special branch of Chromium v49 for Windows only
with Windows XP support. This is the latest version of Chromium
that supports Windows XP. This cefpython branch was forked from
cefpython57 branch.
with Windows XP and Vista support. This is the latest version of
Chromium that supports Windows XP. This cefpython branch was forked
from cefpython57 branch.


# CEF Python

Table of contents:
* [About 'cefpython49-winxp' branch](#about-cefpython49-winxp-branch)
* [Introduction](#introduction)
* [Thanks to Fivestars for the v49 release](#thanks-to-fivestars-for-the-v49-release)
* [Install](#install)
* [Tutorial](#tutorial)
* [Examples](#examples)
Expand Down Expand Up @@ -44,6 +46,15 @@ applications. You can use it for web scraping or as a web crawler,
or other kind of internet bots.


## Thanks to Fivestars for the v49 release

Thanks to Fivestars Loyalty, Inc. for sponsoring the
[v49 release](../../releases) of CEF Python.
Please visit its website: https://www.fivestars.com/ .

[![fivestars360](https://raw.githubusercontent.com/wiki/cztomczak/cefpython/images/fivestars360.png)](https://www.fivestars.com/)


## Install

You can install [pypi/cefpython3](https://pypi.python.org/pypi/cefpython3)
Expand Down Expand Up @@ -100,8 +111,12 @@ Windows | 2.7 | 3.4 | Yes | Yes | Windows XP+
- Install with command: `pip install cefpython3==49.0`
- Downloads are available on GitHub Releases tagged
[v49.0](../../releases/tag/v49.0).
- API reference is available in revision [master](../../tree/master/docs)
- API reference is available in revision [master](../../tree/master/api)
- See [Migration guide](docs/Migration-guide.md) document for changes
in this release
- Documentation is available in the [docs/](../../tree/cefpython49-winxp/docs)
directory
- API reference is available in the [api/](../../tree/cefpython49-winxp/api)
directory


**v31 release**
Expand Down Expand Up @@ -237,8 +252,6 @@ directly.
* [command_line_args_disabled](api/ApplicationSettings.md#command_line_args_disabled)
* [context_menu](api/ApplicationSettings.md#context_menu)
* [downloads_enabled](api/ApplicationSettings.md#downloads_enabled)
* [external_message_pump](api/ApplicationSettings.md#external_message_pump)
* [framework_dir_path](api/ApplicationSettings.md#framework_dir_path)
* [ignore_certificate_errors](api/ApplicationSettings.md#ignore_certificate_errors)
* [javascript_flags](api/ApplicationSettings.md#javascript_flags)
* [locale](api/ApplicationSettings.md#locale)
Expand All @@ -247,7 +260,6 @@ directly.
* [log_file](api/ApplicationSettings.md#log_file)
* [log_severity](api/ApplicationSettings.md#log_severity)
* [multi_threaded_message_loop](api/ApplicationSettings.md#multi_threaded_message_loop)
* [net_security_expiration_enabled](api/ApplicationSettings.md#net_security_expiration_enabled)
* [pack_loading_disabled](api/ApplicationSettings.md#pack_loading_disabled)
* [persist_session_cookies](api/ApplicationSettings.md#persist_session_cookies)
* [persist_user_preferences](api/ApplicationSettings.md#persist_user_preferences)
Expand Down Expand Up @@ -332,7 +344,6 @@ directly.
* [StopLoad](api/Browser.md#stopload)
* [StopFinding](api/Browser.md#stopfinding)
* [ToggleFullscreen](api/Browser.md#togglefullscreen)
* [TryCloseBrowser](api/Browser.md#tryclosebrowser)
* [WasResized](api/Browser.md#wasresized)
* [WasHidden](api/Browser.md#washidden)
* [Browser settings](api/BrowserSettings.md#browser-settings)
Expand All @@ -356,7 +367,6 @@ directly.
* [tab_to_links_disabled](api/BrowserSettings.md#tab_to_links_disabled)
* [text_area_resize_disabled](api/BrowserSettings.md#text_area_resize_disabled)
* [universal_access_from_file_urls_allowed](api/BrowserSettings.md#universal_access_from_file_urls_allowed)
* [user_style_sheet_location](api/BrowserSettings.md#user_style_sheet_location)
* [web_security_disabled](api/BrowserSettings.md#web_security_disabled)
* [webgl_disabled](api/BrowserSettings.md#webgl_disabled)
* [windowless_frame_rate](api/BrowserSettings.md#windowless_frame_rate)
Expand Down Expand Up @@ -508,6 +518,7 @@ directly.
* [_OnAfterCreated](api/LifespanHandler.md#_onaftercreated)
* [DoClose](api/LifespanHandler.md#doclose)
* [OnBeforeClose](api/LifespanHandler.md#onbeforeclose)
* [RunModal](api/LifespanHandler.md#runmodal)
* [LoadHandler (interface)](api/LoadHandler.md#loadhandler-interface)
* [OnLoadingStateChange](api/LoadHandler.md#onloadingstatechange)
* [OnLoadStart](api/LoadHandler.md#onloadstart)
Expand Down Expand Up @@ -666,6 +677,7 @@ directly.
* [OnEraseBackground ](api/WindowUtils.md#onerasebackground-win)
* [SetTitle ](api/WindowUtils.md#settitle-win)
* [SetIcon ](api/WindowUtils.md#seticon-win)
* [UpdateBrowserSize ](api/WindowUtils.md#updatebrowsersize-win)
* [GetParentHandle](api/WindowUtils.md#getparenthandle)
* [IsWindowHandle](api/WindowUtils.md#iswindowhandle)
* [gtk_plug_new ](api/WindowUtils.md#gtk_plug_new-linux)
Expand Down
7 changes: 2 additions & 5 deletions api/API-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
* [command_line_args_disabled](ApplicationSettings.md#command_line_args_disabled)
* [context_menu](ApplicationSettings.md#context_menu)
* [downloads_enabled](ApplicationSettings.md#downloads_enabled)
* [external_message_pump](ApplicationSettings.md#external_message_pump)
* [framework_dir_path](ApplicationSettings.md#framework_dir_path)
* [ignore_certificate_errors](ApplicationSettings.md#ignore_certificate_errors)
* [javascript_flags](ApplicationSettings.md#javascript_flags)
* [locale](ApplicationSettings.md#locale)
Expand All @@ -22,7 +20,6 @@
* [log_file](ApplicationSettings.md#log_file)
* [log_severity](ApplicationSettings.md#log_severity)
* [multi_threaded_message_loop](ApplicationSettings.md#multi_threaded_message_loop)
* [net_security_expiration_enabled](ApplicationSettings.md#net_security_expiration_enabled)
* [pack_loading_disabled](ApplicationSettings.md#pack_loading_disabled)
* [persist_session_cookies](ApplicationSettings.md#persist_session_cookies)
* [persist_user_preferences](ApplicationSettings.md#persist_user_preferences)
Expand Down Expand Up @@ -107,7 +104,6 @@
* [StopLoad](Browser.md#stopload)
* [StopFinding](Browser.md#stopfinding)
* [ToggleFullscreen](Browser.md#togglefullscreen)
* [TryCloseBrowser](Browser.md#tryclosebrowser)
* [WasResized](Browser.md#wasresized)
* [WasHidden](Browser.md#washidden)
* [Browser settings](BrowserSettings.md#browser-settings)
Expand All @@ -131,7 +127,6 @@
* [tab_to_links_disabled](BrowserSettings.md#tab_to_links_disabled)
* [text_area_resize_disabled](BrowserSettings.md#text_area_resize_disabled)
* [universal_access_from_file_urls_allowed](BrowserSettings.md#universal_access_from_file_urls_allowed)
* [user_style_sheet_location](BrowserSettings.md#user_style_sheet_location)
* [web_security_disabled](BrowserSettings.md#web_security_disabled)
* [webgl_disabled](BrowserSettings.md#webgl_disabled)
* [windowless_frame_rate](BrowserSettings.md#windowless_frame_rate)
Expand Down Expand Up @@ -283,6 +278,7 @@
* [_OnAfterCreated](LifespanHandler.md#_onaftercreated)
* [DoClose](LifespanHandler.md#doclose)
* [OnBeforeClose](LifespanHandler.md#onbeforeclose)
* [RunModal](LifespanHandler.md#runmodal)
* [LoadHandler (interface)](LoadHandler.md#loadhandler-interface)
* [OnLoadingStateChange](LoadHandler.md#onloadingstatechange)
* [OnLoadStart](LoadHandler.md#onloadstart)
Expand Down Expand Up @@ -441,6 +437,7 @@
* [OnEraseBackground ](WindowUtils.md#onerasebackground-win)
* [SetTitle ](WindowUtils.md#settitle-win)
* [SetIcon ](WindowUtils.md#seticon-win)
* [UpdateBrowserSize ](WindowUtils.md#updatebrowsersize-win)
* [GetParentHandle](WindowUtils.md#getparenthandle)
* [IsWindowHandle](WindowUtils.md#iswindowhandle)
* [gtk_plug_new ](WindowUtils.md#gtk_plug_new-linux)
Expand Down
56 changes: 1 addition & 55 deletions api/ApplicationSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Table of contents:
* [command_line_args_disabled](#command_line_args_disabled)
* [context_menu](#context_menu)
* [downloads_enabled](#downloads_enabled)
* [external_message_pump](#external_message_pump)
* [framework_dir_path](#framework_dir_path)
* [ignore_certificate_errors](#ignore_certificate_errors)
* [javascript_flags](#javascript_flags)
* [locale](#locale)
Expand All @@ -26,7 +24,6 @@ Table of contents:
* [log_file](#log_file)
* [log_severity](#log_severity)
* [multi_threaded_message_loop](#multi_threaded_message_loop)
* [net_security_expiration_enabled](#net_security_expiration_enabled)
* [pack_loading_disabled](#pack_loading_disabled)
* [persist_session_cookies](#persist_session_cookies)
* [persist_user_preferences](#persist_user_preferences)
Expand Down Expand Up @@ -175,44 +172,6 @@ Default: True
Downloads are handled automatically. A default `SaveAs` file dialog provided by OS is displayed. See also the [DownloadHandler](DownloadHandler.md) wiki page.


### external_message_pump

(bool)
Default: False

EXPERIMENTAL: So far this was tested only on Linux and actually made app
significantly slower. Windows and Mac platforms were not
tested yet. Reported issue in upstream, see [Issue #246]
(https://github.com/cztomczak/cefpython/issues/246) for details.

It is recommended to use this option as a replacement for calls to
cefpython.MessageLoopWork(). CEF Python will do these calls automatically
using CEF's OnScheduleMessagePumpWork. This results in improved performance
on Windows and Mac and resolves some bugs with missing keyboard events
on these platforms. See [Issue #246]
(https://github.com/cztomczak/cefpython/issues/246) for more details.

Description from upstream CEF:
> Set to true (1) to control browser process main (UI) thread message pump
> scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork()
> callback. This option is recommended for use in combination with the
> CefDoMessageLoopWork() function in cases where the CEF message loop must be
> integrated into an existing application message loop (see additional
> comments and warnings on CefDoMessageLoopWork). Enabling this option is not
> recommended for most users; leave this option disabled and use either the
> CefRunMessageLoop() function or multi_threaded_message_loop if possible.

### framework_dir_path

The path to the CEF framework directory on macOS. If this value is empty
then the framework must exist at "Contents/Frameworks/Chromium Embedded
Framework.framework" in the top-level app bundle. Also configurable using
the "framework-dir-path" command-line switch.

See also [Issue #304](../../../issues/304).


### ignore_certificate_errors

(bool)
Expand Down Expand Up @@ -322,19 +281,6 @@ only supported on Windows.
This option is not and cannot be supported on OS-X for architectural reasons.


### net_security_expiration_enabled

(bool)
Set to true (1) to enable date-based expiration of built in network
security information (i.e. certificate transparency logs, HSTS preloading
and pinning information). Enabling this option improves network security
but may cause HTTPS load failures when using CEF binaries built more than
10 weeks in the past. See https://www.certificate-transparency.org/ and
https://www.chromium.org/hsts for details. Can be set globally using the
CefSettings.enable_net_security_expiration value.



### pack_loading_disabled

(bool)
Expand Down Expand Up @@ -447,7 +393,7 @@ set `unique_request_context_per_browser` to True.

In upstream CEF each request context may have separate settings like
cache_path, persist_session_cookies, persist_user_preferences,
ignore_certificate_errors, enable_net_security_expiration,
ignore_certificate_errors,
accept_language_list. Such functionality wasn't yet exposed in CEF Python.


Expand Down
19 changes: 0 additions & 19 deletions api/Browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,12 @@ Table of contents:
* [StopLoad](#stopload)
* [StopFinding](#stopfinding)
* [ToggleFullscreen](#togglefullscreen)
* [TryCloseBrowser](#tryclosebrowser)
* [WasResized](#wasresized)
* [WasHidden](#washidden)


## Notes

Methods available in upstream CEF which were not yet exposed in CEF Python
(see src/include/cef_browser.h):

* ImeSetComposition
* ImeCommitText
* ImeFinishComposingText
* ImeCancelComposition

There are some edge cases when after the OnBeforeClose event browser objects
are no more globally referenced thus a new instance is created that
wraps upstream CefBrowser object. Browser objects that were globally
Expand Down Expand Up @@ -933,16 +924,6 @@ Switch between fullscreen mode / windowed mode. To check whether in fullscreen m
This function is Windows-only.


### TryCloseBrowser

Helper for closing a browser. Call this method from the top-level window
close handler. Internally this calls CloseBrowser(false) if the close has
not yet been initiated. This method returns false while the close is
pending and true after the close has completed. See CloseBrowser() and
CefLifeSpanHandler::DoClose() documentation for additional usage
information. This method must be called on the browser process UI thread.


### WasResized

| | |
Expand Down
8 changes: 0 additions & 8 deletions api/BrowserSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Table of contents:
* [tab_to_links_disabled](#tab_to_links_disabled)
* [text_area_resize_disabled](#text_area_resize_disabled)
* [universal_access_from_file_urls_allowed](#universal_access_from_file_urls_allowed)
* [user_style_sheet_location](#user_style_sheet_location)
* [web_security_disabled](#web_security_disabled)
* [webgl_disabled](#webgl_disabled)
* [windowless_frame_rate](#windowless_frame_rate)
Expand Down Expand Up @@ -168,13 +167,6 @@ switch.
(bool) Controls whether file URLs will have access to all URLs. Also configurable using the --allow-universal-access-from-files switch. Other similar switches are --allow-file-access and --allow-file-access-from-files.


### user_style_sheet_location

(string) Location of the user style sheet that will be used for all pages. This must be a data URL of the form `data:text/css;charset=utf-8;base64,content` where "content" is the base64 encoded contents of the CSS file. Also configurable using the "user-style-sheet-location" command-line switch.

This setting was removed in Chrome 33. Soon it will be removed from cefpython as well.


### web_security_disabled

(bool) Controls whether web security restrictions (same-origin policy) will be enforced. Disabling this setting is not recommend as it will allow risky security behavior such as cross-site scripting (XSS). Also configurable using the --disable-web-security switch.
Expand Down
12 changes: 6 additions & 6 deletions api/DpiAware.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Table of contents:
By default if DPI awareness is not enabled in application, then OS performs display scaling. That causes text to look blurry on high DPI displays. To resolve this you have to
call `cef.DpiAware.EnableHighDpiSupport` method. High DPI support is available only on Windows.

Enabling High DPI support in app can be done by embedding a DPI awareness xml manifest in both main executable and subprocess executable (see [Issue #112](../issues/112) comment #2), or by calling the `cef.DpiAware.EnableHighDpiSupport` method.
Enabling High DPI support in app can be done by embedding a DPI awareness xml manifest in both main executable and subprocess executable (see [Issue #112](../issues/112) comment #2), or by calling the `cef.DpiAware.EnableHighDpiSupport` method (Win7+).

## Static methods

Expand Down Expand Up @@ -52,7 +52,7 @@ the `GetSystemDpi` method for that.
| __Return__ | void |

Calling this function will set current process and subprocesses
to be DPI aware.
to be DPI aware. This function supports only Windows 7 or newer.

Description from upstream CEF:
> Call during process startup to enable High-DPI support on Windows 7 or newer.
Expand Down Expand Up @@ -101,8 +101,8 @@ On Win8 this will return True if DPI awareness is set to either "System DPI awar
| --- | --- |
| __Return__ | void |

Calling this method is deprecated, call instead `EnableHighDpiSupport()`.
See [Issue #358](../../../issues/358) for how the behavior changed in
latest CEF. This method now internally calls `EnableHighDpiSupport()`.

Enables DPI awareness for the running process. Embedding a DPI manifest in .exe is the prefered way, as it gives more reliable results, otherwise some display bugs may appear (discussed in the "Introduction" section on this page).

This function only sets DPI awareness for the main process.
It's recommended to embed a DPI awareness manifest in both main process
and the subprocesses (the subprocess.exe executable).
1 change: 1 addition & 0 deletions api/JavascriptDialogHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pressed. The |user_input| value should be specified for prompt dialogs.
| --- | --- |
| browser | [Browser](Browser.md) |
| origin_url | str |
| accept_lang | str |
| dialog_type | int |
| message_text | str |
| default_prompt_text | str |
Expand Down
13 changes: 13 additions & 0 deletions api/LifespanHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Table of contents:
* [_OnAfterCreated](#_onaftercreated)
* [DoClose](#doclose)
* [OnBeforeClose](#onbeforeclose)
* [RunModal](#runmodal)


## Callbacks
Expand Down Expand Up @@ -117,3 +118,15 @@ browser object and do not attempt to execute any methods on the browser
object after this callback returns. This callback will be the last
notification that references |browser|. See DoClose() documentation for
additional usage information.


### RunModal

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | bool |

Called when a modal window is about to display and the modal loop should
begin running. Return false to use the default modal loop implementation or
true to use a custom implementation.
2 changes: 0 additions & 2 deletions api/RequestHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ The `GetResourceHandler` example can be found in the old v31
| old_url | string |
| new_url_out | list[string] |
| request | [Request](Request.md) |
| response | [Response](Response.md) |
| __Return__ | void |

Description from upstream CEF:
Expand Down Expand Up @@ -244,7 +243,6 @@ this on Linux.
| browser | [Browser](Browser.md) |
| mime_type | string |
| plugin_url | string |
| is_main_frame | bool |
| top_origin_url | string |
| plugin_info | [WebPluginInfo](WebPluginInfo.md) |
| __Return__ | bool |
Expand Down
Loading

0 comments on commit d3d9b3c

Please sign in to comment.