126 QByteArray(urlQuery.queryItemValue( |
126 QByteArray(urlQuery.queryItemValue( |
127 "requiresLocation").encode())) |
127 "requiresLocation").encode())) |
128 self.__requiresTitle = QUrl.fromPercentEncoding( |
128 self.__requiresTitle = QUrl.fromPercentEncoding( |
129 QByteArray(urlQuery.queryItemValue("requiresTitle").encode())) |
129 QByteArray(urlQuery.queryItemValue("requiresTitle").encode())) |
130 if self.__requiresLocation and self.__requiresTitle: |
130 if self.__requiresLocation and self.__requiresTitle: |
131 import Helpviewer.HelpWindow |
131 from WebBrowser.WebBrowserWindow import WebBrowserWindow |
132 Helpviewer.HelpWindow.HelpWindow.adBlockManager()\ |
132 WebBrowserWindow.adBlockManager().loadRequiredSubscription( |
133 .loadRequiredSubscription(self.__requiresLocation, |
133 self.__requiresLocation, self.__requiresTitle) |
134 self.__requiresTitle) |
|
135 |
134 |
136 lastUpdateString = urlQuery.queryItemValue("lastUpdate") |
135 lastUpdateString = urlQuery.queryItemValue("lastUpdate") |
137 self.__lastUpdate = QDateTime.fromString(lastUpdateString, |
136 self.__lastUpdate = QDateTime.fromString(lastUpdateString, |
138 Qt.ISODate) |
137 Qt.ISODate) |
139 |
138 |
497 |
496 |
498 def match(self, req, urlDomain, urlString): |
497 def match(self, req, urlDomain, urlString): |
499 """ |
498 """ |
500 Public method to check the subscription for a matching rule. |
499 Public method to check the subscription for a matching rule. |
501 |
500 |
502 @param req reference to the network request (QNetworkRequest) |
501 @param req reference to the network request (QWebEngineUrlRequestInfo) |
503 @param urlDomain domain of the URL (string) |
502 @param urlDomain domain of the URL (string) |
504 @param urlString URL (string) |
503 @param urlString URL (string) |
505 @return reference to the rule object or None (AdBlockRule) |
504 @return reference to the rule object or None (AdBlockRule) |
506 """ |
505 """ |
507 for rule in self.__networkExceptionRules: |
506 for rule in self.__networkExceptionRules: |