From 0a7d8d673bacb1ac5a4a40dc68f3462bf4debe92 Mon Sep 17 00:00:00 2001 From: cztomczak Date: Tue, 20 Dec 2016 20:11:35 +0100 Subject: [PATCH] Fix focus in all examples. Pass kwargs to Handlers' callbacks (BC BREAK!). Fix focus issue in qt.py and gtk2.py examples during app initial loading (#284). The solution is to call SetFocus in OnLoadStart once. Pass keyword arguments to Handlers' callbacks (#291). This will break many of existing code for Handlers' callbacks. Similar changes were also applied to: CookieVisitor, StringVisitor, WebRequestClient. In JavascriptDialogCallback.Continue "userInput" argument was renamed to "user_input". Fix PyCharm warnings in kivy_.py example (#285). Rename JavascriptContextHandler to V8ContextHandler (API docs only changes). Update tools/apidocs.py. Sort top-level headings by name. --- api/API-categories.md | 13 +- api/API-index.md | 593 +++++++++--------- api/ApplicationSettings.md | 2 +- api/CookieVisitor.md | 4 +- api/DisplayHandler.md | 6 +- api/FocusHandler.md | 2 +- api/JavascriptDialogHandler.md | 10 +- api/KeyboardHandler.md | 17 +- api/LifespanHandler.md | 22 +- api/LoadHandler.md | 30 +- api/RenderHandler.md | 51 +- api/RequestHandler.md | 132 ++-- api/ResourceHandler.md | 38 +- ...tContextHandler.md => V8ContextHandler.md} | 21 +- api/WebRequestClient.md | 35 +- docs/Tutorial.md | 31 +- examples/gtk2.py | 23 +- examples/qt.py | 57 +- examples/tkinter_.py | 17 +- src/cookie.pyx | 6 +- src/handlers/display_handler.pyx | 11 +- src/handlers/focus_handler.pyx | 6 +- src/handlers/javascript_dialog_handler.pyx | 26 +- src/handlers/keyboard_handler.pyx | 14 +- src/handlers/lifespan_handler.pyx | 22 +- src/handlers/load_handler.pyx | 18 +- src/handlers/render_handler.pyx | 37 +- src/handlers/request_handler.pyx | 105 +++- src/handlers/resource_handler.pyx | 15 +- src/handlers/v8context_handler.pyx | 4 +- src/linux/binaries_64bit/kivy_.py | 395 +++++------- src/linux/setup/cefpython.h | 2 +- src/string_visitor.pyx | 2 +- src/web_request.pyx | 16 +- tools/apidocs.py | 2 +- unittests/main_test.py | 19 +- 36 files changed, 956 insertions(+), 848 deletions(-) rename api/{JavascriptContextHandler.md => V8ContextHandler.md} (72%) diff --git a/api/API-categories.md b/api/API-categories.md index 04ace1af..a338fc34 100644 --- a/api/API-categories.md +++ b/api/API-categories.md @@ -15,7 +15,7 @@ * [CommandLineSwitches](CommandLineSwitches.md) dictionary -### Objects +### Classes and objects * [Browser](Browser.md) object * [Callback](Callback.md) object @@ -36,12 +36,11 @@ * [WindowUtils](WindowUtils.md) class -### Handlers +### Handlers (interfaces) * [DisplayHandler](DisplayHandler.md) * [DownloadHandler](DownloadHandler.md) * [FocusHandler](FocusHandler.md) - * [JavascriptContextHandler](JavascriptContextHandler.md) * [JavascriptDialogHandler](JavascriptDialogHandler.md) * [KeyboardHandler](KeyboardHandler.md) * [LifespanHandler](LifespanHandler.md) @@ -49,4 +48,12 @@ * [RenderHandler](RenderHandler.md) * [RequestHandler](RequestHandler.md) * [ResourceHandler](ResourceHandler.md) + * [V8ContextHandler](V8ContextHandler.md) + + +### Other interfaces + + * [CookieVisitor](CookieVisitor.md) interface + * [StringVisitor](StringVisitor.md) interface + * [WebRequestClient](WebRequestClient.md) interface diff --git a/api/API-index.md b/api/API-index.md index 2d8573a9..ee8882a4 100644 --- a/api/API-index.md +++ b/api/API-index.md @@ -2,92 +2,6 @@ # API index -* [DownloadHandler](DownloadHandler.md) -* [JavascriptBindings (class)](JavascriptBindings.md) - * [\_\_init\_\_](JavascriptBindings.md#__init__) - * [IsValueAllowed](JavascriptBindings.md#isvalueallowed) - * [Rebind](JavascriptBindings.md#rebind) - * [SetFunction](JavascriptBindings.md#setfunction) - * [SetObject](JavascriptBindings.md#setobject) - * [SetProperty](JavascriptBindings.md#setproperty) -* [Cookie (class)](Cookie.md) - * [Set](Cookie.md#set) - * [Get](Cookie.md#get) - * [SetName](Cookie.md#setname) - * [GetName](Cookie.md#getname) - * [SetValue](Cookie.md#setvalue) - * [GetValue](Cookie.md#getvalue) - * [SetDomain](Cookie.md#setdomain) - * [GetDomain](Cookie.md#getdomain) - * [SetPath](Cookie.md#setpath) - * [GetPath](Cookie.md#getpath) - * [SetSecure](Cookie.md#setsecure) - * [GetSecure](Cookie.md#getsecure) - * [SetHttpOnly](Cookie.md#sethttponly) - * [GetHttpOnly](Cookie.md#gethttponly) - * [SetCreation](Cookie.md#setcreation) - * [GetCreation](Cookie.md#getcreation) - * [SetLastAccess](Cookie.md#setlastaccess) - * [GetLastAccess](Cookie.md#getlastaccess) - * [SetHasExpires](Cookie.md#sethasexpires) - * [GetHasExpires](Cookie.md#gethasexpires) - * [SetExpires](Cookie.md#setexpires) - * [GetExpires](Cookie.md#getexpires) -* [CookieVisitor (interface)](CookieVisitor.md) - * [Visit](CookieVisitor.md#visit) -* [DpiAware (class)](DpiAware.md) - * [CalculateWindowSize](DpiAware.md#calculatewindowsize) - * [GetSystemDpi](DpiAware.md#getsystemdpi) - * [IsProcessDpiAware](DpiAware.md#isprocessdpiaware) - * [SetProcessDpiAware](DpiAware.md#setprocessdpiaware) -* [KeyboardHandler (interface)](KeyboardHandler.md) - * [OnPreKeyEvent](KeyboardHandler.md#onprekeyevent) - * [OnKeyEvent](KeyboardHandler.md#onkeyevent) -* [StringVisitor (interface)](StringVisitor.md) - * [Visit](StringVisitor.md#visit) -* [Image (object)](Image.md) - * [GetAsBitmap](Image.md#getasbitmap) - * [GetAsPng](Image.md#getaspng) - * [GetHeight](Image.md#getheight) - * [GetWidth](Image.md#getwidth) -* [JavascriptDialogHandler (interface)](JavascriptDialogHandler.md) - * [Continue](JavascriptDialogHandler.md#continue) - * [OnJavascriptDialog](JavascriptDialogHandler.md#onjavascriptdialog) - * [OnBeforeUnloadJavascriptDialog](JavascriptDialogHandler.md#onbeforeunloadjavascriptdialog) - * [OnResetJavascriptDialogState](JavascriptDialogHandler.md#onresetjavascriptdialogstate) - * [OnJavascriptDialogClosed](JavascriptDialogHandler.md#onjavascriptdialogclosed) -* [FocusHandler (interface)](FocusHandler.md) - * [OnTakeFocus](FocusHandler.md#ontakefocus) - * [OnSetFocus](FocusHandler.md#onsetfocus) - * [OnGotFocus](FocusHandler.md#ongotfocus) -* [DisplayHandler (interface)](DisplayHandler.md) - * [OnAddressChange](DisplayHandler.md#onaddresschange) - * [OnTitleChange](DisplayHandler.md#ontitlechange) - * [OnTooltip](DisplayHandler.md#ontooltip) - * [OnStatusMessage](DisplayHandler.md#onstatusmessage) - * [OnConsoleMessage](DisplayHandler.md#onconsolemessage) -* [PaintBuffer (object)](PaintBuffer.md) - * [GetIntPointer](PaintBuffer.md#getintpointer) - * [GetString](PaintBuffer.md#getstring) -* [Request (class)](Request.md) - * [CreateRequest](Request.md#createrequest) - * [IsReadOnly](Request.md#isreadonly) - * [GetUrl](Request.md#geturl) - * [SetUrl](Request.md#seturl) - * [GetMethod](Request.md#getmethod) - * [SetMethod](Request.md#setmethod) - * [GetPostData](Request.md#getpostdata) - * [SetPostData](Request.md#setpostdata) - * [GetHeaderMap](Request.md#getheadermap) - * [GetHeaderMultimap](Request.md#getheadermultimap) - * [SetHeaderMap](Request.md#setheadermap) - * [SetHeaderMultimap](Request.md#setheadermultimap) - * [GetFlags](Request.md#getflags) - * [SetFlags](Request.md#setflags) - * [GetFirstPartyForCookies](Request.md#getfirstpartyforcookies) - * [SetFirstPartyForCookies](Request.md#setfirstpartyforcookies) - * [GetResourceType](Request.md#getresourcetype) - * [GetTransitionType](Request.md#gettransitiontype) * [Application settings](ApplicationSettings.md) * [accept_language_list](ApplicationSettings.md#accept_language_list) * [auto_zooming](ApplicationSettings.md#auto_zooming) @@ -97,6 +11,7 @@ * [command_line_args_disabled](ApplicationSettings.md#command_line_args_disabled) * [context_menu](ApplicationSettings.md#context_menu) * [downloads_enabled](ApplicationSettings.md#downloads_enabled) + * [external_message_pump](ApplicationSettings.md#external_message_pump) * [ignore_certificate_errors](ApplicationSettings.md#ignore_certificate_errors) * [javascript_flags](ApplicationSettings.md#javascript_flags) * [locale](ApplicationSettings.md#locale) @@ -105,6 +20,7 @@ * [log_file](ApplicationSettings.md#log_file) * [log_severity](ApplicationSettings.md#log_severity) * [multi_threaded_message_loop](ApplicationSettings.md#multi_threaded_message_loop) + * [net_security_expiration_enabled](ApplicationSettings.md#net_security_expiration_enabled) * [pack_loading_disabled](ApplicationSettings.md#pack_loading_disabled) * [persist_session_cookies](ApplicationSettings.md#persist_session_cookies) * [persist_user_preferences](ApplicationSettings.md#persist_user_preferences) @@ -118,20 +34,78 @@ * [user_agent](ApplicationSettings.md#user_agent) * [user_data_path](ApplicationSettings.md#user_data_path) * [windowless_rendering_enabled](ApplicationSettings.md#windowless_rendering_enabled) -* [DragData (object)](DragData.md) - * [IsLink](DragData.md#islink) - * [IsFragment](DragData.md#isfragment) - * [GetLinkUrl](DragData.md#getlinkurl) - * [GetLinkTitle](DragData.md#getlinktitle) - * [GetFragmentText](DragData.md#getfragmenttext) - * [GetFragmentHtml](DragData.md#getfragmenthtml) - * [GetImage](DragData.md#getimage) - * [HasImage](DragData.md#hasimage) -* [LifespanHandler (interface)](LifespanHandler.md) - * [OnBeforePopup](LifespanHandler.md#onbeforepopup) - * [_OnAfterCreated](LifespanHandler.md#_onaftercreated) - * [DoClose](LifespanHandler.md#doclose) - * [OnBeforeClose](LifespanHandler.md#onbeforeclose) +* [Browser (object)](Browser.md) + * [CanGoBack](Browser.md#cangoback) + * [CanGoForward](Browser.md#cangoforward) + * [CloseBrowser](Browser.md#closebrowser) + * [CloseDevTools](Browser.md#closedevtools) + * [DragTargetDragEnter](Browser.md#dragtargetdragenter) + * [DragTargetDragOver](Browser.md#dragtargetdragover) + * [DragTargetDragLeave](Browser.md#dragtargetdragleave) + * [DragTargetDrop](Browser.md#dragtargetdrop) + * [DragSourceEndedAt](Browser.md#dragsourceendedat) + * [DragSourceSystemDragEnded](Browser.md#dragsourcesystemdragended) + * [ExecuteFunction](Browser.md#executefunction) + * [ExecuteJavascript](Browser.md#executejavascript) + * [Find](Browser.md#find) + * [GetClientCallback](Browser.md#getclientcallback) + * [GetClientCallbacksDict](Browser.md#getclientcallbacksdict) + * [GetFocusedFrame](Browser.md#getfocusedframe) + * [GetFrame](Browser.md#getframe) + * [GetFrameByIdentifier](Browser.md#getframebyidentifier) + * [GetFrames](Browser.md#getframes) + * [GetFrameCount](Browser.md#getframecount) + * [GetFrameIdentifiers](Browser.md#getframeidentifiers) + * [GetFrameNames](Browser.md#getframenames) + * [GetJavascriptBindings](Browser.md#getjavascriptbindings) + * [GetMainFrame](Browser.md#getmainframe) + * [GetNSTextInputContext](Browser.md#getnstextinputcontext) + * [GetOpenerWindowHandle](Browser.md#getopenerwindowhandle) + * [GetOuterWindowHandle](Browser.md#getouterwindowhandle) + * [GetUrl](Browser.md#geturl) + * [GetUserData](Browser.md#getuserdata) + * [GetWindowHandle](Browser.md#getwindowhandle) + * [GetIdentifier](Browser.md#getidentifier) + * [GetZoomLevel](Browser.md#getzoomlevel) + * [GoBack](Browser.md#goback) + * [GoForward](Browser.md#goforward) + * [HandleKeyEventAfterTextInputClient](Browser.md#handlekeyeventaftertextinputclient) + * [HandleKeyEventBeforeTextInputClient](Browser.md#handlekeyeventbeforetextinputclient) + * [HasDocument](Browser.md#hasdocument) + * [IsFullscreen](Browser.md#isfullscreen) + * [IsLoading](Browser.md#isloading) + * [IsMouseCursorChangeDisabled](Browser.md#ismousecursorchangedisabled) + * [IsPopup](Browser.md#ispopup) + * [IsWindowRenderingDisabled](Browser.md#iswindowrenderingdisabled) + * [LoadUrl](Browser.md#loadurl) + * [Navigate](Browser.md#navigate) + * [NotifyMoveOrResizeStarted](Browser.md#notifymoveorresizestarted) + * [NotifyScreenInfoChanged](Browser.md#notifyscreeninfochanged) + * [ParentWindowWillClose](Browser.md#parentwindowwillclose) + * [Reload](Browser.md#reload) + * [ReloadIgnoreCache](Browser.md#reloadignorecache) + * [SetBounds](Browser.md#setbounds) + * [SendKeyEvent](Browser.md#sendkeyevent) + * [SendMouseClickEvent](Browser.md#sendmouseclickevent) + * [SendMouseMoveEvent](Browser.md#sendmousemoveevent) + * [SendMouseWheelEvent](Browser.md#sendmousewheelevent) + * [SendFocusEvent](Browser.md#sendfocusevent) + * [SendCaptureLostEvent](Browser.md#sendcapturelostevent) + * [SetClientCallback](Browser.md#setclientcallback) + * [SetClientHandler](Browser.md#setclienthandler) + * [SetFocus](Browser.md#setfocus) + * [SetMouseCursorChangeDisabled](Browser.md#setmousecursorchangedisabled) + * [SetJavascriptBindings](Browser.md#setjavascriptbindings) + * [SetUserData](Browser.md#setuserdata) + * [SetZoomLevel](Browser.md#setzoomlevel) + * [ShowDevTools](Browser.md#showdevtools) + * [StartDownload](Browser.md#startdownload) + * [StopLoad](Browser.md#stopload) + * [StopFinding](Browser.md#stopfinding) + * [ToggleFullscreen](Browser.md#togglefullscreen) + * [TryCloseBrowser](Browser.md#tryclosebrowser) + * [WasResized](Browser.md#wasresized) + * [WasHidden](Browser.md#washidden) * [Browser settings](BrowserSettings.md) * [Font settings](BrowserSettings.md#font-settings) * [accept_language_list](BrowserSettings.md#accept_language_list) @@ -158,40 +132,9 @@ * [web_security_disabled](BrowserSettings.md#web_security_disabled) * [webgl_disabled](BrowserSettings.md#webgl_disabled) * [windowless_frame_rate](BrowserSettings.md#windowless_frame_rate) -* [ResourceHandler (interface)](ResourceHandler.md) - * [ProcessRequest](ResourceHandler.md#processrequest) - * [GetResponseHeaders](ResourceHandler.md#getresponseheaders) - * [ReadResponse](ResourceHandler.md#readresponse) - * [CanGetCookie](ResourceHandler.md#cangetcookie) - * [CanSetCookie](ResourceHandler.md#cansetcookie) - * [Cancel](ResourceHandler.md#cancel) -* [Frame (object)](Frame.md) - * [Copy](Frame.md#copy) - * [Cut](Frame.md#cut) - * [Delete](Frame.md#delete) - * [ExecuteFunction](Frame.md#executefunction) - * [ExecuteJavascript](Frame.md#executejavascript) - * [GetBrowser](Frame.md#getbrowser) - * [GetParent](Frame.md#getparent) - * [GetIdentifier](Frame.md#getidentifier) - * [GetBrowserIdentifier](Frame.md#getbrowseridentifier) - * [GetName](Frame.md#getname) - * [GetParent](Frame.md#getparent) - * [GetProperty](Frame.md#getproperty) - * [GetSource](Frame.md#getsource) - * [GetText](Frame.md#gettext) - * [GetUrl](Frame.md#geturl) - * [IsFocused](Frame.md#isfocused) - * [IsMain](Frame.md#ismain) - * [IsValid](Frame.md#isvalid) - * [LoadString](Frame.md#loadstring) - * [LoadUrl](Frame.md#loadurl) - * [Paste](Frame.md#paste) - * [Redo](Frame.md#redo) - * [SelectAll](Frame.md#selectall) - * [SetProperty](Frame.md#setproperty) - * [Undo](Frame.md#undo) - * [ViewSource](Frame.md#viewsource) +* [Callback (object)](Callback.md) + * [Continue](Callback.md#continue) + * [Cancel](Callback.md#cancel) * [cefpython](cefpython.md) * [CreateBrowser](cefpython.md#createbrowser) * [CreateBrowserSync](cefpython.md#createbrowsersync) @@ -211,59 +154,34 @@ * [SetGlobalClientCallback](cefpython.md#setglobalclientcallback) * [SetOsModalLoop](cefpython.md#setosmodalloop) * [Shutdown](cefpython.md#shutdown) -* [LoadHandler (interface)](LoadHandler.md) - * [OnLoadingStateChange](LoadHandler.md#onloadingstatechange) - * [OnLoadStart](LoadHandler.md#onloadstart) - * [OnDomReady](LoadHandler.md#ondomready) - * [OnLoadEnd](LoadHandler.md#onloadend) - * [OnLoadError](LoadHandler.md#onloaderror) -* [Callback (object)](Callback.md) - * [Continue](Callback.md#continue) - * [Cancel](Callback.md#cancel) -* [JavascriptContextHandler (interface)](JavascriptContextHandler.md) - * [OnContextCreated](JavascriptContextHandler.md#oncontextcreated) - * [OnContextReleased](JavascriptContextHandler.md#oncontextreleased) -* [WebRequest (class)](WebRequest.md) - * [Create](WebRequest.md#create) - * [GetRequest](WebRequest.md#getrequest) - * [GetRequestStatus](WebRequest.md#getrequeststatus) - * [GetRequestError](WebRequest.md#getrequesterror) - * [GetResponse](WebRequest.md#getresponse) - * [Cancel](WebRequest.md#cancel) -* [Response (object)](Response.md) - * [IsReadOnly](Response.md#isreadonly) - * [GetStatus](Response.md#getstatus) - * [SetStatus](Response.md#setstatus) - * [GetStatusText](Response.md#getstatustext) - * [SetStatusText](Response.md#setstatustext) - * [GetMimeType](Response.md#getmimetype) - * [SetMimeType](Response.md#setmimetype) - * [GetHeader](Response.md#getheader) - * [GetHeaderMap](Response.md#getheadermap) - * [GetHeaderMultimap](Response.md#getheadermultimap) - * [SetHeaderMap](Response.md#setheadermap) - * [SetHeaderMultimap](Response.md#setheadermultimap) -* [WindowInfo (class)](WindowInfo.md) - * [SetAsChild](WindowInfo.md#setaschild) - * [SetAsPopup](WindowInfo.md#setaspopup) - * [SetAsOffscreen](WindowInfo.md#setasoffscreen) - * [SetTransparentPainting](WindowInfo.md#settransparentpainting) -* [WebPluginInfo (object)](WebPluginInfo.md) - * [GetName](WebPluginInfo.md#getname) - * [GetPath](WebPluginInfo.md#getpath) - * [GetVersion](WebPluginInfo.md#getversion) - * [GetDescription](WebPluginInfo.md#getdescription) -* [WindowUtils (class)](WindowUtils.md) - * [OnSetFocus ](WindowUtils.md#onsetfocus-win) - * [OnSize ](WindowUtils.md#onsize-win) - * [OnEraseBackground ](WindowUtils.md#onerasebackground-win) - * [SetTitle ](WindowUtils.md#settitle-win) - * [SetIcon ](WindowUtils.md#seticon-win) - * [GetParentHandle](WindowUtils.md#getparenthandle) - * [IsWindowHandle](WindowUtils.md#iswindowhandle) - * [gtk_plug_new ](WindowUtils.md#gtk_plug_new-linux) - * [gtk_widget_show ](WindowUtils.md#gtk_widget_show-linux) - * [InstallX11ErrorHandlers ](WindowUtils.md#installx11errorhandlers-linux) +* [Command line switches](CommandLineSwitches.md) + * [enable-media-stream](CommandLineSwitches.md#enable-media-stream) + * [proxy-server](CommandLineSwitches.md#proxy-server) + * [no-proxy-server](CommandLineSwitches.md#no-proxy-server) + * [disable-gpu](CommandLineSwitches.md#disable-gpu) +* [Cookie (class)](Cookie.md) + * [Set](Cookie.md#set) + * [Get](Cookie.md#get) + * [SetName](Cookie.md#setname) + * [GetName](Cookie.md#getname) + * [SetValue](Cookie.md#setvalue) + * [GetValue](Cookie.md#getvalue) + * [SetDomain](Cookie.md#setdomain) + * [GetDomain](Cookie.md#getdomain) + * [SetPath](Cookie.md#setpath) + * [GetPath](Cookie.md#getpath) + * [SetSecure](Cookie.md#setsecure) + * [GetSecure](Cookie.md#getsecure) + * [SetHttpOnly](Cookie.md#sethttponly) + * [GetHttpOnly](Cookie.md#gethttponly) + * [SetCreation](Cookie.md#setcreation) + * [GetCreation](Cookie.md#getcreation) + * [SetLastAccess](Cookie.md#setlastaccess) + * [GetLastAccess](Cookie.md#getlastaccess) + * [SetHasExpires](Cookie.md#sethasexpires) + * [GetHasExpires](Cookie.md#gethasexpires) + * [SetExpires](Cookie.md#setexpires) + * [GetExpires](Cookie.md#getexpires) * [CookieManager (class)](CookieManager.md) * [GetGlobalManager](CookieManager.md#getglobalmanager) * [CreateManager](CookieManager.md#createmanager) @@ -274,46 +192,95 @@ * [DeleteCookies](CookieManager.md#deletecookies) * [SetStoragePath](CookieManager.md#setstoragepath) * [FlushStore](CookieManager.md#flushstore) -* [Command line switches](CommandLineSwitches.md) - * [enable-media-stream](CommandLineSwitches.md#enable-media-stream) - * [proxy-server](CommandLineSwitches.md#proxy-server) - * [no-proxy-server](CommandLineSwitches.md#no-proxy-server) - * [disable-gpu](CommandLineSwitches.md#disable-gpu) +* [CookieVisitor (interface)](CookieVisitor.md) + * [Visit](CookieVisitor.md#visit) +* [DisplayHandler (interface)](DisplayHandler.md) + * [OnAddressChange](DisplayHandler.md#onaddresschange) + * [OnTitleChange](DisplayHandler.md#ontitlechange) + * [OnTooltip](DisplayHandler.md#ontooltip) + * [OnStatusMessage](DisplayHandler.md#onstatusmessage) + * [OnConsoleMessage](DisplayHandler.md#onconsolemessage) +* [DownloadHandler](DownloadHandler.md) +* [DpiAware (class)](DpiAware.md) + * [CalculateWindowSize](DpiAware.md#calculatewindowsize) + * [GetSystemDpi](DpiAware.md#getsystemdpi) + * [IsProcessDpiAware](DpiAware.md#isprocessdpiaware) + * [SetProcessDpiAware](DpiAware.md#setprocessdpiaware) +* [DragData (object)](DragData.md) + * [IsLink](DragData.md#islink) + * [IsFragment](DragData.md#isfragment) + * [GetLinkUrl](DragData.md#getlinkurl) + * [GetLinkTitle](DragData.md#getlinktitle) + * [GetFragmentText](DragData.md#getfragmenttext) + * [GetFragmentHtml](DragData.md#getfragmenthtml) + * [GetImage](DragData.md#getimage) + * [HasImage](DragData.md#hasimage) +* [FocusHandler (interface)](FocusHandler.md) + * [OnTakeFocus](FocusHandler.md#ontakefocus) + * [OnSetFocus](FocusHandler.md#onsetfocus) + * [OnGotFocus](FocusHandler.md#ongotfocus) +* [Frame (object)](Frame.md) + * [Copy](Frame.md#copy) + * [Cut](Frame.md#cut) + * [Delete](Frame.md#delete) + * [ExecuteFunction](Frame.md#executefunction) + * [ExecuteJavascript](Frame.md#executejavascript) + * [GetBrowser](Frame.md#getbrowser) + * [GetParent](Frame.md#getparent) + * [GetIdentifier](Frame.md#getidentifier) + * [GetBrowserIdentifier](Frame.md#getbrowseridentifier) + * [GetName](Frame.md#getname) + * [GetParent](Frame.md#getparent) + * [GetProperty](Frame.md#getproperty) + * [GetSource](Frame.md#getsource) + * [GetText](Frame.md#gettext) + * [GetUrl](Frame.md#geturl) + * [IsFocused](Frame.md#isfocused) + * [IsMain](Frame.md#ismain) + * [IsValid](Frame.md#isvalid) + * [LoadString](Frame.md#loadstring) + * [LoadUrl](Frame.md#loadurl) + * [Paste](Frame.md#paste) + * [Redo](Frame.md#redo) + * [SelectAll](Frame.md#selectall) + * [SetProperty](Frame.md#setproperty) + * [Undo](Frame.md#undo) + * [ViewSource](Frame.md#viewsource) +* [Image (object)](Image.md) + * [GetAsBitmap](Image.md#getasbitmap) + * [GetAsPng](Image.md#getaspng) + * [GetHeight](Image.md#getheight) + * [GetWidth](Image.md#getwidth) +* [JavascriptBindings (class)](JavascriptBindings.md) + * [\_\_init\_\_](JavascriptBindings.md#__init__) + * [IsValueAllowed](JavascriptBindings.md#isvalueallowed) + * [Rebind](JavascriptBindings.md#rebind) + * [SetFunction](JavascriptBindings.md#setfunction) + * [SetObject](JavascriptBindings.md#setobject) + * [SetProperty](JavascriptBindings.md#setproperty) * [JavascriptCallback (object)](JavascriptCallback.md) * [Call](JavascriptCallback.md#call) * [GetName](JavascriptCallback.md#getname) -* [RenderHandler (interface)](RenderHandler.md) - * [GetRootScreenRect](RenderHandler.md#getrootscreenrect) - * [GetViewRect](RenderHandler.md#getviewrect) - * [GetScreenRect](RenderHandler.md#getscreenrect) - * [GetScreenPoint](RenderHandler.md#getscreenpoint) - * [OnPopupShow](RenderHandler.md#onpopupshow) - * [OnPopupSize](RenderHandler.md#onpopupsize) - * [OnPaint](RenderHandler.md#onpaint) - * [OnCursorChange](RenderHandler.md#oncursorchange) - * [OnScrollOffsetChanged](RenderHandler.md#onscrolloffsetchanged) - * [StartDragging](RenderHandler.md#startdragging) - * [UpdateDragCursor](RenderHandler.md#updatedragcursor) -* [WebRequestClient (interface)](WebRequestClient.md) - * [OnUploadProgress](WebRequestClient.md#onuploadprogress) - * [OnDownloadProgress](WebRequestClient.md#ondownloadprogress) - * [OnDownloadData](WebRequestClient.md#ondownloaddata) - * [OnRequestComplete](WebRequestClient.md#onrequestcomplete) - * [GetAuthCredentials](WebRequestClient.md#getauthcredentials) -* [RequestHandler (interface)](RequestHandler.md) - * [OnBeforeBrowse](RequestHandler.md#onbeforebrowse) - * [OnBeforeResourceLoad](RequestHandler.md#onbeforeresourceload) - * [GetResourceHandler](RequestHandler.md#getresourcehandler) - * [OnResourceResponse](RequestHandler.md#onresourceresponse) - * [OnResourceRedirect](RequestHandler.md#onresourceredirect) - * [GetAuthCredentials](RequestHandler.md#getauthcredentials) - * [OnQuotaRequest](RequestHandler.md#onquotarequest) - * [GetCookieManager](RequestHandler.md#getcookiemanager) - * [OnProtocolExecution](RequestHandler.md#onprotocolexecution) - * [_OnBeforePluginLoad](RequestHandler.md#_onbeforepluginload) - * [_OnCertificateError](RequestHandler.md#_oncertificateerror) - * [OnRendererProcessTerminated](RequestHandler.md#onrendererprocessterminated) - * [OnPluginCrashed](RequestHandler.md#onplugincrashed) +* [JavascriptDialogHandler (interface)](JavascriptDialogHandler.md) + * [Continue](JavascriptDialogHandler.md#continue) + * [OnJavascriptDialog](JavascriptDialogHandler.md#onjavascriptdialog) + * [OnBeforeUnloadJavascriptDialog](JavascriptDialogHandler.md#onbeforeunloadjavascriptdialog) + * [OnResetJavascriptDialogState](JavascriptDialogHandler.md#onresetjavascriptdialogstate) + * [OnJavascriptDialogClosed](JavascriptDialogHandler.md#onjavascriptdialogclosed) +* [KeyboardHandler (interface)](KeyboardHandler.md) + * [OnPreKeyEvent](KeyboardHandler.md#onprekeyevent) + * [OnKeyEvent](KeyboardHandler.md#onkeyevent) +* [LifespanHandler (interface)](LifespanHandler.md) + * [OnBeforePopup](LifespanHandler.md#onbeforepopup) + * [_OnAfterCreated](LifespanHandler.md#_onaftercreated) + * [DoClose](LifespanHandler.md#doclose) + * [OnBeforeClose](LifespanHandler.md#onbeforeclose) +* [LoadHandler (interface)](LoadHandler.md) + * [OnLoadingStateChange](LoadHandler.md#onloadingstatechange) + * [OnLoadStart](LoadHandler.md#onloadstart) + * [OnDomReady](LoadHandler.md#ondomready) + * [OnLoadEnd](LoadHandler.md#onloadend) + * [OnLoadError](LoadHandler.md#onloaderror) * [Network error](NetworkError.md) * [ERR_NONE](NetworkError.md#err_none) * [ERR_ABORTED](NetworkError.md#err_aborted) @@ -364,76 +331,110 @@ * [ERR_UNKNOWN_URL_SCHEME](NetworkError.md#err_unknown_url_scheme) * [ERR_UNSAFE_PORT](NetworkError.md#err_unsafe_port) * [ERR_UNSAFE_REDIRECT](NetworkError.md#err_unsafe_redirect) +* [PaintBuffer (object)](PaintBuffer.md) + * [GetIntPointer](PaintBuffer.md#getintpointer) + * [GetString](PaintBuffer.md#getstring) +* [RenderHandler (interface)](RenderHandler.md) + * [GetRootScreenRect](RenderHandler.md#getrootscreenrect) + * [GetViewRect](RenderHandler.md#getviewrect) + * [GetScreenRect](RenderHandler.md#getscreenrect) + * [GetScreenPoint](RenderHandler.md#getscreenpoint) + * [OnPopupShow](RenderHandler.md#onpopupshow) + * [OnPopupSize](RenderHandler.md#onpopupsize) + * [OnPaint](RenderHandler.md#onpaint) + * [OnCursorChange](RenderHandler.md#oncursorchange) + * [OnScrollOffsetChanged](RenderHandler.md#onscrolloffsetchanged) + * [StartDragging](RenderHandler.md#startdragging) + * [UpdateDragCursor](RenderHandler.md#updatedragcursor) +* [Request (class)](Request.md) + * [CreateRequest](Request.md#createrequest) + * [IsReadOnly](Request.md#isreadonly) + * [GetUrl](Request.md#geturl) + * [SetUrl](Request.md#seturl) + * [GetMethod](Request.md#getmethod) + * [SetMethod](Request.md#setmethod) + * [GetPostData](Request.md#getpostdata) + * [SetPostData](Request.md#setpostdata) + * [GetHeaderMap](Request.md#getheadermap) + * [GetHeaderMultimap](Request.md#getheadermultimap) + * [SetHeaderMap](Request.md#setheadermap) + * [SetHeaderMultimap](Request.md#setheadermultimap) + * [GetFlags](Request.md#getflags) + * [SetFlags](Request.md#setflags) + * [GetFirstPartyForCookies](Request.md#getfirstpartyforcookies) + * [SetFirstPartyForCookies](Request.md#setfirstpartyforcookies) + * [GetResourceType](Request.md#getresourcetype) + * [GetTransitionType](Request.md#gettransitiontype) +* [RequestHandler (interface)](RequestHandler.md) + * [OnBeforeBrowse](RequestHandler.md#onbeforebrowse) + * [OnBeforeResourceLoad](RequestHandler.md#onbeforeresourceload) + * [GetResourceHandler](RequestHandler.md#getresourcehandler) + * [OnResourceRedirect](RequestHandler.md#onresourceredirect) + * [OnResourceResponse](RequestHandler.md#onresourceresponse) + * [GetAuthCredentials](RequestHandler.md#getauthcredentials) + * [OnQuotaRequest](RequestHandler.md#onquotarequest) + * [GetCookieManager](RequestHandler.md#getcookiemanager) + * [OnProtocolExecution](RequestHandler.md#onprotocolexecution) + * [_OnBeforePluginLoad](RequestHandler.md#_onbeforepluginload) + * [_OnCertificateError](RequestHandler.md#_oncertificateerror) + * [OnRendererProcessTerminated](RequestHandler.md#onrendererprocessterminated) + * [OnPluginCrashed](RequestHandler.md#onplugincrashed) +* [ResourceHandler (interface)](ResourceHandler.md) + * [ProcessRequest](ResourceHandler.md#processrequest) + * [GetResponseHeaders](ResourceHandler.md#getresponseheaders) + * [ReadResponse](ResourceHandler.md#readresponse) + * [CanGetCookie](ResourceHandler.md#cangetcookie) + * [CanSetCookie](ResourceHandler.md#cansetcookie) + * [Cancel](ResourceHandler.md#cancel) +* [Response (object)](Response.md) + * [IsReadOnly](Response.md#isreadonly) + * [GetStatus](Response.md#getstatus) + * [SetStatus](Response.md#setstatus) + * [GetStatusText](Response.md#getstatustext) + * [SetStatusText](Response.md#setstatustext) + * [GetMimeType](Response.md#getmimetype) + * [SetMimeType](Response.md#setmimetype) + * [GetHeader](Response.md#getheader) + * [GetHeaderMap](Response.md#getheadermap) + * [GetHeaderMultimap](Response.md#getheadermultimap) + * [SetHeaderMap](Response.md#setheadermap) + * [SetHeaderMultimap](Response.md#setheadermultimap) +* [StringVisitor (interface)](StringVisitor.md) + * [Visit](StringVisitor.md#visit) +* [V8ContextHandler (interface)](V8ContextHandler.md) + * [OnContextCreated](V8ContextHandler.md#oncontextcreated) + * [OnContextReleased](V8ContextHandler.md#oncontextreleased) * [Virtual Key codes](VirtualKey.md) -* [Browser (object)](Browser.md) - * [CanGoBack](Browser.md#cangoback) - * [CanGoForward](Browser.md#cangoforward) - * [CloseBrowser](Browser.md#closebrowser) - * [CloseDevTools](Browser.md#closedevtools) - * [DragTargetDragEnter](Browser.md#dragtargetdragenter) - * [DragTargetDragOver](Browser.md#dragtargetdragover) - * [DragTargetDragLeave](Browser.md#dragtargetdragleave) - * [DragTargetDrop](Browser.md#dragtargetdrop) - * [DragSourceEndedAt](Browser.md#dragsourceendedat) - * [DragSourceSystemDragEnded](Browser.md#dragsourcesystemdragended) - * [ExecuteFunction](Browser.md#executefunction) - * [ExecuteJavascript](Browser.md#executejavascript) - * [Find](Browser.md#find) - * [GetClientCallback](Browser.md#getclientcallback) - * [GetClientCallbacksDict](Browser.md#getclientcallbacksdict) - * [GetFocusedFrame](Browser.md#getfocusedframe) - * [GetFrame](Browser.md#getframe) - * [GetFrameByIdentifier](Browser.md#getframebyidentifier) - * [GetFrames](Browser.md#getframes) - * [GetFrameCount](Browser.md#getframecount) - * [GetFrameIdentifiers](Browser.md#getframeidentifiers) - * [GetFrameNames](Browser.md#getframenames) - * [GetJavascriptBindings](Browser.md#getjavascriptbindings) - * [GetMainFrame](Browser.md#getmainframe) - * [GetNSTextInputContext](Browser.md#getnstextinputcontext) - * [GetOpenerWindowHandle](Browser.md#getopenerwindowhandle) - * [GetOuterWindowHandle](Browser.md#getouterwindowhandle) - * [GetUrl](Browser.md#geturl) - * [GetUserData](Browser.md#getuserdata) - * [GetWindowHandle](Browser.md#getwindowhandle) - * [GetIdentifier](Browser.md#getidentifier) - * [GetZoomLevel](Browser.md#getzoomlevel) - * [GoBack](Browser.md#goback) - * [GoForward](Browser.md#goforward) - * [HandleKeyEventAfterTextInputClient](Browser.md#handlekeyeventaftertextinputclient) - * [HandleKeyEventBeforeTextInputClient](Browser.md#handlekeyeventbeforetextinputclient) - * [HasDocument](Browser.md#hasdocument) - * [IsFullscreen](Browser.md#isfullscreen) - * [IsLoading](Browser.md#isloading) - * [IsMouseCursorChangeDisabled](Browser.md#ismousecursorchangedisabled) - * [IsPopup](Browser.md#ispopup) - * [IsWindowRenderingDisabled](Browser.md#iswindowrenderingdisabled) - * [LoadUrl](Browser.md#loadurl) - * [Navigate](Browser.md#navigate) - * [NotifyMoveOrResizeStarted](Browser.md#notifymoveorresizestarted) - * [NotifyScreenInfoChanged](Browser.md#notifyscreeninfochanged) - * [ParentWindowWillClose](Browser.md#parentwindowwillclose) - * [Reload](Browser.md#reload) - * [ReloadIgnoreCache](Browser.md#reloadignorecache) - * [SetBounds](Browser.md#setbounds) - * [SendKeyEvent](Browser.md#sendkeyevent) - * [SendMouseClickEvent](Browser.md#sendmouseclickevent) - * [SendMouseMoveEvent](Browser.md#sendmousemoveevent) - * [SendMouseWheelEvent](Browser.md#sendmousewheelevent) - * [SendFocusEvent](Browser.md#sendfocusevent) - * [SendCaptureLostEvent](Browser.md#sendcapturelostevent) - * [SetClientCallback](Browser.md#setclientcallback) - * [SetClientHandler](Browser.md#setclienthandler) - * [SetFocus](Browser.md#setfocus) - * [SetMouseCursorChangeDisabled](Browser.md#setmousecursorchangedisabled) - * [SetJavascriptBindings](Browser.md#setjavascriptbindings) - * [SetUserData](Browser.md#setuserdata) - * [SetZoomLevel](Browser.md#setzoomlevel) - * [ShowDevTools](Browser.md#showdevtools) - * [StartDownload](Browser.md#startdownload) - * [StopLoad](Browser.md#stopload) - * [StopFinding](Browser.md#stopfinding) - * [ToggleFullscreen](Browser.md#togglefullscreen) - * [TryCloseBrowser](Browser.md#tryclosebrowser) - * [WasResized](Browser.md#wasresized) - * [WasHidden](Browser.md#washidden) +* [WebPluginInfo (object)](WebPluginInfo.md) + * [GetName](WebPluginInfo.md#getname) + * [GetPath](WebPluginInfo.md#getpath) + * [GetVersion](WebPluginInfo.md#getversion) + * [GetDescription](WebPluginInfo.md#getdescription) +* [WebRequest (class)](WebRequest.md) + * [Create](WebRequest.md#create) + * [GetRequest](WebRequest.md#getrequest) + * [GetRequestStatus](WebRequest.md#getrequeststatus) + * [GetRequestError](WebRequest.md#getrequesterror) + * [GetResponse](WebRequest.md#getresponse) + * [Cancel](WebRequest.md#cancel) +* [WebRequestClient (interface)](WebRequestClient.md) + * [OnUploadProgress](WebRequestClient.md#onuploadprogress) + * [OnDownloadProgress](WebRequestClient.md#ondownloadprogress) + * [OnDownloadData](WebRequestClient.md#ondownloaddata) + * [OnRequestComplete](WebRequestClient.md#onrequestcomplete) +* [WindowInfo (class)](WindowInfo.md) + * [SetAsChild](WindowInfo.md#setaschild) + * [SetAsPopup](WindowInfo.md#setaspopup) + * [SetAsOffscreen](WindowInfo.md#setasoffscreen) + * [SetTransparentPainting](WindowInfo.md#settransparentpainting) +* [WindowUtils (class)](WindowUtils.md) + * [OnSetFocus ](WindowUtils.md#onsetfocus-win) + * [OnSize ](WindowUtils.md#onsize-win) + * [OnEraseBackground ](WindowUtils.md#onerasebackground-win) + * [SetTitle ](WindowUtils.md#settitle-win) + * [SetIcon ](WindowUtils.md#seticon-win) + * [GetParentHandle](WindowUtils.md#getparenthandle) + * [IsWindowHandle](WindowUtils.md#iswindowhandle) + * [gtk_plug_new ](WindowUtils.md#gtk_plug_new-linux) + * [gtk_widget_show ](WindowUtils.md#gtk_widget_show-linux) + * [InstallX11ErrorHandlers ](WindowUtils.md#installx11errorhandlers-linux) diff --git a/api/ApplicationSettings.md b/api/ApplicationSettings.md index 65e95d35..b0ec2d08 100644 --- a/api/ApplicationSettings.md +++ b/api/ApplicationSettings.md @@ -385,7 +385,7 @@ The behavior for encode/decode errors is to replace the unknown character with " (int) The number of stack trace frames to capture for uncaught exceptions. -Specify a positive value to enable the [JavascriptContextHandler](JavascriptContextHandler.md).OnUncaughtException() +Specify a positive value to enable the [V8ContextHandler](V8ContextHandler.md).OnUncaughtException() callback. Specify 0 (default value) and OnUncaughtException() will not be called. Also configurable using the "uncaught-exception-stack-size" [command-line switch](CommandLineSwitches.md). diff --git a/api/CookieVisitor.md b/api/CookieVisitor.md index b34b856f..514e9be7 100644 --- a/api/CookieVisitor.md +++ b/api/CookieVisitor.md @@ -25,11 +25,11 @@ Table of contents: | cookie | [Cookie](Cookie.md) | | count | int | | total | int | -| deleteCookie | list | +| delete_cookie_out | list[bool] | | __Return__ | bool | Method that will be called once for each cookie. |count| is the 0-based index for the current cookie. |total| is the total number of cookies. -Set |`deleteCookie[0]`| to True to delete the cookie currently being visited. +Set |delete_cookie_out[0]| to True to delete the cookie currently being visited. Return False to stop visiting cookies, True to continue. This method may never be called if no cookies are found. diff --git a/api/DisplayHandler.md b/api/DisplayHandler.md index cd1b9720..11c860d3 100644 --- a/api/DisplayHandler.md +++ b/api/DisplayHandler.md @@ -48,12 +48,12 @@ Called when the page title changes. | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| textOut | list& | +| text_out | list | | __Return__ | bool | -Called when the browser is about to display a tooltip. `textOut[0]` contains the +Called when the browser is about to display a tooltip. `text_out[0]` contains the text that will be displayed in the tooltip. To handle the display of the -tooltip yourself return true. Otherwise, you can optionally modify `textOut[0]` +tooltip yourself return true. Otherwise, you can optionally modify `text_out[0]` and then return false to allow the browser to display the tooltip. When window rendering is disabled the application is responsible for drawing tooltips and the return value is ignored. diff --git a/api/FocusHandler.md b/api/FocusHandler.md index 303f85b9..9620372d 100644 --- a/api/FocusHandler.md +++ b/api/FocusHandler.md @@ -22,7 +22,7 @@ Table of contents: | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| next | bool | +| next_component | bool | | __Return__ | void | Description from upstream CEF: diff --git a/api/JavascriptDialogHandler.md b/api/JavascriptDialogHandler.md index a3893e52..ce905d63 100644 --- a/api/JavascriptDialogHandler.md +++ b/api/JavascriptDialogHandler.md @@ -27,11 +27,11 @@ requests. | Parameter | Type | | --- | --- | | allow | bool | -| userInput | str | +| user_input | str | | __Return__ | void | Continue the javascript dialog request. Set |allow| to true if the OK button was -pressed. The |userInput| value should be specified for prompt dialogs. +pressed. The |user_input| value should be specified for prompt dialogs. ## Callbacks @@ -47,17 +47,17 @@ pressed. The |userInput| value should be specified for prompt dialogs. | message_text | str | | default_prompt_text | str | | callback | JavascriptDialogCallback | -| suppress_message[0] | bool& | +| suppress_message_out | list | | __Return__ | bool | Called to run a JavaScript dialog. If |origin_url| is non-empty it can be passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure and user-friendly display string. The |default_prompt_text| value will be -specified for prompt dialogs only. Set |suppress_message| to true and +specified for prompt dialogs only. Set |suppress_message_out[0]| to true and return false to suppress the message (suppressing messages is preferable to immediately executing the callback as this is used to detect presumably malicious behavior like spamming alert messages in onbeforeunload). Set -|suppress_message| to false and return false to use the default +|suppress_message_out[0]| to false and return false to use the default implementation (the default implementation will show one modal dialog at a time and suppress any additional dialog requests until the displayed dialog is dismissed). Return true if the application will use a custom dialog or diff --git a/api/KeyboardHandler.md b/api/KeyboardHandler.md index 800f7928..f8082805 100644 --- a/api/KeyboardHandler.md +++ b/api/KeyboardHandler.md @@ -21,15 +21,15 @@ Table of contents: | --- | --- | | browser | [Browser](Browser.md) | | event | KeyEvent | -| eventHandle | MSG\* / GdkEvent\* / NSEvent\*` | -| isKeyboardShortcutOut | out list[0] -> bool | -| __Return__ | void | +| event_handle | MSG\* / GdkEvent\* / NSEvent\*` | +| is_keyboard_shortcut_out | list | +| __Return__ | bool | Called before a keyboard event is sent to the renderer. |event| contains -information about the keyboard event. |eventHandle| is the operating system +information about the keyboard event. |event_handle| is the operating system event message, if any. Return true if the event was handled or false otherwise. If the event will be handled in OnKeyEvent() as a keyboard -shortcut, set isKeyboardShortcutOut[0] to True and return False. +shortcut, set |is_keyboard_shortcut_out[0]| to True and return False. KeyEvent is a dictionary with the following keys: @@ -77,10 +77,11 @@ KeyEventFlags constants defined in the cefpython module: | --- | --- | | browser | [Browser](Browser.md) | | event | KeyEvent | -| eventHandle | MSG\* / GdkEvent\* / NSEvent\* | -| __Return__ | void | +| event_handle | MSG\* / GdkEvent\* / NSEvent\* | +| __Return__ | bool | Called after the renderer and javascript in the page has had a chance to handle the event. |event| contains information about the keyboard event. |os_event| is the operating system event message, if any. Return true if -the keyboard event was handled or false otherwise. Description of the KeyEvent type is in the OnPreKeyEvent() callback. +the keyboard event was handled or false otherwise. Description of the +KeyEvent type is in the OnPreKeyEvent() callback. diff --git a/api/LifespanHandler.md b/api/LifespanHandler.md index 45012b04..e4bac696 100644 --- a/api/LifespanHandler.md +++ b/api/LifespanHandler.md @@ -25,15 +25,15 @@ Table of contents: | --- | --- | | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | -| targetUrl | string | -| targetFrameName | string | -| targetDisposition | WindowOpenDisposition | -| userGesture | bool | -| popupFeatures | None | -| out windowInfo[0] | [WindowInfo](WindowInfo.md) | +| target_url | string | +| target_frame_name | string | +| target_disposition | WindowOpenDisposition | +| user_gesture | bool | +| popup_features | None | +| window_info_out | list[[WindowInfo](WindowInfo.md)] | | client | None | -| out browserSettings[0] | [BrowserSettings](BrowserSettings.md) | -| out noJavascriptAccess[0] | bool | +| browser_settings_out | list[[BrowserSettings](BrowserSettings.md)] | +| no_javascript_access_out | list[bool] | | __Return__ | bool | Called on the IO thread before a new popup browser is created. The @@ -44,15 +44,15 @@ The |target_disposition| value indicates where the user intended to open the popup (e.g. current tab, new tab, etc). The |user_gesture| value will be true if the popup was opened via explicit user gesture (e.g. clicking a link) or false if the popup opened automatically (e.g. via the -DomContentLoaded event). The |popupFeatures| structure contains additional +DomContentLoaded event). The |popup_features| structure contains additional information about the requested popup window. To allow creation of the popup browser optionally modify |windowInfo|, |client|, |browserSettings| and -|noJavascriptAccess| and return false. To cancel creation of the popup +|no_javascript_access| and return false. To cancel creation of the popup browser return true. The |client| and |settings| values will default to the source browser's values. If the |no_javascript_access| value is set to false the new browser will not be scriptable and may not be hosted in the same renderer process as the source browser. Any modifications to -|windowInfo| will be ignored if the parent browser is wrapped in a +|window_info| will be ignored if the parent browser is wrapped in a CefBrowserView. Note that if you return True and create the popup window yourself, then diff --git a/api/LoadHandler.md b/api/LoadHandler.md index 77e7475b..975ba1ee 100644 --- a/api/LoadHandler.md +++ b/api/LoadHandler.md @@ -25,9 +25,9 @@ Table of contents: | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| isLoading | bool | -| canGoBack | bool | -| canGoForward | bool | +| is_loading | bool | +| can_go_back | bool | +| can_go_forward | bool | | __Return__ | void | Called when the loading state has changed. This callback will be executed @@ -78,7 +78,7 @@ Not yet implemented. See [Issue #32](../issues/32). | --- | --- | | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | -| httpStatusCode | int | +| http_code | int | | __Return__ | void | Called when the browser is done loading a frame. The |frame| value will @@ -89,9 +89,12 @@ will always be called for all frames irrespective of whether the request completes successfully. For notification of overall browser load status use OnLoadingStateChange instead. -This event behaves like window.onload, it waits for all the content to load (e.g. images), there is currently no callback for a DOMContentLoaded event, see [Issue #32](../issues/32). +This event behaves like window.onload, it waits for all the content +to load (e.g. images), there is currently no callback for +a DOMContentLoaded event, see [Issue #32](../issues/32). -There are some cases when this callback won't get called, see this topic: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10906 +There are some cases when this callback won't get called, see this +topic: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10906 ### OnLoadError @@ -100,14 +103,15 @@ There are some cases when this callback won't get called, see this topic: http:/ | --- | --- | | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | -| errorCode | [NetworkError](NetworkError.md) | -| errorText | list& | -| failedUrl | string | +| error_code | [NetworkError](NetworkError.md) | +| error_text_out | list[string] | +| failed_url | string | | __Return__ | void | Called when the resource load for a navigation fails or is canceled. -|errorCode| is the error code number, |`errorText[0]`| is the error text and -|failedUrl| is the URL that failed to load. See net\base\net_error_list.h -for complete descriptions of the error codes. +|errorCode| is the error code number, |error_text_out[0]| is the error +text and |failed_url| is the URL that failed to load. See +net\base\net_error_list.h for complete descriptions of the error codes. -This callback may get called when [Browser](Browser.md).`StopLoad` is called, or when file download is aborted (see DownloadHandler). +This callback may get called when [Browser](Browser.md).`StopLoad` +is called, or when file download is aborted (see DownloadHandler). diff --git a/api/RenderHandler.md b/api/RenderHandler.md index d680af4b..42812020 100644 --- a/api/RenderHandler.md +++ b/api/RenderHandler.md @@ -54,10 +54,11 @@ Callbacks available in upstream CEF, but not yet exposed in CEF Python | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| out rect | list | +| rect_out | list[x,y,width,height] | | __Return__ | bool | -Called to retrieve the root window rectangle in screen coordinates. Return true if the rectangle was provided. +Called to retrieve the root window rectangle in screen coordinates. +Return true if the rectangle was provided. ### GetViewRect @@ -65,12 +66,11 @@ Called to retrieve the root window rectangle in screen coordinates. Return true | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| out rect | list | +| rect_out | list[x,y,width,height] | | __Return__ | bool | -Called to retrieve the view rectangle which is relative to screen coordinates. Return true if the rectangle was provided. - -The `rect` list should contain 4 elements: [x, y, width, height]. +Called to retrieve the view rectangle which is relative to screen +coordinates. Return true if the rectangle was provided. ### GetScreenRect @@ -78,12 +78,11 @@ The `rect` list should contain 4 elements: [x, y, width, height]. | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| out rect | list | +| rect_out | list[x,y,width,height] | | __Return__ | bool | -Called to retrieve the simulated screen rectangle. Return true if the rectangle was provided. - -The `rect` list should contain 4 elements: [x, y, width, height]. +Called to retrieve the simulated screen rectangle. Return true +if the rectangle was provided. ### GetScreenPoint @@ -91,14 +90,13 @@ The `rect` list should contain 4 elements: [x, y, width, height]. | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| viewX | int | -| viewY | int | -| out screenCoordinates | list | +| view_x | int | +| view_y | int | +| screen_coordinates_out | list[x,y] | | __Return__ | bool | -Called to retrieve the translation from view coordinates to actual screen coordinates. Return true if the screen coordinates were provided. - -The `screenCoordinates` list should contain 2 elements: [x, y]. +Called to retrieve the translation from view coordinates to actual +screen coordinates. Return true if the screen coordinates were provided. ### OnPopupShow @@ -109,7 +107,9 @@ The `screenCoordinates` list should contain 2 elements: [x, y]. | show | bool | | __Return__ | void | -Called when the browser wants to show or hide the popup widget. The popup should be shown if |show| is true and hidden if |show| is false. +Called when the browser wants to show or hide the popup widget. +The popup should be shown if |show| is true and hidden if|show| +is false. ### OnPopupSize @@ -117,12 +117,11 @@ Called when the browser wants to show or hide the popup widget. The popup should | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| rect | list | +| rect_out | list[x,y,width,height] | | __Return__ | void | -Called when the browser wants to move or resize the popup widget. |rect| contains the new location and size. - -The `rect` list should contain 4 elements: [x, y, width, height]. +Called when the browser wants to move or resize the popup widget. +|rect_out| contains the new location and size. ### OnPaint @@ -130,9 +129,9 @@ The `rect` list should contain 4 elements: [x, y, width, height]. | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| paintElementType | int | -| out dirtyRects | list | -| buffer | [PaintBuffer](PaintBuffer.md) | +| element_type | int | +| dirty_rects | list[[x,y,width,height],[..]] | +| paint_buffer | [PaintBuffer](PaintBuffer.md) | | width | int | | height | int | | __Return__ | void | @@ -141,7 +140,7 @@ Called when an element should be painted. Pixel values passed to this method are scaled relative to view coordinates based on the value of CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| indicates whether the element is the view or the popup widget. |buffer| -contains the pixel data for the whole image. |dirtyRects| contains the set +contains the pixel data for the whole image. |dirty_rects| contains the set of rectangles in pixel coordinates that need to be repainted. |buffer| will be |width|*|height|*4 bytes in size and represents a BGRA image with an upper-left origin. @@ -150,8 +149,6 @@ upper-left origin. * PET_VIEW * PET_POPUP -`dirtyRects` is a list of rects: [[x, y, width, height], [..]] - ### OnCursorChange diff --git a/api/RequestHandler.md b/api/RequestHandler.md index 80ffd23c..667f3169 100644 --- a/api/RequestHandler.md +++ b/api/RequestHandler.md @@ -22,8 +22,8 @@ Table of contents: * [OnBeforeBrowse](#onbeforebrowse) * [OnBeforeResourceLoad](#onbeforeresourceload) * [GetResourceHandler](#getresourcehandler) - * [OnResourceResponse](#onresourceresponse) * [OnResourceRedirect](#onresourceredirect) + * [OnResourceResponse](#onresourceresponse) * [GetAuthCredentials](#getauthcredentials) * [OnQuotaRequest](#onquotarequest) * [GetCookieManager](#getcookiemanager) @@ -44,17 +44,18 @@ Table of contents: | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | | request | [Request](Request.md) | -| isRedirect | bool | +| is_redirect | bool | | __Return__ | bool | Called on the UI thread before browser navigation. Return true to cancel the navigation or false to allow the navigation to proceed. The |request| object cannot be modified in this callback. -[DisplayHandler](DisplayHandler.md).`OnLoadingStateChange` will be called twice in all cases. +[DisplayHandler](DisplayHandler.md).`OnLoadingStateChange` will be +called twice in all cases. If the navigation is allowed [LoadHandler](LoadHandler.md).`OnLoadStart` and `OnLoadEnd` will be called. If the navigation is canceled -[LoadHandler](LoadHandler.md).`OnLoadError` will be called with an |errorCode| value of -ERR_ABORTED. +[LoadHandler](LoadHandler.md).`OnLoadError` will be called with +an |error_code| value of ERR_ABORTED. ### OnBeforeResourceLoad @@ -82,25 +83,15 @@ false. Called on the IO thread before a resource is loaded. To allow the resource to load normally return None. To specify a handler for the resource return -a [ResourceHandler](ResourceHandler.md) object. The |request| object should not be modified in -this callback. - -The [ResourceHandler](ResourceHandler.md) object is a python class that implements the `ResourceHandler` callbacks. Remember to keep a strong reference to this object while resource is being loaded. - -The `GetResourceHandler` example can be found in the `wxpython-response.py` script on Linux. - - -### OnResourceResponse - -| | | -| --- | --- | -| __Return__ | void | +a [ResourceHandler](ResourceHandler.md) object. The |request| object should +not be modified in this callback. -Not yet available in CEF 3 (see [CEF Issue 515](https://bitbucket.org/chromiumembedded/cef/issues/515)), though it can be emulated, see the comment below. +The [ResourceHandler](ResourceHandler.md) object is a python class that +implements the `ResourceHandler` callbacks. Remember to keep a strong +reference to this object while resource is being loaded. -You can implement this functionality by using [ResourceHandler](ResourceHandler.md) -and [WebRequest](WebRequest.md) / [WebRequestClient](WebRequestClient.md). For an example see the _OnResourceResponse() method in the [wxpython-response.py] -(../src/linux/binaries_64bit/wxpython-response.py) script. +The `GetResourceHandler` example can be found in the old v31 +"wxpython-response.py" script on Linux. ### OnResourceRedirect @@ -109,8 +100,8 @@ and [WebRequest](WebRequest.md) / [WebRequestClient](WebRequestClient.md). For a | --- | --- | | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | -| oldUrl | string | -| out newUrl[0] | string | +| old_url | string | +| new_url_out | list[string] | | request | [Request](Request.md) | | response | [Response](Response.md) | | __Return__ | void | @@ -124,13 +115,29 @@ Description from upstream CEF: > callback. +### OnResourceResponse + +| | | +| --- | --- | +| __Return__ | void | + +Available in upstream CEF, but not yet exposed to CEF Python. +See Issue #229. + +You can implement this functionality by using +[ResourceHandler](ResourceHandler.md) and [WebRequest](WebRequest.md) +/ [WebRequestClient](WebRequestClient.md). For an example see the +_OnResourceResponse() method in the old v31 [wxpython-response.py] +example. + + ### GetAuthCredentials | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | | frame | [Frame](Frame.md) | -| isProxy | bool | +| is_proxy | bool | | host | string | | port | int | | realm | string | @@ -139,7 +146,7 @@ Description from upstream CEF: | __Return__ | bool |{ Called on the IO thread when the browser needs credentials from the user. -|isProxy| indicates whether the host is a proxy server. |host| contains the +|is_proxy| indicates whether the host is a proxy server. |host| contains the hostname and |port| contains the port number. |realm| is the realm of the challenge and may be empty. |scheme| is the authentication scheme used, such as "basic" or "digest", and will be empty if the source of the request @@ -158,14 +165,14 @@ The `AuthCallback` object methods: | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| originUrl | string | -| newSize | long | +| origin_url | string | +| new_size | long | | callback | RequestCallback | | __Return__ | bool | Called on the IO thread when javascript requests a specific storage quota -size via the `webkitStorageInfo.requestQuota` function. |originUrl| is the -origin of the page making the request. |newSize| is the requested quota +size via the `webkitStorageInfo.requestQuota` function. |origin_url| is the +origin of the page making the request. |new_size| is the requested quota size in bytes. Return true to continue the request and call CefRequestCallback::Continue() either in this method or at a later time to grant or deny the request. Return false to cancel the request immediately. @@ -179,17 +186,33 @@ The `RequestCallback` object methods: | Parameter | Type | | --- | --- | -| browser|None | [Browser](Browser.md) | -| mainUrl | string | +| browser | None or [Browser](Browser.md) | +| main_url | string | | __Return__ | [CookieManager](CookieManager.md) | -Called on the IO thread to retrieve the cookie manager. |mainUrl| is the URL of the top-level frame. Cookies managers can be unique per browser or shared across multiple browsers. The global cookie manager will be used if this method returns None. +Called on the IO thread to retrieve the cookie manager. |main_url| +is the URL of the top-level frame. Cookies managers can be unique +per browser or shared across multiple browsers. The global cookie +manager will be used if this method returns None. -To successfully implement separate cookie manager per browser session, you have to set ApplicationSettings.`unique_request_context_per_browser` to True. Otherwise the browser param passed to this callback will always be the same first browser that was created using [cefpython](cefpython.md).`CreateBrowserSync`. +To successfully implement separate cookie manager per browser session, +you have to set ApplicationSettings.`unique_request_context_per_browser` +to True. Otherwise the browser param passed to this callback will +always be the same first browser that was created using +[cefpython](cefpython.md).`CreateBrowserSync`. -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. +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 old v31 wxpython +example does that. -IMPORTANT: in an exceptional case the `browser` parameter could be None, so you should handle such case. During testing this issue did not occur, but it may happen in some yet unknown scenarios. +IMPORTANT: in an exceptional case the `browser` parameter could be +None, so you should handle such case. During testing this issue did +not occur, but it may happen in some yet unknown scenarios. ### OnProtocolExecution @@ -198,18 +221,20 @@ IMPORTANT: in an exceptional case the `browser` parameter could be None, so you | --- | --- | | browser | [Browser](Browser.md) | | url | string | -| allowExecutionOut | list& | +| allow_execution_out | list[bool] | | __Return__ | void | Called on the UI thread to handle requests for URLs with an unknown -protocol component. Set `allowExecutionOut[0]` to True to attempt execution -via the registered OS protocol handler, if any. -SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED -ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. +protocol component. Set |allow_execution_out[0]| to True to attempt +execution via the registered OS protocol handler, if any. + +__SECURITY NOTE__: You should use this callback to enforce restrictions +based on scheme, host or other url analysis before allowing OS execution. There's no default implementation for OnProtocolExecution on Linux, you have to make OS system call on your own. You probably also need -to use [LoadHandler](LoadHandler.md)::OnLoadError() when implementing this on Linux. +to use [LoadHandler](LoadHandler.md)::OnLoadError() when implementing +this on Linux. ### _OnBeforePluginLoad @@ -220,7 +245,7 @@ to use [LoadHandler](LoadHandler.md)::OnLoadError() when implementing this on Li | mime_type | string | | plugin_url | string | | top_origin_url | string | -| info | [WebPluginInfo](WebPluginInfo.md) | +| plugin_info | [WebPluginInfo](WebPluginInfo.md) | | __Return__ | bool | Description from upstream CEF: @@ -242,22 +267,29 @@ Description from upstream CEF: Return True to block loading of the plugin. -This callback will be executed during browser creation, thus you must call [cefpython](cefpython.md).SetGlobalClientCallback() to use it. The callback name was prefixed with "`_`" to distinguish this special behavior. +This callback will be executed during browser creation, thus you must +call [cefpython](cefpython.md).SetGlobalClientCallback() to use it. +The callback name was prefixed with "`_`" to distinguish this special +behavior. Plugins are loaded on demand, only when website requires it. -This callback is called every time the page tries to load a plugin (perhaps even multiple times per plugin). +This callback is called every time the page tries to load a plugin +(perhaps even multiple times per plugin). ### _OnCertificateError | Parameter | Type | | --- | --- | -| certError | [NetworkError](NetworkError.md) | -| requestUrl | string | +| cert_error | [NetworkError](NetworkError.md) | +| request_url | string | | callback | RequestCallback | | __Return__ | bool | -This callback is not associated with any specific browser, thus you must call [cefpython](cefpython.md).SetGlobalClientCallback() to use it. The callback name was prefixed with "`_`" to distinguish this special behavior. +This callback is not associated with any specific browser, thus you +must call [cefpython](cefpython.md).SetGlobalClientCallback() to use +it. The callback name was prefixed with "`_`" to distinguish this +special behavior. Called on the UI thread to handle requests for URLs with an invalid SSL certificate. Return true and call CefRequestCallback::Continue() either @@ -293,8 +325,8 @@ how the process terminated. | Parameter | Type | | --- | --- | | browser | [Browser](Browser.md) | -| pluginPath | string | +| plugin_path | string | | __Return__ | void | -Called when a plugin has crashed. |pluginPath| is the path of the plugin +Called when a plugin has crashed. |plugin_path| is the path of the plugin that crashed. diff --git a/api/ResourceHandler.md b/api/ResourceHandler.md index 300bbdb1..eb69d270 100644 --- a/api/ResourceHandler.md +++ b/api/ResourceHandler.md @@ -34,13 +34,13 @@ Table of contents: | --- | --- | | request | [Request](Request.md) | | callback | [Callback](Callback.md) | -| __Return__ | void | +| __Return__ | bool | Begin processing the request. To handle the request return True and call -[Callback](Callback.md).Continue() once the response header information is available -(`Callback::Continue()` can also be called from inside this method if -header information is available immediately). To cancel the request return -False. +[Callback](Callback.md).Continue() once the response header information +is available (`Callback::Continue()` can also be called from inside this +method if header information is available immediately). To cancel the +request return False. ### GetResponseHeaders @@ -48,35 +48,35 @@ False. | Parameter | Type | | --- | --- | | response | [Response](Response.md) | -| responseLengthOut | list& | -| redirectUrlOut | list& | +| response_length_out | list[int] | +| redirect_url_out | list[string] | | __Return__ | void | Retrieve response header information. If the response length is not known -set `responseLengthOut[0]` to -1 and ReadResponse() will be called until it -returns false. If the response length is known set `responseLengthOut[0]` +set |response_length_out[0]| to -1 and ReadResponse() will be called until it +returns false. If the response length is known set |response_length_out[0]| to a positive value and ReadResponse() will be called until it returns false or the specified number of bytes have been read. Use the |response| object to set the mime type, http status code and other optional header -values. To redirect the request to a new URL set `redirectUrlOut[0]` to the new -URL. If an error occured while setting up the request you can call -SetError() on |response| to indicate the error condition. +values. To redirect the request to a new URL set |redirect_url_out[0]| +to the new URL. If an error occured while setting up the request you +can call SetError() on |response| to indicate the error condition. ### ReadResponse | Parameter | Type | | --- | --- | -| dataOut | list& | -| bytesToRead | int | -| bytesReadOut | list& | +| data_out | list[bytes] | +| bytes_to_read | int | +| bytes_read_out | list[int] | | callback | [Callback](Callback.md) | | __Return__ | void | Read response data. If data is available immediately copy up to -`bytesToRead` bytes into `dataOut[0]`, set `bytesReadOut[0]` to the number of +|bytes_to_read| bytes into |data_out|, set |bytes_read_out| to the number of bytes copied, and return true. To read the data at a later time set -`bytesReadOut[0]` to 0, return true and call `callback.Continue()` when the +|bytes_read_out| to 0, return true and call `callback.Continue()` when the data is available. To indicate response completion return false. @@ -85,7 +85,7 @@ data is available. To indicate response completion return false. | Parameter | Type | | --- | --- | | cookie | [Cookie](Cookie.md) | -| __Return__ | void | +| __Return__ | bool | Return true if the specified cookie can be sent with the request or false otherwise. If false is returned for any cookie then no cookies will be sent @@ -97,7 +97,7 @@ with the request. | Parameter | Type | | --- | --- | | cookie | [Cookie](Cookie.md) | -| __Return__ | void | +| __Return__ | bool | Return true if the specified cookie returned with the response can be set or false otherwise. diff --git a/api/JavascriptContextHandler.md b/api/V8ContextHandler.md similarity index 72% rename from api/JavascriptContextHandler.md rename to api/V8ContextHandler.md index a3dadb43..9c6f6fbc 100644 --- a/api/JavascriptContextHandler.md +++ b/api/V8ContextHandler.md @@ -1,16 +1,24 @@ [API categories](API-categories.md) | [API index](API-index.md) -# JavascriptContextHandler (interface) +# V8ContextHandler (interface) Implement this interface to handle javascript exceptions globally. -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). + Table of contents: +* [Notes](#notes) * [Callbacks](#callbacks) * [OnContextCreated](#oncontextcreated) * [OnContextReleased](#oncontextreleased) + +## Notes + +Callbacks available in upstream CEF, but not yet exposed in CEF Python: +* OnUncaughtException + + ## Callbacks @@ -22,9 +30,11 @@ Table of contents: | frame | [Frame](Frame.md) | | __Return__ | void | -Called shortly after (process message delay) the V8 context for a frame has been created. +Called shortly after (process message delay) the V8 context for +a frame has been created. -If the page does not contain `