Sat, 04 Feb 2017 13:10:20 +0100
Fixed an issue in the Web browser cookie jar.
(grafted from 3df49db6a3479f11714e6c1a6acb1f274f7a9552)
WebBrowser/CookieJar/CookieJar.py | file | annotate | diff | comparison | revisions |
--- a/WebBrowser/CookieJar/CookieJar.py Sat Feb 04 12:38:18 2017 +0100 +++ b/WebBrowser/CookieJar/CookieJar.py Sat Feb 04 13:10:20 2017 +0100 @@ -212,15 +212,16 @@ return True if self.__acceptCookies == self.AcceptOnlyFromSitesNavigatedTo: - url = WebBrowserWindow.mainWindow().getWindow().currentBrowser()\ - .url() - if url.isValid(): - host = url.host() - else: - host = "" - res = self.__matchDomain(cookieDomain, host) - if not res: - return True + mainWindow = WebBrowserWindow.mainWindow() + if mainWindow is not None: + url = mainWindow.getWindow().currentBrowser().url() + if url.isValid(): + host = url.host() + else: + host = "" + res = self.__matchDomain(cookieDomain, host) + if not res: + return True if self.__filterTrackingCookies and cookie.name().startsWith(b"__utm"): return True