The GetCookieManager callback doesn't have browser parameter in upstream CEF. This param is set during synchronous browser creation in CreateBrowserSync [1], so it is not immediately available. See comment in request context handler in C++ [2] and the SetBrowser method. Fix needs to be applied in [3] with such code:
if cefBrowser.get():
pyBrowser = GetPyBrowser(cefBrowser, "GetCookieManager")
else:
pyBrowser = None
And app code needs to be aware that browser param in GetCookieManager may be None - API docs need to state that.
Issue originally reported on the forum:
https://groups.google.com/d/msg/cefpython/e3bFx1I5BZA/2ZM7jKk8AgAJ
Ref:
[1]
|
# Request context - part 2/2. |
[2]
|
// Browser may be NULL when instantiated from cefpython.CreateBrowserSync. |
[3]
|
cdef public CefRefPtr[CefCookieManager] RequestHandler_GetCookieManager( |
The
GetCookieManagercallback doesn't havebrowserparameter in upstream CEF. This param is set during synchronous browser creation inCreateBrowserSync[1], so it is not immediately available. See comment in request context handler in C++ [2] and the SetBrowser method. Fix needs to be applied in [3] with such code:And app code needs to be aware that
browserparam in GetCookieManager may be None - API docs need to state that.Issue originally reported on the forum:
https://groups.google.com/d/msg/cefpython/e3bFx1I5BZA/2ZM7jKk8AgAJ
Ref:
[1]
cefpython/src/cefpython.pyx
Line 908 in ebdb184
[2]
cefpython/src/client_handler/request_context_handler.h
Line 21 in 824d7ce
[3]
cefpython/src/handlers/request_handler.pyx
Line 281 in 77c506b