There are problems with keyboard when allow CEF to create popup
windows internally. To create popup window explicitilly, the
LifespanHandler::OnBeforePopup callback was implemented. See its
source:
CreateAnotherBrowser
This will create a window on its own and embed browser in it.
When using "window.open" the window is created implicitilly
by CEF. You can intercept such popup creation using the
OnBeforePopup callback in LifespanHandler. You can return
True in OnBeforePopup and create popup window on your own
using the CreateAnotherBrowser function.
external.CreateAnotherBrowser()
Notes: On Linux it seems that OnLoadError with errorCode = ERR_ABORTED
is called even for successful downloads, you can ignore this behavior.
The proper console messages about successful/aborted download originate
from C++ Browser process code, these are:
Browser: About to download file: ubuntu-wallpapers2.zip
Browser: Download completed, saved to: /Downloads/ubuntu-wallpapers2.zip
If download was aborted the messages will be:
Browser: About to download file: ubuntu-wallpapers2.zip
Browser: Download was cancelled
Additionally on Linux there are more errors reported by Chromium
about org.gnome.SessionManager.inhibit. These can be safely ignored as well.
A download handler with callbacks like `OnBeforeDownload` and
`OnDownloadUpdated` may be exposed to CEF Python in the future.
Press F5 to reload page and ignore cache.
Press Esc during webpage loading to abort.
Also, when Esc is pressed OnLoadError may get called. See how abort
of page loading or file download is handled:
jsBindings.SetProperty("pyProperty", "This was set in Python")
jsBindings.SetProperty("pyConfig", ["This was set in Python",
{"name": "Nested dictionary", "isNested": True},
[1,"2", None]])
Press F5 to reload the page.
On Linux it is required to click anywhere in the window first
so that keyboard focus is set. See Issue 77 in the CEF Python
Issue Tracker.
Try to terminate the "subprocess.exe" renderer process through
task manager.
OnPluginCrashed
No test for that yet.
Cookie tests
See messages in the console.
GetCookieManager
RequestHandler.GetCookieManager() - an example of having an unique
cookie manager for each browser.
Visit the url below and set some cookies. Use "Back" from
context menu to get back here (you might have to click "Back"
multiple times).
Visit it in the current browser:
http://www.html-kit.com/tools/cookietester/
Popup browsers created javascript's window.open share
the same renderer process and request context. If you want
to have separate cookie managers for popups created using
window.open then you have to implement the
LifespanHandler.`OnBeforePopup` callback. Return True in that
callback to cancel popup creation and instead create the
window on your own and embed browser in it. The CreateAnotherBrowser()
function from the wxpython example does that.
See messages in the console during loading of a webpage.
OnLoadingStateChange
OnLoadStart
OnLoadEnd
OnLoadError
After you see the custom error message you have to hit
twice the Back from the context menu, to get back to this page.
Try this:
http://www.non-existent.nono/