Skip to content

Commit

Permalink
Add RequestHandler.CanGetCookies and CanSetCookie (#403).
Browse files Browse the repository at this point in the history
Add network_cookies.py snippet.
  • Loading branch information
cztomczak committed Aug 19, 2018
1 parent ccc03c8 commit 2b78a3e
Show file tree
Hide file tree
Showing 11 changed files with 410 additions and 214 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ Additional information for v31.2 release:
* [OnPreKeyEvent](api/KeyboardHandler.md#onprekeyevent)
* [OnKeyEvent](api/KeyboardHandler.md#onkeyevent)
* [LifespanHandler (interface)](api/LifespanHandler.md#lifespanhandler-interface)
* [OnBeforePopup](api/LifespanHandler.md#onbeforepopup)
* [_OnAfterCreated](api/LifespanHandler.md#_onaftercreated)
* [DoClose](api/LifespanHandler.md#doclose)
* [_OnAfterCreated](api/LifespanHandler.md#_onaftercreated)
* [OnBeforeClose](api/LifespanHandler.md#onbeforeclose)
* [OnBeforePopup](api/LifespanHandler.md#onbeforepopup)
* [LoadHandler (interface)](api/LoadHandler.md#loadhandler-interface)
* [OnLoadingStateChange](api/LoadHandler.md#onloadingstatechange)
* [OnLoadStart](api/LoadHandler.md#onloadstart)
Expand Down Expand Up @@ -703,19 +703,21 @@ Additional information for v31.2 release:
* [GetResourceType](api/Request.md#getresourcetype)
* [GetTransitionType](api/Request.md#gettransitiontype)
* [RequestHandler (interface)](api/RequestHandler.md#requesthandler-interface)
* [CanGetCookies](api/RequestHandler.md#cangetcookies)
* [CanSetCookie](api/RequestHandler.md#cansetcookie)
* [GetAuthCredentials](api/RequestHandler.md#getauthcredentials)
* [GetCookieManager](api/RequestHandler.md#getcookiemanager)
* [GetResourceHandler](api/RequestHandler.md#getresourcehandler)
* [OnBeforeBrowse](api/RequestHandler.md#onbeforebrowse)
* [_OnBeforePluginLoad](api/RequestHandler.md#_onbeforepluginload)
* [OnBeforeResourceLoad](api/RequestHandler.md#onbeforeresourceload)
* [GetResourceHandler](api/RequestHandler.md#getresourcehandler)
* [_OnCertificateError](api/RequestHandler.md#_oncertificateerror)
* [OnQuotaRequest](api/RequestHandler.md#onquotarequest)
* [OnResourceRedirect](api/RequestHandler.md#onresourceredirect)
* [OnResourceResponse](api/RequestHandler.md#onresourceresponse)
* [GetAuthCredentials](api/RequestHandler.md#getauthcredentials)
* [OnQuotaRequest](api/RequestHandler.md#onquotarequest)
* [GetCookieManager](api/RequestHandler.md#getcookiemanager)
* [OnPluginCrashed](api/RequestHandler.md#onplugincrashed)
* [OnProtocolExecution](api/RequestHandler.md#onprotocolexecution)
* [_OnBeforePluginLoad](api/RequestHandler.md#_onbeforepluginload)
* [_OnCertificateError](api/RequestHandler.md#_oncertificateerror)
* [OnRendererProcessTerminated](api/RequestHandler.md#onrendererprocessterminated)
* [OnPluginCrashed](api/RequestHandler.md#onplugincrashed)
* [ResourceHandler (interface)](api/ResourceHandler.md#resourcehandler-interface)
* [ProcessRequest](api/ResourceHandler.md#processrequest)
* [GetResponseHeaders](api/ResourceHandler.md#getresponseheaders)
Expand Down
20 changes: 11 additions & 9 deletions api/API-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@
* [OnPreKeyEvent](KeyboardHandler.md#onprekeyevent)
* [OnKeyEvent](KeyboardHandler.md#onkeyevent)
* [LifespanHandler (interface)](LifespanHandler.md#lifespanhandler-interface)
* [OnBeforePopup](LifespanHandler.md#onbeforepopup)
* [_OnAfterCreated](LifespanHandler.md#_onaftercreated)
* [DoClose](LifespanHandler.md#doclose)
* [_OnAfterCreated](LifespanHandler.md#_onaftercreated)
* [OnBeforeClose](LifespanHandler.md#onbeforeclose)
* [OnBeforePopup](LifespanHandler.md#onbeforepopup)
* [LoadHandler (interface)](LoadHandler.md#loadhandler-interface)
* [OnLoadingStateChange](LoadHandler.md#onloadingstatechange)
* [OnLoadStart](LoadHandler.md#onloadstart)
Expand Down Expand Up @@ -391,19 +391,21 @@
* [GetResourceType](Request.md#getresourcetype)
* [GetTransitionType](Request.md#gettransitiontype)
* [RequestHandler (interface)](RequestHandler.md#requesthandler-interface)
* [CanGetCookies](RequestHandler.md#cangetcookies)
* [CanSetCookie](RequestHandler.md#cansetcookie)
* [GetAuthCredentials](RequestHandler.md#getauthcredentials)
* [GetCookieManager](RequestHandler.md#getcookiemanager)
* [GetResourceHandler](RequestHandler.md#getresourcehandler)
* [OnBeforeBrowse](RequestHandler.md#onbeforebrowse)
* [_OnBeforePluginLoad](RequestHandler.md#_onbeforepluginload)
* [OnBeforeResourceLoad](RequestHandler.md#onbeforeresourceload)
* [GetResourceHandler](RequestHandler.md#getresourcehandler)
* [_OnCertificateError](RequestHandler.md#_oncertificateerror)
* [OnQuotaRequest](RequestHandler.md#onquotarequest)
* [OnResourceRedirect](RequestHandler.md#onresourceredirect)
* [OnResourceResponse](RequestHandler.md#onresourceresponse)
* [GetAuthCredentials](RequestHandler.md#getauthcredentials)
* [OnQuotaRequest](RequestHandler.md#onquotarequest)
* [GetCookieManager](RequestHandler.md#getcookiemanager)
* [OnPluginCrashed](RequestHandler.md#onplugincrashed)
* [OnProtocolExecution](RequestHandler.md#onprotocolexecution)
* [_OnBeforePluginLoad](RequestHandler.md#_onbeforepluginload)
* [_OnCertificateError](RequestHandler.md#_oncertificateerror)
* [OnRendererProcessTerminated](RequestHandler.md#onrendererprocessterminated)
* [OnPluginCrashed](RequestHandler.md#onplugincrashed)
* [ResourceHandler (interface)](ResourceHandler.md#resourcehandler-interface)
* [ProcessRequest](ResourceHandler.md#processrequest)
* [GetResponseHeaders](ResourceHandler.md#getresponseheaders)
Expand Down
104 changes: 53 additions & 51 deletions api/LifespanHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,71 @@

# LifespanHandler (interface)

Implement this interface to handle events related to browser life span. The methods of this class will be called on the UI thread.
Implement this interface to handle events related to browser life span.
The methods of this class will be called on the UI thread.

For an example of how to implement a handler see [cefpython](cefpython.md).CreateBrowser(). For a list of all handler interfaces see [API > Client handlers](API#Client_handlers).
Related code snippets:
- [onbeforeclose.py](../examples/snippets/onbeforeclose.py)


Table of contents:
* [Callbacks](#callbacks)
* [OnBeforePopup](#onbeforepopup)
* [_OnAfterCreated](#_onaftercreated)
* [DoClose](#doclose)
* [_OnAfterCreated](#_onaftercreated)
* [OnBeforeClose](#onbeforeclose)
* [OnBeforePopup](#onbeforepopup)


## Callbacks


### DoClose

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | bool |

Called when a browser has recieved a request to close. This may result
directly from a call to [Browser](Browser.md).`CloseBrowser` or indirectly
if the
browser is a top-level OS window created by CEF and the user attempts to
close the window. This method will be called after the Javascript
'onunload' event has been fired. It will not be called for browsers after
the associated OS window has been destroyed (for those browsers it is no
longer possible to cancel the close).

See complete description of this callback in [cef_life_span_handler.h]
(..|src|include|cef_life_span_handler.h).


### _OnAfterCreated

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | void |

Called after a new browser is created. This callback will be the first
notification that references |browser|.

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.


### OnBeforeClose

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | void |

Called just before a browser is destroyed. Release all references to the
browser object and do not attempt to execute any methods on the browser
object after this callback returns. This callback will be the last
notification that references |browser|. See DoClose() documentation for
additional usage information.


### OnBeforePopup

| Parameter | Type |
Expand Down Expand Up @@ -73,50 +122,3 @@ There will be no "window.opener" property available in the popup window.
* WOD_SAVE_TO_DISK,
* WOD_OFF_THE_RECORD,
* WOD_IGNORE_ACTION


### _OnAfterCreated

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | void |

Called after a new browser is created. This callback will be the first
notification that references |browser|.

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.


### DoClose

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | bool |

Called when a browser has recieved a request to close. This may result
directly from a call to [Browser](Browser.md).`CloseBrowser` or indirectly
if the
browser is a top-level OS window created by CEF and the user attempts to
close the window. This method will be called after the Javascript
'onunload' event has been fired. It will not be called for browsers after
the associated OS window has been destroyed (for those browsers it is no
longer possible to cancel the close).

See complete description of this callback in [cef_life_span_handler.h]
(..|src|include|cef_life_span_handler.h).


### OnBeforeClose

| Parameter | Type |
| --- | --- |
| browser | [Browser](Browser.md) |
| __Return__ | void |

Called just before a browser is destroyed. Release all references to the
browser object and do not attempt to execute any methods on the browser
object after this callback returns. This callback will be the last
notification that references |browser|. See DoClose() documentation for
additional usage information.
Loading

0 comments on commit 2b78a3e

Please sign in to comment.