eric6/WebBrowser/AdBlock/AdBlockMatcher.py

changeset 8221
0572a215bd2f
parent 8218
7c09585bd960
equal deleted inserted replaced
8220:006ee31b4835 8221:0572a215bd2f
78 @param url URL to check 78 @param url URL to check
79 @type QUrl 79 @type QUrl
80 @return flag indicating disabled state 80 @return flag indicating disabled state
81 @rtype bool 81 @rtype bool
82 """ 82 """
83 for rule in self.__documentRules: 83 return any(rule.urlMatch(url) for rule in self.__documentRules)
84 if rule.urlMatch(url):
85 return True
86
87 return False
88 84
89 def elemHideDisabledForUrl(self, url): 85 def elemHideDisabledForUrl(self, url):
90 """ 86 """
91 Public method to check, if element hiding is disabled for the given 87 Public method to check, if element hiding is disabled for the given
92 URL. 88 URL.
97 @rtype bool 93 @rtype bool
98 """ 94 """
99 if self.adBlockDisabledForUrl(url): 95 if self.adBlockDisabledForUrl(url):
100 return True 96 return True
101 97
102 for rule in self.__elemhideRules: 98 return any(rule.urlMatch(url) for rule in self.__elemhideRules)
103 if rule.urlMatch(url):
104 return True
105
106 return False
107 99
108 def elementHidingRules(self): 100 def elementHidingRules(self):
109 """ 101 """
110 Public method to get the element hiding rules. 102 Public method to get the element hiding rules.
111 103

eric ide

mercurial