Skip to content

Commit bfc0a25

Browse files
committed
Update to Chrome 55.0.2883.59 and CEF 3.2883.1539.gd7f087e (cztomczak#271).
Update to Cython 0.25.2. Fix Certificate Transparency support causing some SSL sites fail to load after some time (cztomczak#279). Fix ApplicationSettings.cache_path not working (cztomczak#283). Fix: Not a clean shutdown in examples, when closing app while browser is still loading a website (cztomczak#282). Fix loading local filesystem urls that contained any of ? & = characters (cztomczak#273). Fix Request.SetPostData and GetPostData segmentation faults (cztomczak#228). Add ApplicationSettings.net_security_expiration_enabled. Update ExecuteJavascript docs with scriptUrl="" and startLine=1 default params. Also worth noting that ExecuteJavascript crashed in earlier CEF versions when startLine wasn't provided or was <= 0 (Issue cztomczak#268). Add a test that measures execution time for calling Python function from javascript and then js callback. Add Contributing guidelines / Issue template. Update automate.py, include ceftests executable.
1 parent 59a9aa1 commit bfc0a25

Some content is hidden

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

56 files changed

+1034
-255
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Please read this:
2+
1. Do not create Issues to report problems and/or ask questions. Use the Forum for that.
3+
2. Before creating an Issue it must first be discussed and confirmed on the Forum.
4+
3. Always use the Forum: https://goo.gl/xz4cEF

.github/ISSUE_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Please read this:
2+
1. Do not create Issues to report problems and/or ask questions. Use the Forum for that.
3+
2. Before creating an Issue it must first be discussed and confirmed on the Forum.
4+
3. Always use the Forum: https://goo.gl/xz4cEF

api/ApplicationSettings.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Table of contents:
2424
* [log_file](#log_file)
2525
* [log_severity](#log_severity)
2626
* [multi_threaded_message_loop](#multi_threaded_message_loop)
27+
* [net_security_expiration_enabled](#net_security_expiration_enabled)
2728
* [pack_loading_disabled](#pack_loading_disabled)
2829
* [persist_session_cookies](#persist_session_cookies)
2930
* [persist_user_preferences](#persist_user_preferences)
@@ -283,6 +284,19 @@ only supported on Windows.
283284
This option is not and cannot be supported on OS-X for architectural reasons.
284285

285286

287+
### net_security_expiration_enabled
288+
289+
(bool)
290+
Set to true (1) to enable date-based expiration of built in network
291+
security information (i.e. certificate transparency logs, HSTS preloading
292+
and pinning information). Enabling this option improves network security
293+
but may cause HTTPS load failures when using CEF binaries built more than
294+
10 weeks in the past. See https://www.certificate-transparency.org/ and
295+
https://www.chromium.org/hsts for details. Can be set globally using the
296+
CefSettings.enable_net_security_expiration value.
297+
298+
299+
286300
### pack_loading_disabled
287301

288302
(bool)
@@ -393,6 +407,11 @@ To successfully implement separate cookie manager per browser session
393407
with the use of the RequestHandler.`GetCookieManager` callback, you have to
394408
set `unique_request_context_per_browser` to True.
395409

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

397416
### user_agent
398417

api/Browser.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
# Browser (object)
55

6+
Remember to free all browser references for the browser to shut down cleanly.
7+
Otherwise data such as cookies or other storage might not be flushed to disk
8+
when closing app, and other issues might occur as well. To free a reference
9+
just assign a None value to a "browser" variable.
10+
611

712
Table of contents:
813
* [Notes](#notes)
@@ -82,10 +87,13 @@ Table of contents:
8287

8388
## Notes
8489

85-
**Closing browser cleanly**
90+
Methods available in upstream CEF which were not yet exposed in CEF Python
91+
(see src/include/cef_browser.h):
8692

87-
Remember to delete all browser references for the browser to shut down cleanly. See the wxpython.py example > MainFrame.OnClose() for how to
88-
do it.
93+
* ImeSetComposition
94+
* ImeCommitText
95+
* ImeFinishComposingText
96+
* ImeCancelComposition
8997

9098

9199
## Methods
@@ -267,8 +275,8 @@ Passing a python function here is not allowed, it is only possible through [Java
267275
| Parameter | Type |
268276
| --- | --- |
269277
| jsCode | string |
270-
| scriptURL=None | string |
271-
| startLine=None | int |
278+
| scriptUrl="" | string |
279+
| startLine=1 | int |
272280
| __Return__ | void |
273281

274282
Execute a string of JavaScript code in this frame. The `sciptURL` parameter is the URL where the script in question can be found, if any. The renderer may request this URL to show the developer the source of the error. The `startLine` parameter is the base line number to use for error reporting.

api/Frame.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Call a javascript function asynchronously. This can also call object's methods,
8080
| Parameter | Type |
8181
| --- | --- |
8282
| jsCode | string |
83-
| scriptUrl=None | string |
84-
| startLine=None | int |
83+
| scriptUrl="" | string |
84+
| startLine=1 | int |
8585
| __Return__ | void |
8686

8787
Execute a string of JavaScript code in this frame. The sciptUrl parameter is the url where the script in question can be found, if any. The renderer may request this URL to show the developer the source of the error. The startLine parameter is the base line number to use for error reporting. This function executes asynchronously so there is no way to get the returned value. Calling javascript <> native code synchronously is not possible.

api/RenderHandler.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,14 @@
44
# RenderHandler (interface)
55

66
Implement this interface to handle events when window rendering is disabled
7-
(off-screen rendering). The methods of this class will be called on the UI thread.
8-
9-
In order to create windowless browsers the
10-
ApplicationSettings.[windowless_rendering_enabled](ApplicationSettings.md#windowless_rendering_enabled)
11-
value must be set to true.
12-
13-
Callbacks not implemented yet:
14-
* GetScreenInfo()
15-
16-
Off-screen rendering examples:
17-
* [Kivy](https://github.com/cztomczak/cefpython/wiki/Kivy)
18-
* [Panda3D](https://github.com/cztomczak/cefpython/wiki/Panda3D)
19-
* [cefpython_offscreen_no_UI_framework.py](https://gist.github.com/stefanbacon/7b1571d57aee54aa9f8e9021b4848d06) -
20-
most basic usage of OSR to take screenshot of a page
21-
7+
(off-screen rendering). The methods of this class will be called on
8+
the UI thread. In order to create windowless browsers the
9+
[windowless_rendering_enabled](ApplicationSettings.md#windowless_rendering_enabled)
10+
setting must be set to true.
2211

2312
Table of contents:
13+
* [Examples](#examples)
14+
* [Notes](#notes)
2415
* [Callbacks](#callbacks)
2516
* [GetRootScreenRect](#getrootscreenrect)
2617
* [GetViewRect](#getviewrect)
@@ -35,6 +26,26 @@ Table of contents:
3526
* [UpdateDragCursor](#updatedragcursor)
3627

3728

29+
## Examples
30+
31+
Off-screen rendering examples:
32+
* [Kivy](https://github.com/cztomczak/cefpython/wiki/Kivy)
33+
* [Panda3D](https://github.com/cztomczak/cefpython/wiki/Panda3D)
34+
\- tested with v31
35+
* [pygame + PyOpenGL](https://gist.github.com/AnishN/aa3bb27fc9d69319955ed9a8973cd40f)
36+
\- tested with v31, more info on this example on the Forum in
37+
[this post](https://groups.google.com/d/topic/cefpython/mwSa7He90xA/discussion)
38+
* [cefpython_offscreen_no_UI_framework.py](https://gist.github.com/stefanbacon/7b1571d57aee54aa9f8e9021b4848d06)
39+
\- most basic usage of OSR to take a screenshot of a page
40+
41+
## Notes
42+
43+
Callbacks available in upstream CEF, but not yet exposed in CEF Python
44+
(see src/include/cef_render_handler.h):
45+
* GetScreenInfo
46+
* OnImeCompositionRangeChanged
47+
48+
3849
## Callbacks
3950

4051

api/RequestHandler.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55

66
Implement this interface to handle events related to browser requests.
77

8-
For an example of how to implement handler see [cefpython](cefpython.md).CreateBrowser(). For a list of all handler interfaces see [API > Client handlers](API#Client_handlers).
8+
For an example of how to implement handler see
9+
[cefpython](cefpython.md).CreateBrowserSync(). For a list of all handler
10+
interfaces see [API > Client handlers](API#Client_handlers).
911

10-
The `RequestHandler` tests can be found in the wxpython.py script.
12+
The `RequestHandler` tests can be found in the old wxpython.py script (v31).
1113

12-
The following callbacks are available in upstream CEF, but were not yet
13-
exposed:
14+
Not yet exposed in CEF Python:
1415
* OnOpenURLFromTab
1516
* OnSelectClientCertificate
1617

1718

19+
1820
Table of contents:
1921
* [Callbacks](#callbacks)
2022
* [OnBeforeBrowse](#onbeforebrowse)

api/WebPluginInfo.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55

66
See [RequestHandler](RequestHandler.md).OnBeforePluginLoad().
77

8+
Web Plugin API available in upstream CEF, but not yet exposed in CEF Python
9+
(see src/include/cef_web_plugin.h):
10+
11+
* CefRegisterCdmCallback
12+
* CefRegisterWidevineCdm
13+
* CefIsWebPluginUnstable
14+
* CefRegisterWebPluginCrash
15+
* CefUnregisterInternalWebPlugin
16+
* CefRefreshWebPlugins
17+
* CefVisitWebPluginInfo
18+
819

920
Table of contents:
1021
* [Methods](#methods)

docs/Build-instructions.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Table of contents:
3232

3333
## Build CEF Python on Linux
3434

35-
Complete steps for building CEF Python 55 using prebuilt
35+
Complete steps for building CEF Python v50+ using prebuilt
3636
binaries from GitHub releases:
3737

3838
1) Tested and works fine on Ubuntu 14.04 64-bit (cmake 2.8.12 and g++ 4.8.4)
@@ -48,15 +48,15 @@ binaries from GitHub releases:
4848

4949
5) Download 64-bit Linux binaries and libraries from
5050
[GH releases](https://github.com/cztomczak/cefpython/releases)
51-
tagged 'v55-upstream'.
51+
tagged e.g. 'v50-upstream' when building v50.
5252

5353
6) Extract it in the cefpython/build/ directory and rename the extracted
5454
directory to "cef_linux64".
5555

56-
8) Build cefpython and run examples:
56+
8) Build cefpython and run examples (xx.x is version e.g. 50.0):
5757
```
5858
cd cefpython/src/linux/
59-
python compile.py 55.0
59+
python compile.py xx.x
6060
```
6161

6262
## Requirements
@@ -67,12 +67,8 @@ requirements common for all platforms.
6767

6868
__Windows__
6969

70-
* For Python 2.7 - VS2008 compiler is required:
71-
http://www.microsoft.com/en-us/download/details.aspx?id=44266
72-
* For Python 3.4 - VS2010 compiler is required:
73-
https://docs.python.org/3.4/using/windows.html#compiling-python-on-windows
74-
* For Python 3.5 - VS2015 compiler is required:
75-
https://docs.python.org/3.5/using/windows.html#compiling-python-on-windows
70+
* Install an appropriate MS compiler for a specific Python version:
71+
https://wiki.python.org/moin/WindowsCompilers
7672
* To build CEF from sources:
7773
* Use Win7 x64 or later. 32-bit OS'es are not supported. For more details
7874
see [here](https://www.chromium.org/developers/how-tos/build-instructions-windows).
@@ -167,7 +163,7 @@ mkdir build/ && cd build
167163
python ../tools/automate.py --build-cef --ninja-jobs 6
168164
mv cef*_*_linux64/ cef_linux64/
169165
cd ../../../src/linux/
170-
python compile.py 55.0
166+
python compile.py xx.x
171167
```
172168

173169
__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,

examples/gtk2.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Example of embedding CEF Python browser using PyGTK library (GTK 2).
22
# Tested with GTK 2.24 and CEF Python v54+.
33

4+
# Known issue on Linux: Keyboard focus problem (Issue #284)
5+
46
from cefpython3 import cefpython as cef
57
import pygtk
68
import gtk
79
import gobject
810
import sys
9-
import time
1011

1112
# In CEF you can run message loop in two ways (see API docs for more details):
1213
# 1. By calling cef.MessageLoop() instead of an application-provided
@@ -37,7 +38,8 @@ def main():
3738
def check_versions():
3839
print("[gkt2.py] CEF Python {ver}".format(ver=cef.__version__))
3940
print("[gkt2.py] Python {ver}".format(ver=sys.version[:6]))
40-
print("[gkt2.py] GTK {ver}".format(ver='.'.join(map(str, list(gtk.gtk_version)))))
41+
print("[gkt2.py] GTK {ver}".format(ver='.'.join(
42+
map(str, list(gtk.gtk_version)))))
4143
assert cef.__version__ >= "54.0", "CEF Python v54+ required to run this"
4244
pygtk.require('2.0')
4345

@@ -135,10 +137,6 @@ def on_exit(self, *_):
135137
self.browser.CloseBrowser(True)
136138
self.browser = None
137139
if g_message_loop == MESSAGE_LOOP_BEST:
138-
# Run some message loop work for the browser to close cleanly
139-
for i in range(0, 10):
140-
cef.MessageLoopWork()
141-
time.sleep(0.01)
142140
cef.QuitMessageLoop()
143141
else:
144142
gtk.main_quit()

0 commit comments

Comments
 (0)