Helpviewer/FlashCookieManager/FlashCookieManager.py

changeset 4370
54dbb658f9e6
parent 4361
9eec3a532d59
child 4631
5c1a96925da4
equal deleted inserted replaced
4369:4ef6ecc62a9d 4370:54dbb658f9e6
114 """ 114 """
115 Private method to check for a blacklisted cookie. 115 Private method to check for a blacklisted cookie.
116 116
117 @param cookie Flash cookie to be tested 117 @param cookie Flash cookie to be tested
118 @type FlashCookie 118 @type FlashCookie
119 @return flag indicating a blacklisted cookie
120 @rtype bool
119 """ 121 """
120 return cookie.origin in Preferences.getHelp("FlashCookiesBlacklist") 122 return cookie.origin in Preferences.getHelp("FlashCookiesBlacklist")
121 123
122 def __isWhitelisted(self, cookie): 124 def __isWhitelisted(self, cookie):
123 """ 125 """
124 Private method to check for a whitelisted cookie. 126 Private method to check for a whitelisted cookie.
125 127
126 @param cookie Flash cookie to be tested 128 @param cookie Flash cookie to be tested
127 @type FlashCookie 129 @type FlashCookie
130 @return flag indicating a whitelisted cookie
131 @rtype bool
128 """ 132 """
129 return cookie.origin in Preferences.getHelp("FlashCookiesWhitelist") 133 return cookie.origin in Preferences.getHelp("FlashCookiesWhitelist")
130 134
131 def __removeAllButWhitelisted(self): 135 def __removeAllButWhitelisted(self):
132 """ 136 """
196 continue 200 continue
197 201
198 newCookie = True 202 newCookie = True
199 for oldCookie in oldFlashCookies: 203 for oldCookie in oldFlashCookies:
200 if (oldCookie.path + oldCookie.name == 204 if (oldCookie.path + oldCookie.name ==
201 cookie.path + cookie.name): 205 cookie.path + cookie.name):
202 newCookie = False 206 newCookie = False
203 break 207 break
204 208
205 if newCookie: 209 if newCookie:
206 newCookieList.append(cookie.path + "/" + cookie.name) 210 newCookieList.append(cookie.path + "/" + cookie.name)
325 origin = origin.replace( 329 origin = origin.replace(
326 self.flashPlayerDataPath() + self.__sharedObjectDirName(), "") 330 self.flashPlayerDataPath() + self.__sharedObjectDirName(), "")
327 if "/" in origin: 331 if "/" in origin:
328 origin = origin.split("/", 1)[1] 332 origin = origin.split("/", 1)[1]
329 elif path.startswith( 333 elif path.startswith(
330 self.flashPlayerDataPath() + 334 self.flashPlayerDataPath() +
331 "/macromedia.com/support/flashplayer/sys/"): 335 "/macromedia.com/support/flashplayer/sys/"):
332 origin = origin.replace( 336 origin = origin.replace(
333 self.flashPlayerDataPath() + 337 self.flashPlayerDataPath() +
334 "/macromedia.com/support/flashplayer/sys/", "") 338 "/macromedia.com/support/flashplayer/sys/", "")
335 if origin == "settings.sol": 339 if origin == "settings.sol":
336 return self.tr("!default") 340 return self.tr("!default")
337 elif origin.startswith("#"): 341 elif origin.startswith("#"):
338 origin = origin[1:] 342 origin = origin[1:]

eric ide

mercurial