|
| 1 | +# Knowledge Base |
| 2 | + |
| 3 | +Table of contents: |
| 4 | +* [Notifications on new releases](#notifications-on-new-releases) |
| 5 | +* [Changes in API after CEF updates](#changes-in-api-after-cef-updates) |
| 6 | +* [Differences between Python 2 and Python 3](#differences-between-python-2-and-python-3) |
| 7 | +* [Flash support](#flash-support) |
| 8 | +* [Feature X works in Google Chrome, but doesn't work in CEF Python](#feature-x-works-in-google-chrome-but-doesnt-work-in-cef-python) |
| 9 | +* [How to capture Audio and Video in HTML5?](#how-to-capture-audio-and-video-in-html5) |
| 10 | +* [Touch and multi-touch support](#touch-and-multi-touch-support) |
| 11 | +* [Black or white browser screen](#black-or-white-browser-screen) |
| 12 | +* [Windows XP support](#windows-xp-support) |
| 13 | +* [Mac 32-bit support](#mac-32-bit-support) |
| 14 | +* [Security](#security) |
| 15 | + |
| 16 | + |
| 17 | +## Notifications on new releases |
| 18 | + |
| 19 | +To be notified of new releases subscribe to this [RSS/Atom feed] |
| 20 | +(../../../releases.atom). |
| 21 | + |
| 22 | +Announcements are also made on the [Forum] |
| 23 | +(https://groups.google.com/d/forum/cefpython). |
| 24 | +To be notified of these via email set your Membership and Email settings |
| 25 | +and change delivery preference to Daily summaries. |
| 26 | + |
| 27 | + |
| 28 | +## Changes in API after CEF updates |
| 29 | + |
| 30 | +CEF Python depends on CEF and API breaks are inevitable when updating |
| 31 | +to latest CEF. The [Migration Guide](Migration-guide.md) document which |
| 32 | +is still under works, will list most notable breaking changes since |
| 33 | +v31 release. Until it's done go to go to the [GitHub Releases] |
| 34 | +(../../../releases) page and check release notes for all the releases |
| 35 | +that appeared between your old version and the new version. Look for |
| 36 | +lists named "Changes in API that break backward compatibility" or |
| 37 | +similar. |
| 38 | + |
| 39 | +Due to unavoidable changes in API it is recommended for your setup |
| 40 | +scripts that use for example PIP to install the cefpython3 package, |
| 41 | +to hardcode the cefpython version string. If for example using PIP's |
| 42 | +requirements.txt file then list the cefpython3 package in the |
| 43 | +following format: `cefpython3 == 31.2`. |
| 44 | + |
| 45 | + |
| 46 | +## Differences between Python 2 and Python 3 |
| 47 | + |
| 48 | +In Python 2 all cefpython strings are byte strings, but in Python 3 |
| 49 | +they are all unicode strings. Be aware of this when porting cefpython |
| 50 | +based apps to Python 3, as it may cause issues. |
| 51 | + |
| 52 | + |
| 53 | +## Flash support |
| 54 | + |
| 55 | +See [Issue #235](../../../issues/235) ("Flash support in CEF 51+"). |
| 56 | + |
| 57 | + |
| 58 | +## Feature X works in Google Chrome, but doesn't work in CEF Python |
| 59 | + |
| 60 | +CEF Python embeds Chromium Embedded Framework (CEF) which is based |
| 61 | +on Chromium browser. Functionality may differ a bit from Google Chrome. |
| 62 | +The browser from Google is a proprietary software that for example |
| 63 | +includes MPEG-4/H.264 codecs that aren't included in the open source |
| 64 | +Chromium. CEF currently doesn't support Chrome Extensions, but basic |
| 65 | +support for Chrome Extensions is being implemented in upstream CEF |
| 66 | +as of now. |
| 67 | + |
| 68 | +To see if some feature is working or a bug is fixed in newer CEF |
| 69 | +release perform the following steps: |
| 70 | + |
| 71 | +1. Download and install [CMake](https://cmake.org/download/) and |
| 72 | + [Ninja](https://github.com/ninja-build/ninja/releases) |
| 73 | +2. Go to [Spotify Automated Builds] |
| 74 | + (http://opensource.spotify.com/cefbuilds/index.html) |
| 75 | + and download latest CEF for your platform. Choose "Standard |
| 76 | + Distribution" binaries. |
| 77 | +3. Follow the instructions in `CMakeLists.txt` file |
| 78 | +4. Run either cefclient or cefsimple to test features |
| 79 | + |
| 80 | + |
| 81 | +## How to capture Audio and Video in HTML5? |
| 82 | + |
| 83 | +To be able to use the getUserMedia() function you need to set the |
| 84 | +"enable-media-stream" switch. |
| 85 | +See [api/Command line switches](../api/CommandLineSwitches.md) document. |
| 86 | + |
| 87 | + |
| 88 | +## Touch and multi-touch support |
| 89 | + |
| 90 | +In CEF v47 or later touch device is auto-detected and everything should |
| 91 | +work out of the box. If that's not the case try setting the following |
| 92 | +switches: |
| 93 | + |
| 94 | +* --touch-events=enabled |
| 95 | +* --enable-pinch |
| 96 | + |
| 97 | +See [api/Command line switches](../api/CommandLineSwitches.md) document. |
| 98 | + |
| 99 | + |
| 100 | +## Black or white browser screen |
| 101 | + |
| 102 | +If you get a black or white screen in the browser view then this may |
| 103 | +be caused by incompatible GPU (video card) drivers. There are following |
| 104 | +solutions to this: |
| 105 | + |
| 106 | +1. When CEF Python is updated to a newer CEF/Chromium version then the |
| 107 | +problem may be disappear. Check with latest Google Chrome if that is |
| 108 | +the case. |
| 109 | + |
| 110 | +2. Try updating your video card drivers to the latest version available |
| 111 | + |
| 112 | +3. You can disable GPU hardware acceleration by adding the "disable-gpu" |
| 113 | +and "disable-gpu-compositing" command line switches. See the |
| 114 | +[api/Command Line Switches](../api/CommandLineSwitches.md). Note that |
| 115 | +this will degrade performance if you're using any advanced 3D features. |
| 116 | +It will affect 2D accelerated content as well. |
| 117 | + |
| 118 | +Note that when web page uses WebGL then the black screen may still |
| 119 | +appear even after disabling GPU hardware acceleration. This is normal |
| 120 | +because GPU was disabled so WebGL cannot work. |
| 121 | + |
| 122 | + |
| 123 | +## Windows XP support |
| 124 | + |
| 125 | +CEF Python v31.2 was the last version to support Windows XP. This is |
| 126 | +due to Chromium/CEF dropping XP support, last CEF version that |
| 127 | +supported XP was v49. |
| 128 | + |
| 129 | +On XP you should disable GPU acceleration by using the --disable-gpu |
| 130 | +and --disable-gpu-compositing switches. These switches must be passed |
| 131 | +programmatically to cef.Initialize(), see [api/Command Line Switches] |
| 132 | +(../api/CommandLineSwitches.md). |
| 133 | + |
| 134 | + |
| 135 | +## Mac 32-bit support |
| 136 | + |
| 137 | +CEF Python v31.2 was the last version to support Mac 32-bit. |
| 138 | +This is due to CEF/Chromium dropping 32-bit support, last CEF version |
| 139 | +that supported 32-bit was v38. |
| 140 | + |
| 141 | + |
| 142 | +## Security |
| 143 | + |
| 144 | +A quote by Marshall Greenblatt: |
| 145 | + |
| 146 | +> CEF offers significant integration capabilities beyond what |
| 147 | +> is offered by a standard Google Chrome browser installation. |
| 148 | +> The trade off for these additional capabilities is that |
| 149 | +> organizations using CEF must take responsibility for their own |
| 150 | +> application security. CEF and the underlying open source projects |
| 151 | +> (Chromium, WebKit, etc) involve a significant amount of code and |
| 152 | +> offer no warranties. Organizations should document and follow best |
| 153 | +> practices to minimize potential security risks. Here are some |
| 154 | +> recommended best practices that organizations can consider: |
| 155 | +> - Only load known/trusted content. This is by far the best way |
| 156 | +> to avoid potential security issues. |
| 157 | +> - Disable plugins. This will avoid a large category of security |
| 158 | +> issues caused by buggy versions of Flash, Java, etc. |
| 159 | +> - Do not explicitly disable or bypass security features in your |
| 160 | +> application. For example, do not enable CefBrowserSettings that |
| 161 | +> bypass security features or add fake headers to bypass HTTP |
| 162 | +> access control. |
| 163 | +> - Keep your application up to date with the newest CEF release |
| 164 | +> branch. You may want to update the underlying Chromium release |
| 165 | +> version and perform your own builds to take immediate advantage |
| 166 | +> of any bug fixes. |
| 167 | +> - Enforce good programming practices. Every organization should |
| 168 | +> have best practices for design, testing and verification. |
| 169 | +> - Audit your application for potential security issues. Every |
| 170 | +> decision that may have security consequences should be evaluated |
| 171 | +> by people who are knowledgeable about security considerations. |
| 172 | +
|
| 173 | +Reference: [Question on browser security] |
| 174 | +(http://magpcss.org/ceforum/viewtopic.php?f=10&t=10222) |
| 175 | +on the CEF Forum. |
| 176 | + |
0 commit comments