Skip to content

GetCookieManager sometimes not called due to a race condition. API removed in latest CEF. #429

@cztomczak

Description

@cztomczak

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(

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions