File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ is the URL of the top-level frame. Cookies managers can be unique
206206per browser or shared across multiple browsers. The global cookie
207207manager will be used if this method returns None.
208208
209+ ** IMPORTANT** : In some cases the ` browser ` parameter can be
210+ None, so you should handle such case.
211+
209212To successfully implement separate cookie manager per browser session,
210213you have to set ApplicationSettings.` unique_request_context_per_browser `
211214to True. Otherwise the browser param passed to this callback will
@@ -221,9 +224,6 @@ the window on your own and embed browser in it.
221224The ` CreateAnotherBrowser ` function from the old v31 wxpython
222225example does that.
223226
224- IMPORTANT: in an exceptional case the ` browser ` parameter could be
225- None, so you should handle such case. During testing this issue did
226- not occur, but it may happen in some yet unknown scenarios.
227227
228228
229229### OnProtocolExecution
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ Table of contents:
4444* [ v66+ BrowserSettings.javascript_open_windows_disallowed option was removed] ( #v66-browsersettingsjavascript_open_windows_disallowed-option-was-removed )
4545* [ v66+ Threads removed: TID_DB, TID_PROCESS_LAUNCHER, TID_CACHE] ( #v66-threads-removed-tid_db-tid_process_launcher-tid_cache )
4646* [ v66+ cef.Request.Flags changed] ( #v66-cefrequestflags-changed )
47+ * [ v66+ RequestHandler.GetCookieManager 'browser' param may be None] ( #v66-requesthandlergetcookiemanager-browser-param-may-be-none )
4748
4849
4950
@@ -376,3 +377,10 @@ Flags added:
376377See a complete list of flags in the description of
377378cef.Request.[ GetFlags] ( ../api/Request.md#getflags ) method.
378379
380+
381+ ## v66+ RequestHandler.GetCookieManager 'browser' param may be None
382+
383+ In some cases in RequestHandler.[ GetCookieManager] ( ../api/RequestHandler.md#getcookiemanager )
384+ callback, the ` browser ` parameter may be None due to a race condition.
385+ See Issue [ #429 ] ( ../../../issues/429 ) for details.
386+
Original file line number Diff line number Diff line change @@ -291,7 +291,10 @@ cdef public CefRefPtr[CefCookieManager] RequestHandler_GetCookieManager(
291291 cdef object clientCallback
292292 cdef PyCookieManager returnValue
293293 try :
294- pyBrowser = GetPyBrowser(cefBrowser, " GetCookieManager" )
294+ if cefBrowser.get():
295+ pyBrowser = GetPyBrowser(cefBrowser, " GetCookieManager" )
296+ else :
297+ pyBrowser = None
295298 pyMainUrl = CefToPyString(cefMainUrl)
296299 if pyBrowser:
297300 # Browser may be empty.
You can’t perform that action at this time.
0 commit comments