Skip to content

Commit d3d9b3c

Browse files
committed
Update cefpython to Chromium v49 (cztomczak#460)
1 parent 7a587f5 commit d3d9b3c

File tree

94 files changed

+2017
-2187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2017
-2187
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# CEF Python
2-
31
## About 'cefpython49-winxp' branch
42

53
This is a special branch of Chromium v49 for Windows only
6-
with Windows XP support. This is the latest version of Chromium
7-
that supports Windows XP. This cefpython branch was forked from
8-
cefpython57 branch.
4+
with Windows XP and Vista support. This is the latest version of
5+
Chromium that supports Windows XP. This cefpython branch was forked
6+
from cefpython57 branch.
97

108

9+
# CEF Python
10+
1111
Table of contents:
12+
* [About 'cefpython49-winxp' branch](#about-cefpython49-winxp-branch)
1213
* [Introduction](#introduction)
14+
* [Thanks to Fivestars for the v49 release](#thanks-to-fivestars-for-the-v49-release)
1315
* [Install](#install)
1416
* [Tutorial](#tutorial)
1517
* [Examples](#examples)
@@ -44,6 +46,15 @@ applications. You can use it for web scraping or as a web crawler,
4446
or other kind of internet bots.
4547

4648

49+
## Thanks to Fivestars for the v49 release
50+
51+
Thanks to Fivestars Loyalty, Inc. for sponsoring the
52+
[v49 release](../../releases) of CEF Python.
53+
Please visit its website: https://www.fivestars.com/ .
54+
55+
[![fivestars360](https://raw.githubusercontent.com/wiki/cztomczak/cefpython/images/fivestars360.png)](https://www.fivestars.com/)
56+
57+
4758
## Install
4859

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

106121

107122
**v31 release**
@@ -237,8 +252,6 @@ directly.
237252
* [command_line_args_disabled](api/ApplicationSettings.md#command_line_args_disabled)
238253
* [context_menu](api/ApplicationSettings.md#context_menu)
239254
* [downloads_enabled](api/ApplicationSettings.md#downloads_enabled)
240-
* [external_message_pump](api/ApplicationSettings.md#external_message_pump)
241-
* [framework_dir_path](api/ApplicationSettings.md#framework_dir_path)
242255
* [ignore_certificate_errors](api/ApplicationSettings.md#ignore_certificate_errors)
243256
* [javascript_flags](api/ApplicationSettings.md#javascript_flags)
244257
* [locale](api/ApplicationSettings.md#locale)
@@ -247,7 +260,6 @@ directly.
247260
* [log_file](api/ApplicationSettings.md#log_file)
248261
* [log_severity](api/ApplicationSettings.md#log_severity)
249262
* [multi_threaded_message_loop](api/ApplicationSettings.md#multi_threaded_message_loop)
250-
* [net_security_expiration_enabled](api/ApplicationSettings.md#net_security_expiration_enabled)
251263
* [pack_loading_disabled](api/ApplicationSettings.md#pack_loading_disabled)
252264
* [persist_session_cookies](api/ApplicationSettings.md#persist_session_cookies)
253265
* [persist_user_preferences](api/ApplicationSettings.md#persist_user_preferences)
@@ -332,7 +344,6 @@ directly.
332344
* [StopLoad](api/Browser.md#stopload)
333345
* [StopFinding](api/Browser.md#stopfinding)
334346
* [ToggleFullscreen](api/Browser.md#togglefullscreen)
335-
* [TryCloseBrowser](api/Browser.md#tryclosebrowser)
336347
* [WasResized](api/Browser.md#wasresized)
337348
* [WasHidden](api/Browser.md#washidden)
338349
* [Browser settings](api/BrowserSettings.md#browser-settings)
@@ -356,7 +367,6 @@ directly.
356367
* [tab_to_links_disabled](api/BrowserSettings.md#tab_to_links_disabled)
357368
* [text_area_resize_disabled](api/BrowserSettings.md#text_area_resize_disabled)
358369
* [universal_access_from_file_urls_allowed](api/BrowserSettings.md#universal_access_from_file_urls_allowed)
359-
* [user_style_sheet_location](api/BrowserSettings.md#user_style_sheet_location)
360370
* [web_security_disabled](api/BrowserSettings.md#web_security_disabled)
361371
* [webgl_disabled](api/BrowserSettings.md#webgl_disabled)
362372
* [windowless_frame_rate](api/BrowserSettings.md#windowless_frame_rate)
@@ -508,6 +518,7 @@ directly.
508518
* [_OnAfterCreated](api/LifespanHandler.md#_onaftercreated)
509519
* [DoClose](api/LifespanHandler.md#doclose)
510520
* [OnBeforeClose](api/LifespanHandler.md#onbeforeclose)
521+
* [RunModal](api/LifespanHandler.md#runmodal)
511522
* [LoadHandler (interface)](api/LoadHandler.md#loadhandler-interface)
512523
* [OnLoadingStateChange](api/LoadHandler.md#onloadingstatechange)
513524
* [OnLoadStart](api/LoadHandler.md#onloadstart)
@@ -666,6 +677,7 @@ directly.
666677
* [OnEraseBackground ](api/WindowUtils.md#onerasebackground-win)
667678
* [SetTitle ](api/WindowUtils.md#settitle-win)
668679
* [SetIcon ](api/WindowUtils.md#seticon-win)
680+
* [UpdateBrowserSize ](api/WindowUtils.md#updatebrowsersize-win)
669681
* [GetParentHandle](api/WindowUtils.md#getparenthandle)
670682
* [IsWindowHandle](api/WindowUtils.md#iswindowhandle)
671683
* [gtk_plug_new ](api/WindowUtils.md#gtk_plug_new-linux)

api/API-index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
* [command_line_args_disabled](ApplicationSettings.md#command_line_args_disabled)
1313
* [context_menu](ApplicationSettings.md#context_menu)
1414
* [downloads_enabled](ApplicationSettings.md#downloads_enabled)
15-
* [external_message_pump](ApplicationSettings.md#external_message_pump)
16-
* [framework_dir_path](ApplicationSettings.md#framework_dir_path)
1715
* [ignore_certificate_errors](ApplicationSettings.md#ignore_certificate_errors)
1816
* [javascript_flags](ApplicationSettings.md#javascript_flags)
1917
* [locale](ApplicationSettings.md#locale)
@@ -22,7 +20,6 @@
2220
* [log_file](ApplicationSettings.md#log_file)
2321
* [log_severity](ApplicationSettings.md#log_severity)
2422
* [multi_threaded_message_loop](ApplicationSettings.md#multi_threaded_message_loop)
25-
* [net_security_expiration_enabled](ApplicationSettings.md#net_security_expiration_enabled)
2623
* [pack_loading_disabled](ApplicationSettings.md#pack_loading_disabled)
2724
* [persist_session_cookies](ApplicationSettings.md#persist_session_cookies)
2825
* [persist_user_preferences](ApplicationSettings.md#persist_user_preferences)
@@ -107,7 +104,6 @@
107104
* [StopLoad](Browser.md#stopload)
108105
* [StopFinding](Browser.md#stopfinding)
109106
* [ToggleFullscreen](Browser.md#togglefullscreen)
110-
* [TryCloseBrowser](Browser.md#tryclosebrowser)
111107
* [WasResized](Browser.md#wasresized)
112108
* [WasHidden](Browser.md#washidden)
113109
* [Browser settings](BrowserSettings.md#browser-settings)
@@ -131,7 +127,6 @@
131127
* [tab_to_links_disabled](BrowserSettings.md#tab_to_links_disabled)
132128
* [text_area_resize_disabled](BrowserSettings.md#text_area_resize_disabled)
133129
* [universal_access_from_file_urls_allowed](BrowserSettings.md#universal_access_from_file_urls_allowed)
134-
* [user_style_sheet_location](BrowserSettings.md#user_style_sheet_location)
135130
* [web_security_disabled](BrowserSettings.md#web_security_disabled)
136131
* [webgl_disabled](BrowserSettings.md#webgl_disabled)
137132
* [windowless_frame_rate](BrowserSettings.md#windowless_frame_rate)
@@ -283,6 +278,7 @@
283278
* [_OnAfterCreated](LifespanHandler.md#_onaftercreated)
284279
* [DoClose](LifespanHandler.md#doclose)
285280
* [OnBeforeClose](LifespanHandler.md#onbeforeclose)
281+
* [RunModal](LifespanHandler.md#runmodal)
286282
* [LoadHandler (interface)](LoadHandler.md#loadhandler-interface)
287283
* [OnLoadingStateChange](LoadHandler.md#onloadingstatechange)
288284
* [OnLoadStart](LoadHandler.md#onloadstart)
@@ -441,6 +437,7 @@
441437
* [OnEraseBackground ](WindowUtils.md#onerasebackground-win)
442438
* [SetTitle ](WindowUtils.md#settitle-win)
443439
* [SetIcon ](WindowUtils.md#seticon-win)
440+
* [UpdateBrowserSize ](WindowUtils.md#updatebrowsersize-win)
444441
* [GetParentHandle](WindowUtils.md#getparenthandle)
445442
* [IsWindowHandle](WindowUtils.md#iswindowhandle)
446443
* [gtk_plug_new ](WindowUtils.md#gtk_plug_new-linux)

api/ApplicationSettings.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Table of contents:
1616
* [command_line_args_disabled](#command_line_args_disabled)
1717
* [context_menu](#context_menu)
1818
* [downloads_enabled](#downloads_enabled)
19-
* [external_message_pump](#external_message_pump)
20-
* [framework_dir_path](#framework_dir_path)
2119
* [ignore_certificate_errors](#ignore_certificate_errors)
2220
* [javascript_flags](#javascript_flags)
2321
* [locale](#locale)
@@ -26,7 +24,6 @@ Table of contents:
2624
* [log_file](#log_file)
2725
* [log_severity](#log_severity)
2826
* [multi_threaded_message_loop](#multi_threaded_message_loop)
29-
* [net_security_expiration_enabled](#net_security_expiration_enabled)
3027
* [pack_loading_disabled](#pack_loading_disabled)
3128
* [persist_session_cookies](#persist_session_cookies)
3229
* [persist_user_preferences](#persist_user_preferences)
@@ -175,44 +172,6 @@ Default: True
175172
Downloads are handled automatically. A default `SaveAs` file dialog provided by OS is displayed. See also the [DownloadHandler](DownloadHandler.md) wiki page.
176173

177174

178-
### external_message_pump
179-
180-
(bool)
181-
Default: False
182-
183-
EXPERIMENTAL: So far this was tested only on Linux and actually made app
184-
significantly slower. Windows and Mac platforms were not
185-
tested yet. Reported issue in upstream, see [Issue #246]
186-
(https://github.com/cztomczak/cefpython/issues/246) for details.
187-
188-
It is recommended to use this option as a replacement for calls to
189-
cefpython.MessageLoopWork(). CEF Python will do these calls automatically
190-
using CEF's OnScheduleMessagePumpWork. This results in improved performance
191-
on Windows and Mac and resolves some bugs with missing keyboard events
192-
on these platforms. See [Issue #246]
193-
(https://github.com/cztomczak/cefpython/issues/246) for more details.
194-
195-
Description from upstream CEF:
196-
> Set to true (1) to control browser process main (UI) thread message pump
197-
> scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork()
198-
> callback. This option is recommended for use in combination with the
199-
> CefDoMessageLoopWork() function in cases where the CEF message loop must be
200-
> integrated into an existing application message loop (see additional
201-
> comments and warnings on CefDoMessageLoopWork). Enabling this option is not
202-
> recommended for most users; leave this option disabled and use either the
203-
> CefRunMessageLoop() function or multi_threaded_message_loop if possible.
204-
205-
206-
### framework_dir_path
207-
208-
The path to the CEF framework directory on macOS. If this value is empty
209-
then the framework must exist at "Contents/Frameworks/Chromium Embedded
210-
Framework.framework" in the top-level app bundle. Also configurable using
211-
the "framework-dir-path" command-line switch.
212-
213-
See also [Issue #304](../../../issues/304).
214-
215-
216175
### ignore_certificate_errors
217176

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

324283

325-
### net_security_expiration_enabled
326-
327-
(bool)
328-
Set to true (1) to enable date-based expiration of built in network
329-
security information (i.e. certificate transparency logs, HSTS preloading
330-
and pinning information). Enabling this option improves network security
331-
but may cause HTTPS load failures when using CEF binaries built more than
332-
10 weeks in the past. See https://www.certificate-transparency.org/ and
333-
https://www.chromium.org/hsts for details. Can be set globally using the
334-
CefSettings.enable_net_security_expiration value.
335-
336-
337-
338284
### pack_loading_disabled
339285

340286
(bool)
@@ -447,7 +393,7 @@ set `unique_request_context_per_browser` to True.
447393

448394
In upstream CEF each request context may have separate settings like
449395
cache_path, persist_session_cookies, persist_user_preferences,
450-
ignore_certificate_errors, enable_net_security_expiration,
396+
ignore_certificate_errors,
451397
accept_language_list. Such functionality wasn't yet exposed in CEF Python.
452398

453399

api/Browser.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,12 @@ Table of contents:
8686
* [StopLoad](#stopload)
8787
* [StopFinding](#stopfinding)
8888
* [ToggleFullscreen](#togglefullscreen)
89-
* [TryCloseBrowser](#tryclosebrowser)
9089
* [WasResized](#wasresized)
9190
* [WasHidden](#washidden)
9291

9392

9493
## Notes
9594

96-
Methods available in upstream CEF which were not yet exposed in CEF Python
97-
(see src/include/cef_browser.h):
98-
99-
* ImeSetComposition
100-
* ImeCommitText
101-
* ImeFinishComposingText
102-
* ImeCancelComposition
103-
10495
There are some edge cases when after the OnBeforeClose event browser objects
10596
are no more globally referenced thus a new instance is created that
10697
wraps upstream CefBrowser object. Browser objects that were globally
@@ -933,16 +924,6 @@ Switch between fullscreen mode / windowed mode. To check whether in fullscreen m
933924
This function is Windows-only.
934925

935926

936-
### TryCloseBrowser
937-
938-
Helper for closing a browser. Call this method from the top-level window
939-
close handler. Internally this calls CloseBrowser(false) if the close has
940-
not yet been initiated. This method returns false while the close is
941-
pending and true after the close has completed. See CloseBrowser() and
942-
CefLifeSpanHandler::DoClose() documentation for additional usage
943-
information. This method must be called on the browser process UI thread.
944-
945-
946927
### WasResized
947928

948929
| | |

api/BrowserSettings.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Table of contents:
2727
* [tab_to_links_disabled](#tab_to_links_disabled)
2828
* [text_area_resize_disabled](#text_area_resize_disabled)
2929
* [universal_access_from_file_urls_allowed](#universal_access_from_file_urls_allowed)
30-
* [user_style_sheet_location](#user_style_sheet_location)
3130
* [web_security_disabled](#web_security_disabled)
3231
* [webgl_disabled](#webgl_disabled)
3332
* [windowless_frame_rate](#windowless_frame_rate)
@@ -168,13 +167,6 @@ switch.
168167
(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.
169168

170169

171-
### user_style_sheet_location
172-
173-
(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.
174-
175-
This setting was removed in Chrome 33. Soon it will be removed from cefpython as well.
176-
177-
178170
### web_security_disabled
179171

180172
(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.

api/DpiAware.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Table of contents:
2424
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
2525
call `cef.DpiAware.EnableHighDpiSupport` method. High DPI support is available only on Windows.
2626

27-
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.
27+
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+).
2828

2929
## Static methods
3030

@@ -52,7 +52,7 @@ the `GetSystemDpi` method for that.
5252
| __Return__ | void |
5353

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

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

104-
Calling this method is deprecated, call instead `EnableHighDpiSupport()`.
105-
See [Issue #358](../../../issues/358) for how the behavior changed in
106-
latest CEF. This method now internally calls `EnableHighDpiSupport()`.
107-
108104
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).
105+
106+
This function only sets DPI awareness for the main process.
107+
It's recommended to embed a DPI awareness manifest in both main process
108+
and the subprocesses (the subprocess.exe executable).

api/JavascriptDialogHandler.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pressed. The |user_input| value should be specified for prompt dialogs.
4343
| --- | --- |
4444
| browser | [Browser](Browser.md) |
4545
| origin_url | str |
46+
| accept_lang | str |
4647
| dialog_type | int |
4748
| message_text | str |
4849
| default_prompt_text | str |

api/LifespanHandler.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Table of contents:
1414
* [_OnAfterCreated](#_onaftercreated)
1515
* [DoClose](#doclose)
1616
* [OnBeforeClose](#onbeforeclose)
17+
* [RunModal](#runmodal)
1718

1819

1920
## Callbacks
@@ -117,3 +118,15 @@ browser object and do not attempt to execute any methods on the browser
117118
object after this callback returns. This callback will be the last
118119
notification that references |browser|. See DoClose() documentation for
119120
additional usage information.
121+
122+
123+
### RunModal
124+
125+
| Parameter | Type |
126+
| --- | --- |
127+
| browser | [Browser](Browser.md) |
128+
| __Return__ | bool |
129+
130+
Called when a modal window is about to display and the modal loop should
131+
begin running. Return false to use the default modal loop implementation or
132+
true to use a custom implementation.

api/RequestHandler.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ The `GetResourceHandler` example can be found in the old v31
103103
| old_url | string |
104104
| new_url_out | list[string] |
105105
| request | [Request](Request.md) |
106-
| response | [Response](Response.md) |
107106
| __Return__ | void |
108107

109108
Description from upstream CEF:
@@ -244,7 +243,6 @@ this on Linux.
244243
| browser | [Browser](Browser.md) |
245244
| mime_type | string |
246245
| plugin_url | string |
247-
| is_main_frame | bool |
248246
| top_origin_url | string |
249247
| plugin_info | [WebPluginInfo](WebPluginInfo.md) |
250248
| __Return__ | bool |

0 commit comments

Comments
 (0)