Skip to content

Commit bc3b9aa

Browse files
committed
Update to CEF 3.2526.1373.gb660893 (Chrome 47)...
It builds fine on Linux, however there is an error when running during import of the cefpython .so module (Issue cztomczak#230). Upstream CEF binaries and libraries are available for download from the GH releases tagged 'v47-upstream'. Changes in upstream CEF that break backward compatibility: * Add Browser.NotifyMoveOrResizeStarted() - requires changes in examples, needs to be called in MOVE/SIZE window operations * On Linux the windowRect argument in WindowInfo.SetAsChild() is now required * When using offscreen rendering you must set the ApplicationSettings > "windowless_rendering_enabled" option to True * New args in LifespanHandler.OnBeforePopup() - targetDisposition and userGesture - wxpython.py example updated * New arg in RequestHandler.OnResourceRedirect() - request object, updated the wxpython.py example Other changes in API: * Change ApplicationSettings. Add new: user_data_path, windowless_rendering_enabled, persist_user_preferences, accept_language_list. Modify: background_color is now cross-platform (previously it was Mac only). Remove: release_dcheck_enabled - all examples updated * Change BrowserSettings. Add new: windowless_frame_rate, background_color, accept_language_list. Remove: user_style_sheet_location, java_disabled, accelerated_compositing, author_and_user_styles_disabled. * Add Browser.CloseDevTools() * Remove Browser.ParentWindowWillClose() in upstream (keep dummy for BC) * Request.GetHeaderMap() will not include the Referer value if any and SetHeaderMap() will ignore Referer value * Remove the cefpython.Request.Flags values: AllowCookies, ReportLoadTiming, ReportRawHeaders. * Update descriptions of many functions and settings in API docs * There were many more API changes in upstream, but are not yet implemented in cefpython. A list of changes since v31..v47 is available in the top comment in src/cefpython.pyx Improve integration with PyCharm: - add include "cefpython.pyx" in all .pyx files - many other fixes Set these settings in Pycharm: - in Tool Windows > Project right click on src/cython_includes dir and select Mark Directory As > Mark as Sources Root - PEP8 naming convention violation: ignored errors: N802, N803, N806 - in Inspections > unresolved references add to ignore: UNAME_SYSNAME and PY_MAJOR_VERSION and others that cause issues in PyCharm - templates usage like CefRefPtr[CefApp] always shows "unresolved reference" error - to fix it add CefApp and others to ignore list (easy with alt+enter and fix single or fix all in file) Remove duplicated comments in all C++ classes/methods that implement CEF API, eg. client_handler.cpp and client_handler.h. Comments describing method can be found in src/include/. Duplicating it might mislead when the comment is not updated when updating to newer CEF. Remove LOG macros in LOG_DEBUG.h - name conflicts with cef_logging.h (issue cef/#1830).
1 parent c4b5ef5 commit bc3b9aa

File tree

233 files changed

+20160
-3752
lines changed

Some content is hidden

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

233 files changed

+20160
-3752
lines changed

docs/api/API-index.md

Lines changed: 257 additions & 252 deletions
Large diffs are not rendered by default.

docs/api/ApplicationSettings.md

Lines changed: 164 additions & 88 deletions
Large diffs are not rendered by default.

docs/api/Browser.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Table of contents:
1010
* [CanGoBack](#cangoback)
1111
* [CanGoForward](#cangoforward)
1212
* [CloseBrowser](#closebrowser)
13+
* [CloseDevTools](#closedevtools)
1314
* [ExecuteFunction](#executefunction)
1415
* [ExecuteJavascript](#executejavascript)
1516
* [Find](#find)
@@ -44,6 +45,7 @@ Table of contents:
4445
* [IsWindowRenderingDisabled](#iswindowrenderingdisabled)
4546
* [LoadUrl](#loadurl)
4647
* [Navigate](#navigate)
48+
* [NotifyMoveOrResizeStarted](#notifymoveorresizestarted)
4749
* [NotifyScreenInfoChanged](#notifyscreeninfochanged)
4850
* [ParentWindowWillClose](#parentwindowwillclose)
4951
* [Reload](#reload)
@@ -118,6 +120,16 @@ LifespanHandler::DoClose() documentation for additional usage
118120
information.
119121

120122

123+
### CloseDevTools
124+
125+
| | |
126+
| --- | --- |
127+
| __Return__ | bool |
128+
129+
Explicitly close the developer tools window if one exists for this browser
130+
instance.
131+
132+
121133
### ExecuteFunction
122134

123135
| Parameter | Type |
@@ -160,7 +172,7 @@ Calling javascript from native code synchronously is not possible in CEF 3. It i
160172
| findNext | bool |
161173
| __Return__ | void |
162174

163-
Search for |searchText|. |searchID| can be custom, it is so that you can have multiple searches running simultaneously. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up.
175+
Search for |searchText|. |searchID| can be custom, it is so that you can have multiple searches running simultaneously. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up. The CefFindHandler instance, if any, returned via CefClient::GetFindHandler will be called to report find results.
164176

165177

166178
### GetClientCallback
@@ -467,6 +479,16 @@ Load url in the main frame.
467479
This is an alias for the `LoadUrl` method.
468480

469481

482+
### NotifyMoveOrResizeStarted
483+
484+
| | |
485+
| --- | --- |
486+
| __Return__ | void |
487+
488+
Notify the browser that the window hosting it is about to be moved or
489+
resized. This method is only used on Windows and Linux.
490+
491+
470492
### NotifyScreenInfoChanged
471493

472494
| | |
@@ -487,10 +509,7 @@ disabled.
487509
| --- | --- |
488510
| __Return__ | void |
489511

490-
Call this method before destroying a contained browser window. This method
491-
performs any internal cleanup that may be needed before the browser window
492-
is destroyed. See [LifespanHandler](LifespanHandler.md)::DoClose() documentation for
493-
additional usage information.
512+
This method does nothing. Kept for BC.
494513

495514

496515
### Reload
@@ -634,10 +653,10 @@ Set client handler object (class instance), its members will be inspected. Priva
634653

635654
| Parameter | Type |
636655
| --- | --- |
637-
| enable | bool |
656+
| focus | bool |
638657
| __Return__ | void |
639658

640-
Set focus for the browser window. If |enable| is true focus will be set to the window. Otherwise, focus will be removed.
659+
Set whether the browser is focused.
641660

642661

643662
### SetMouseCursorChangeDisabled

docs/api/BrowserSettings.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Table of contents:
88
* [Introduction](#introduction)
99
* [Settings](#settings)
1010
* [Font settings](#font-settings)
11-
* [accelerated_compositing_disabled](#accelerated_compositing_disabled)
11+
* [accept_language_list](#accept_language_list)
1212
* [application_cache_disabled](#application_cache_disabled)
13-
* [author_and_user_styles_disabled](#author_and_user_styles_disabled)
13+
* [background_color](#background_color)
1414
* [caret_browsing_enabled](#caret_browsing_enabled)
1515
* [databases_disabled](#databases_disabled)
1616
* [default_encoding](#default_encoding)
@@ -21,7 +21,6 @@ Table of contents:
2121
* [javascript_open_windows_disallowed](#javascript_open_windows_disallowed)
2222
* [javascript_close_windows_disallowed](#javascript_close_windows_disallowed)
2323
* [javascript_access_clipboard_disallowed](#javascript_access_clipboard_disallowed)
24-
* [java_disabled](#java_disabled)
2524
* [local_storage_disabled](#local_storage_disabled)
2625
* [plugins_disabled](#plugins_disabled)
2726
* [remote_fonts](#remote_fonts)
@@ -32,11 +31,13 @@ Table of contents:
3231
* [user_style_sheet_location](#user_style_sheet_location)
3332
* [web_security_disabled](#web_security_disabled)
3433
* [webgl_disabled](#webgl_disabled)
34+
* [windowless_frame_rate](#windowless_frame_rate)
3535

3636

3737
## Introduction
3838

39-
These settings can be passed to [cefpython](cefpython.md).CreateBrowser().
39+
This dictionary of settings can be passed to
40+
[cefpython](cefpython.md).CreateBrowser().
4041

4142
Many of these settings have their command line switch equivalent, see the [CommandLineSwitches](CommandLineSwitches.md) page.
4243

@@ -60,21 +61,28 @@ In some cases, the default values of settings that are suggested by its name may
6061
* minimum_logical_font_size (int)
6162

6263

63-
### accelerated_compositing_disabled
64+
### accept_language_list
6465

65-
(bool) Controls whether content that depends on accelerated compositing can be used. Note that accelerated compositing requires hardware support and may not work on all systems even when enabled. Also configurable using the --disable-accelerated-compositing switch.
66+
(string)
67+
Comma delimited ordered list of language codes without any whitespace that
68+
will be used in the "Accept-Language" HTTP header. May be set globally
69+
using the CefBrowserSettings.accept_language_list value. If both values are
70+
empty then "en-US,en" will be used.
6671

6772

6873
### application_cache_disabled
6974

7075
(bool) Controls whether the application cache can be used. Also configurable using the --disable-application-cache switch.
7176

7277

73-
### author_and_user_styles_disabled
78+
### background_color
7479

75-
(bool) Controls whether style sheets can be used. Also configurable using the --disable-author-and-user-styles switch.
76-
77-
This setting was removed in Chrome 33. Soon it will be removed from cefpython as well.
80+
(int)
81+
Opaque background color used for the browser before a document is loaded
82+
and when no document color is specified. By default the background color
83+
will be the same as CefSettings.background_color. Only the RGB compontents
84+
of the specified value will be used. The alpha component must greater than
85+
0 to enable use of the background color but will be otherwise ignored.
7886

7987

8088
### caret_browsing_enabled
@@ -119,19 +127,18 @@ This setting was removed in Chrome 33. Soon it will be removed from cefpython as
119127

120128
### javascript_close_windows_disallowed
121129

122-
(bool) Controls whether Javascript can be used to close windows that were not opened via Javascript. Javascript can still be used to close windows that were opened via Javascript. Also configurable using the --disable-javascript-close-windows switch.
130+
(bool) Controls whether JavaScript can be used to close windows that were not
131+
opened via JavaScript. JavaScript can still be used to close windows that
132+
were opened via JavaScript or that have no back/forward history. Also
133+
configurable using the "disable-javascript-close-windows" command-line
134+
switch.
123135

124136

125137
### javascript_access_clipboard_disallowed
126138

127139
(bool) Controls whether Javascript can access the clipboard. Also configurable using the --disable-javascript-access-clipboard switch.
128140

129141

130-
### java_disabled
131-
132-
(bool) Controls whether the Java plugin will be loaded. Also configurable using the --disable-java switch.
133-
134-
135142
### local_storage_disabled
136143

137144
(bool) Controls whether local storage can be used. Also configurable using the --disable-local-storage switch.
@@ -182,3 +189,13 @@ This setting was removed in Chrome 33. Soon it will be removed from cefpython as
182189
### webgl_disabled
183190

184191
(bool) Controls whether WebGL can be used. Note that WebGL requires hardware support and may not work on all systems even when enabled. Also configurable using the --disable-webgl switch.
192+
193+
194+
### windowless_frame_rate
195+
196+
(int) The maximum rate in frames per second (fps) that
197+
CefRenderHandler::OnPaint will be called for a windowless browser.
198+
The actual fps may be lower if the browser cannot generate frames at the
199+
requested rate. The minimum value is 1 and the maximum value is 60
200+
(default 30). This value can also be changed dynamically via
201+
CefBrowserHost::SetWindowlessFrameRate.

docs/api/CookieManager.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ static method for this purpose.
88

99
The cookie tests can be found in the wxpython.py script.
1010

11+
TODO: in upstream CEF some methods here have a callback parameter
12+
that when non-NULL will execute asynchronously on the IO thread
13+
when storage has been initialized. SetCookie and DeleteCookies
14+
also have an OnComplete callback.
15+
1116

1217
Table of contents:
1318
* [Methods](#methods)
@@ -61,9 +66,9 @@ see [RequestHandler](RequestHandler.md).GetCookieManager().
6166
| schemes | list |
6267
| __Return__ | void |
6368

64-
Set the schemes supported by this manager. By default only "http" and
65-
"https" schemes are supported. Must be called before any cookies are
66-
accessed.
69+
Set the schemes supported by this manager. The default schemes ("http",
70+
"https", "ws" and "wss") will always be supported. Must be called before
71+
any cookies are accessed.
6772

6873

6974
### VisitAllCookies
@@ -73,14 +78,14 @@ accessed.
7378
| object | [CookieVisitor](CookieVisitor.md) |
7479
| __Return__ | bool |
7580

76-
Visit all cookies. The returned cookies are ordered by longest path,
77-
then by earliest creation date. Returns false if cookies cannot be
78-
accessed.
81+
Visit all cookies on the IO thread. The returned cookies are ordered by
82+
longest path, then by earliest creation date. Returns false if cookies
83+
cannot be accessed.
7984

80-
The `CookieVisitor` object is a python class that implements the `CookieVisitor`
81-
callbacks. You must keep a strong reference to the `CookieVisitor` object while
82-
visiting cookies, otherwise it gets destroyed and the `CookieVisitor` callbacks
83-
won't be called.
85+
The `CookieVisitor` object is a python class that implements the
86+
CookieVisitor`callbacks. You must keep a strong reference to the
87+
CookieVisitor` object while visiting cookies, otherwise it gets
88+
destroyed and the `CookieVisitor` callbacks won't be called.
8489

8590

8691
### VisitUrlCookies
@@ -92,16 +97,16 @@ won't be called.
9297
| object | [CookieVisitor](CookieVisitor.md) |
9398
| __Return__ | bool |
9499

95-
Visit a subset of cookies. The results are filtered by the given url
96-
scheme, host, domain and path. If |includeHttpOnly| is true HTTP-only
97-
cookies will also be included in the results. The returned cookies are
98-
ordered by longest path, then by earliest creation date. Returns false
99-
if cookies cannot be accessed.
100+
Visit a subset of cookies on the IO thread. The results are filtered by the
101+
given url scheme, host, domain and path. If |includeHttpOnly| is true
102+
HTTP-only cookies will also be included in the results. The returned
103+
cookies are ordered by longest path, then by earliest creation date.
104+
Returns false if cookies cannot be accessed.
100105

101-
The `CookieVisitor` object is a python class that implements the `CookieVisitor`
102-
callbacks. You must keep a strong reference to the `CookieVisitor` object while
103-
visiting cookies, otherwise it gets destroyed and the `CookieVisitor` callbacks
104-
won't be called.
106+
The `CookieVisitor` object is a python class that implements the
107+
`CookieVisitor` callbacks. You must keep a strong reference to the
108+
`CookieVisitor` object while visiting cookies, otherwise it gets destroyed
109+
and the `CookieVisitor` callbacks won't be called.
105110

106111

107112
### SetCookie
@@ -114,15 +119,16 @@ won't be called.
114119

115120
Sets a cookie given a valid URL and a `Cookie` object.
116121
It will check for disallowed characters (e.g. the ';' character is disallowed
117-
within the cookie value attribute) and will not set the cookie if such
118-
characters are found.
122+
within the cookie value attribute) and fail without setting the cookie if
123+
such characters are found. Returns
124+
false if an invalid URL is specified or if cookies cannot be accessed.
119125

120-
The CEF C++ equivalent function will be called on the IO thread, thus it executes
121-
asynchronously, when this method returns the cookie will not yet be set.
126+
The CEF C++ equivalent function will be called on the IO thread, thus
127+
it executes asynchronously, when this method returns the cookie will
128+
not yet be set.
122129

123-
TODO: the CEF C++ function returns a true or false value depending on whether it
124-
succeeded or failed, the return value is not yet implemented in CEF Python,
125-
as there is currently no API exposed to CEF Python for posting tasks on various threads.
130+
TODO: the CEF C++ function returns false if an invalid URL
131+
is specified or if cookies cannot be accessed.
126132

127133

128134
### DeleteCookies
@@ -134,18 +140,18 @@ as there is currently no API exposed to CEF Python for posting tasks on various
134140
| __Return__ | void |
135141

136142
Delete all cookies that match the specified parameters. If both |url| and
137-
values |cookie_name| are specified all host and domain cookies matching
143+
|cookie_name| values are specified all host and domain cookies matching
138144
both will be deleted. If only |url| is specified all host cookies (but not
139145
domain cookies) irrespective of path will be deleted. If |url| is empty all
140-
cookies for all hosts and domains will be deleted. Deleting cookies will fail
141-
if a non-empty invalid URL is specified or if cookies cannot be accessed.
146+
cookies for all hosts and domains will be deleted.
147+
Cookies can alternately be deleted using the Visit*Cookies() methods.
142148

143-
The CEF C++ equivalent function will be called on the IO thread, thus it executes
144-
asynchronously, when this method returns the cookies will not yet be deleted.
149+
The CEF C++ equivalent function will be called on the IO thread,
150+
thus it executes asynchronously, when this method returns the cookies
151+
will not yet be deleted.
145152

146-
TODO: the CEF C++ function returns a true or false value depending on whether it
147-
succeeded or failed, the return value is not yet implemented in CEF Python,
148-
as there is currently no API exposed to CEF Python for posting tasks on various threads.
153+
TODO: the CEF C++ function returns false if a non-empty invalid URL is
154+
specified or if cookies cannot be accessed.
149155

150156

151157
### SetStoragePath
@@ -160,8 +166,8 @@ Sets the directory path that will be used for storing cookie data. If
160166
|path| is empty data will be stored in memory only. Otherwise, data will be
161167
stored at the specified |path|. To persist session cookies (cookies without
162168
an expiry date or validity interval) set |persist_session_cookies| to true.
163-
Session cookies are generally intended to be transient and most Web browsers
164-
do not persist them. Returns false if cookies cannot be accessed.
169+
Session cookies are generally intended to be transient and most Web
170+
browsers do not persist them. Returns false if cookies cannot be accessed.
165171

166172

167173
### FlushStore
@@ -173,6 +179,6 @@ do not persist them. Returns false if cookies cannot be accessed.
173179

174180
Not yet implemented.
175181

176-
Flush the backing store (if any) to disk and execute the specified
177-
|handler| on the IO thread when done. Returns false if cookies cannot be
178-
accessed.
182+
Flush the backing store (if any) to disk. If |callback| is non-NULL it will
183+
be executed asnychronously on the IO thread after the flush is complete.
184+
Returns false if cookies cannot be accessed.

docs/api/Frame.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Returns the parent of this frame or None if this is the main (top-level) frame.
114114
Frame identifiers are unique per render process, they are not
115115
globally unique.
116116

117+
Returns < 0 if the underlying frame does not yet exist.
118+
117119

118120
### GetBrowserIdentifier
119121

docs/api/JavascriptDialogHandler.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ pressed. The |userInput| value should be specified for prompt dialogs.
5151
| suppress_message[0] | bool& |
5252
| __Return__ | bool |
5353

54-
Called to run a Javascript dialog. The |default_prompt_text| value will be
55-
specified for prompt dialogs only. Set |suppress_message| to true and
56-
return false to suppress the message (suppressing messages is preferable
57-
to immediately executing the callback as this is used to detect presumably
58-
malicious behavior like spamming alert messages in onbeforeunload). Set
59-
|suppress_message| to false and return false to use the default
60-
implementation (the default implementation will show one modal dialog at a
61-
time and suppress any additional dialog requests until the displayed dialog
62-
is dismissed). Return true if the application will use a custom dialog or
63-
if the callback has been executed immediately. Custom dialogs may be either
64-
modal or modeless. If a custom dialog is used the application must execute
65-
|callback| once the custom dialog is dismissed.
54+
Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
55+
non-empty they can be passed to the CefFormatUrlForSecurityDisplay function
56+
to retrieve a secure and user-friendly display string. The
57+
|default_prompt_text| value will be specified for prompt dialogs only. Set
58+
|suppress_message| to true and return false to suppress the message
59+
(suppressing messages is preferable to immediately executing the callback
60+
as this is used to detect presumably malicious behavior like spamming alert
61+
messages in onbeforeunload). Set |suppress_message| to false and return
62+
false to use the default implementation (the default implementation will
63+
show one modal dialog at a time and suppress any additional dialog requests
64+
until the displayed dialog is dismissed). Return true if the application
65+
will use a custom dialog or if the callback has been executed immediately.
66+
Custom dialogs may be either modal or modeless. If a custom dialog is used
67+
the application must execute |callback| once the custom dialog is
68+
dismissed.
6669

6770
The `dialog_type` param may be one of:
6871
```

0 commit comments

Comments
 (0)