Mon, 18 Dec 2017 18:09:39 +0100
Reworked the AdBlock stuff of web browser NG.
--- a/APIs/Python3/eric6.api Thu Dec 14 19:25:34 2017 +0100 +++ b/APIs/Python3/eric6.api Mon Dec 18 18:09:39 2017 +0100 @@ -10540,10 +10540,12 @@ eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.addSubscription?4(subscription) eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.addSubscriptionFromUrl?4(url) eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.block?4(info) +eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.canRunOnScheme?4(scheme) eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.close?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.customRules?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.elementHidingRules?4(url) eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.elementHidingRulesForDomain?4(url) +eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.enabledChanged?7 eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.exceptions?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.getDefaultSubscriptionUrl?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.getRequiresSubscriptions?4(subscription) @@ -10567,9 +10569,23 @@ eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.updateAllSubscriptions?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager.useLimitedEasyList?4() eric6.WebBrowser.AdBlock.AdBlockManager.AdBlockManager?1(parent=None) +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.adBlockDisabledForUrl?4(url) +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.clear?4() +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.elemHideDisabledForUrl?4(url) +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.elementHidingRules?4() +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.elementHidingRulesForDomain?4(domain) +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.match?4(request, urlDomain, urlString) +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher.update?4() +eric6.WebBrowser.AdBlock.AdBlockMatcher.AdBlockMatcher?1(manager) eric6.WebBrowser.AdBlock.AdBlockPage.AdBlockPage.hideBlockedPageEntries?4(page) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.addBlockedDomains?4(domains) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.allowedDomains?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.blockedDomains?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.caseSensitivity?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.copyFrom?4(other) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.cssSelector?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.filter?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.getRegExpAndMatchers?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.isCSSRule?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.isComment?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.isDocument?4() @@ -10581,42 +10597,76 @@ eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.isInternalDisabled?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.isSlow?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchDomain?4(domain) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchFont?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchImage?4(req) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchMedia?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchObject?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchObjectSubrequest?4(req) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchOther?4(req) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchPing?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchScript?4(req) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchString?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchStyleSheet?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchSubdocument?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchThirdParty?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.matchXmlHttpRequest?4(req) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.networkMatch?4(request, domain, encodedUrl) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.ruleExceptions?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.ruleOptions?4() +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.ruleType?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.setEnabled?4(enabled) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.setException?4(exception) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.setFilter?4(filterRule) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.setOption?4(opt) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.setSubscription?4(subscription) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.subscription?4() eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule.urlMatch?4(url) eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRule?1(filterRule="", subscription=None) +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.DocumentOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.DomainRestrictedOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ElementHideOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.FontOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ImageOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.MediaOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.NoOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ObjectOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ObjectSubrequestOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.OtherOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.PingOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ScriptOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.StyleSheetOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.SubdocumentOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.ThirdPartyOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleOption.XMLHttpRequestOption?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.CssRule?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.DomainMatchRule?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.Invalid?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.MatchAllUrlsRule?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.RegExpMatchRule?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.StringContainsMatchRule?7 +eric6.WebBrowser.AdBlock.AdBlockRule.AdBlockRuleType.StringEndsMatchRule?7 eric6.WebBrowser.AdBlock.AdBlockRule.toSecondLevelDomain?4(url) -eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.adBlockDisabledForUrl?4(url) +eric6.WebBrowser.AdBlock.AdBlockSearchTree.AdBlockSearchTree.add?4(rule) +eric6.WebBrowser.AdBlock.AdBlockSearchTree.AdBlockSearchTree.clear?4() +eric6.WebBrowser.AdBlock.AdBlockSearchTree.AdBlockSearchTree.find?4(request, domain, urlString) +eric6.WebBrowser.AdBlock.AdBlockSearchTree.AdBlockSearchTree?1() +eric6.WebBrowser.AdBlock.AdBlockSearchTree.AdBlockSearchTreeNode?1() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.addRule?4(rule) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.allRules?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.canBeRemoved?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.canEditRules?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.changed?7 eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.checkForUpdate?4() -eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.elemHideDisabledForUrl?4(url) -eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.elementHidingRules?4() -eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.elementHidingRulesForDomain?4(domain) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.enabledChanged?7 eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.isEnabled?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.lastUpdate?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.location?4() -eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.match?4(req, urlDomain, urlString) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.removeRule?4(offset) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.replaceRule?4(rule, offset) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.requiresLocation?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.rule?4(offset) eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.rulesChanged?7 +eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.rulesEnabledChanged?7 eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.rulesFileName?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.saveRules?4() eric6.WebBrowser.AdBlock.AdBlockSubscription.AdBlockSubscription.setEnabled?4(enabled)
--- a/APIs/Python3/eric6.bas Thu Dec 14 19:25:34 2017 +0100 +++ b/APIs/Python3/eric6.bas Mon Dec 18 18:09:39 2017 +0100 @@ -9,8 +9,11 @@ AdBlockExceptionsDialog QDialog Ui_AdBlockExceptionsDialog AdBlockIcon E5ClickableLabel AdBlockManager QObject +AdBlockMatcher QObject AdBlockNetwork QObject AdBlockPage QObject +AdBlockRuleOption IntFlag +AdBlockRuleType IntFlag AdBlockSubscription QObject AdBlockTreeWidget E5TreeWidget AdBlockUrlInterceptor UrlInterceptor
--- a/Documentation/Help/source.qhp Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Help/source.qhp Mon Dec 18 18:09:39 2017 +0100 @@ -1204,8 +1204,10 @@ <section title="eric6.WebBrowser.AdBlock.AdBlockExceptionsDialog" ref="eric6.WebBrowser.AdBlock.AdBlockExceptionsDialog.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockIcon" ref="eric6.WebBrowser.AdBlock.AdBlockIcon.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockManager" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html" /> + <section title="eric6.WebBrowser.AdBlock.AdBlockMatcher" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockPage" ref="eric6.WebBrowser.AdBlock.AdBlockPage.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockRule" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html" /> + <section title="eric6.WebBrowser.AdBlock.AdBlockSearchTree" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockSubscription" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockTreeWidget" ref="eric6.WebBrowser.AdBlock.AdBlockTreeWidget.html" /> <section title="eric6.WebBrowser.AdBlock.AdBlockUrlInterceptor" ref="eric6.WebBrowser.AdBlock.AdBlockUrlInterceptor.html" /> @@ -1595,6 +1597,7 @@ <keyword name="AdBlockDialog.__load" id="AdBlockDialog.__load" ref="eric6.WebBrowser.AdBlock.AdBlockDialog.html#AdBlockDialog.__load" /> <keyword name="AdBlockDialog.__loadSubscriptions" id="AdBlockDialog.__loadSubscriptions" ref="eric6.Helpviewer.AdBlock.AdBlockDialog.html#AdBlockDialog.__loadSubscriptions" /> <keyword name="AdBlockDialog.__loadSubscriptions" id="AdBlockDialog.__loadSubscriptions" ref="eric6.WebBrowser.AdBlock.AdBlockDialog.html#AdBlockDialog.__loadSubscriptions" /> + <keyword name="AdBlockDialog.__managerEnabledChanged" id="AdBlockDialog.__managerEnabledChanged" ref="eric6.WebBrowser.AdBlock.AdBlockDialog.html#AdBlockDialog.__managerEnabledChanged" /> <keyword name="AdBlockDialog.__removeCustomRule" id="AdBlockDialog.__removeCustomRule" ref="eric6.Helpviewer.AdBlock.AdBlockDialog.html#AdBlockDialog.__removeCustomRule" /> <keyword name="AdBlockDialog.__removeCustomRule" id="AdBlockDialog.__removeCustomRule" ref="eric6.WebBrowser.AdBlock.AdBlockDialog.html#AdBlockDialog.__removeCustomRule" /> <keyword name="AdBlockDialog.__removeSubscription" id="AdBlockDialog.__removeSubscription" ref="eric6.Helpviewer.AdBlock.AdBlockDialog.html#AdBlockDialog.__removeSubscription" /> @@ -1669,7 +1672,7 @@ <keyword name="AdBlockManager (Constructor)" id="AdBlockManager (Constructor)" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__init__" /> <keyword name="AdBlockManager (Module)" id="AdBlockManager (Module)" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html" /> <keyword name="AdBlockManager (Module)" id="AdBlockManager (Module)" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html" /> - <keyword name="AdBlockManager.__canRunOnScheme" id="AdBlockManager.__canRunOnScheme" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__canRunOnScheme" /> + <keyword name="AdBlockManager.__canBeBlocked" id="AdBlockManager.__canBeBlocked" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__canBeBlocked" /> <keyword name="AdBlockManager.__customSubscriptionLocation" id="AdBlockManager.__customSubscriptionLocation" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__customSubscriptionLocation" /> <keyword name="AdBlockManager.__customSubscriptionLocation" id="AdBlockManager.__customSubscriptionLocation" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__customSubscriptionLocation" /> <keyword name="AdBlockManager.__customSubscriptionUrl" id="AdBlockManager.__customSubscriptionUrl" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__customSubscriptionUrl" /> @@ -1677,12 +1680,14 @@ <keyword name="AdBlockManager.__loadSubscriptions" id="AdBlockManager.__loadSubscriptions" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.__loadSubscriptions" /> <keyword name="AdBlockManager.__loadSubscriptions" id="AdBlockManager.__loadSubscriptions" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__loadSubscriptions" /> <keyword name="AdBlockManager.__rulesChanged" id="AdBlockManager.__rulesChanged" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__rulesChanged" /> + <keyword name="AdBlockManager.__updateMatcher" id="AdBlockManager.__updateMatcher" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.__updateMatcher" /> <keyword name="AdBlockManager.addException" id="AdBlockManager.addException" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.addException" /> <keyword name="AdBlockManager.addException" id="AdBlockManager.addException" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.addException" /> <keyword name="AdBlockManager.addSubscription" id="AdBlockManager.addSubscription" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.addSubscription" /> <keyword name="AdBlockManager.addSubscription" id="AdBlockManager.addSubscription" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.addSubscription" /> <keyword name="AdBlockManager.addSubscriptionFromUrl" id="AdBlockManager.addSubscriptionFromUrl" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.addSubscriptionFromUrl" /> <keyword name="AdBlockManager.block" id="AdBlockManager.block" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.block" /> + <keyword name="AdBlockManager.canRunOnScheme" id="AdBlockManager.canRunOnScheme" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.canRunOnScheme" /> <keyword name="AdBlockManager.close" id="AdBlockManager.close" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.close" /> <keyword name="AdBlockManager.close" id="AdBlockManager.close" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.close" /> <keyword name="AdBlockManager.customRules" id="AdBlockManager.customRules" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.customRules" /> @@ -1730,6 +1735,16 @@ <keyword name="AdBlockManager.updateAllSubscriptions" id="AdBlockManager.updateAllSubscriptions" ref="eric6.Helpviewer.AdBlock.AdBlockManager.html#AdBlockManager.updateAllSubscriptions" /> <keyword name="AdBlockManager.updateAllSubscriptions" id="AdBlockManager.updateAllSubscriptions" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.updateAllSubscriptions" /> <keyword name="AdBlockManager.useLimitedEasyList" id="AdBlockManager.useLimitedEasyList" ref="eric6.WebBrowser.AdBlock.AdBlockManager.html#AdBlockManager.useLimitedEasyList" /> + <keyword name="AdBlockMatcher" id="AdBlockMatcher" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher" /> + <keyword name="AdBlockMatcher (Constructor)" id="AdBlockMatcher (Constructor)" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.__init__" /> + <keyword name="AdBlockMatcher (Module)" id="AdBlockMatcher (Module)" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html" /> + <keyword name="AdBlockMatcher.adBlockDisabledForUrl" id="AdBlockMatcher.adBlockDisabledForUrl" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.adBlockDisabledForUrl" /> + <keyword name="AdBlockMatcher.clear" id="AdBlockMatcher.clear" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.clear" /> + <keyword name="AdBlockMatcher.elemHideDisabledForUrl" id="AdBlockMatcher.elemHideDisabledForUrl" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.elemHideDisabledForUrl" /> + <keyword name="AdBlockMatcher.elementHidingRules" id="AdBlockMatcher.elementHidingRules" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.elementHidingRules" /> + <keyword name="AdBlockMatcher.elementHidingRulesForDomain" id="AdBlockMatcher.elementHidingRulesForDomain" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.elementHidingRulesForDomain" /> + <keyword name="AdBlockMatcher.match" id="AdBlockMatcher.match" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.match" /> + <keyword name="AdBlockMatcher.update" id="AdBlockMatcher.update" ref="eric6.WebBrowser.AdBlock.AdBlockMatcher.html#AdBlockMatcher.update" /> <keyword name="AdBlockNetwork" id="AdBlockNetwork" ref="eric6.Helpviewer.AdBlock.AdBlockNetwork.html#AdBlockNetwork" /> <keyword name="AdBlockNetwork (Module)" id="AdBlockNetwork (Module)" ref="eric6.Helpviewer.AdBlock.AdBlockNetwork.html" /> <keyword name="AdBlockNetwork.__canBeBlocked" id="AdBlockNetwork.__canBeBlocked" ref="eric6.Helpviewer.AdBlock.AdBlockNetwork.html#AdBlockNetwork.__canBeBlocked" /> @@ -1749,15 +1764,29 @@ <keyword name="AdBlockRule (Module)" id="AdBlockRule (Module)" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html" /> <keyword name="AdBlockRule.__convertPatternToRegExp" id="AdBlockRule.__convertPatternToRegExp" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.__convertPatternToRegExp" /> <keyword name="AdBlockRule.__convertPatternToRegExp" id="AdBlockRule.__convertPatternToRegExp" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__convertPatternToRegExp" /> + <keyword name="AdBlockRule.__filterIsOnlyDomain" id="AdBlockRule.__filterIsOnlyDomain" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__filterIsOnlyDomain" /> + <keyword name="AdBlockRule.__filterIsOnlyEndsMatch" id="AdBlockRule.__filterIsOnlyEndsMatch" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__filterIsOnlyEndsMatch" /> + <keyword name="AdBlockRule.__hasException" id="AdBlockRule.__hasException" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__hasException" /> + <keyword name="AdBlockRule.__hasOption" id="AdBlockRule.__hasOption" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__hasOption" /> + <keyword name="AdBlockRule.__isMatchingDomain" id="AdBlockRule.__isMatchingDomain" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__isMatchingDomain" /> + <keyword name="AdBlockRule.__isMatchingRegExpStrings" id="AdBlockRule.__isMatchingRegExpStrings" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__isMatchingRegExpStrings" /> <keyword name="AdBlockRule.__parseDomains" id="AdBlockRule.__parseDomains" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.__parseDomains" /> <keyword name="AdBlockRule.__parseDomains" id="AdBlockRule.__parseDomains" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__parseDomains" /> <keyword name="AdBlockRule.__parseFilter" id="AdBlockRule.__parseFilter" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.__parseFilter" /> <keyword name="AdBlockRule.__parseFilter" id="AdBlockRule.__parseFilter" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__parseFilter" /> + <keyword name="AdBlockRule.__parseRegExpFilter" id="AdBlockRule.__parseRegExpFilter" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__parseRegExpFilter" /> + <keyword name="AdBlockRule.__setException" id="AdBlockRule.__setException" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__setException" /> <keyword name="AdBlockRule.__stringMatch" id="AdBlockRule.__stringMatch" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.__stringMatch" /> + <keyword name="AdBlockRule.addBlockedDomains" id="AdBlockRule.addBlockedDomains" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.addBlockedDomains" /> + <keyword name="AdBlockRule.allowedDomains" id="AdBlockRule.allowedDomains" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.allowedDomains" /> + <keyword name="AdBlockRule.blockedDomains" id="AdBlockRule.blockedDomains" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.blockedDomains" /> + <keyword name="AdBlockRule.caseSensitivity" id="AdBlockRule.caseSensitivity" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.caseSensitivity" /> + <keyword name="AdBlockRule.copyFrom" id="AdBlockRule.copyFrom" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.copyFrom" /> <keyword name="AdBlockRule.cssSelector" id="AdBlockRule.cssSelector" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.cssSelector" /> <keyword name="AdBlockRule.cssSelector" id="AdBlockRule.cssSelector" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.cssSelector" /> <keyword name="AdBlockRule.filter" id="AdBlockRule.filter" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.filter" /> <keyword name="AdBlockRule.filter" id="AdBlockRule.filter" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.filter" /> + <keyword name="AdBlockRule.getRegExpAndMatchers" id="AdBlockRule.getRegExpAndMatchers" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.getRegExpAndMatchers" /> <keyword name="AdBlockRule.isCSSRule" id="AdBlockRule.isCSSRule" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.isCSSRule" /> <keyword name="AdBlockRule.isCSSRule" id="AdBlockRule.isCSSRule" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.isCSSRule" /> <keyword name="AdBlockRule.isComment" id="AdBlockRule.isComment" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.isComment" /> @@ -1780,11 +1809,16 @@ <keyword name="AdBlockRule.isSlow" id="AdBlockRule.isSlow" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.isSlow" /> <keyword name="AdBlockRule.matchDomain" id="AdBlockRule.matchDomain" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.matchDomain" /> <keyword name="AdBlockRule.matchDomain" id="AdBlockRule.matchDomain" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchDomain" /> + <keyword name="AdBlockRule.matchFont" id="AdBlockRule.matchFont" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchFont" /> <keyword name="AdBlockRule.matchImage" id="AdBlockRule.matchImage" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchImage" /> + <keyword name="AdBlockRule.matchMedia" id="AdBlockRule.matchMedia" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchMedia" /> <keyword name="AdBlockRule.matchObject" id="AdBlockRule.matchObject" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.matchObject" /> <keyword name="AdBlockRule.matchObject" id="AdBlockRule.matchObject" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchObject" /> <keyword name="AdBlockRule.matchObjectSubrequest" id="AdBlockRule.matchObjectSubrequest" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchObjectSubrequest" /> + <keyword name="AdBlockRule.matchOther" id="AdBlockRule.matchOther" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchOther" /> + <keyword name="AdBlockRule.matchPing" id="AdBlockRule.matchPing" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchPing" /> <keyword name="AdBlockRule.matchScript" id="AdBlockRule.matchScript" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchScript" /> + <keyword name="AdBlockRule.matchString" id="AdBlockRule.matchString" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchString" /> <keyword name="AdBlockRule.matchStyleSheet" id="AdBlockRule.matchStyleSheet" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchStyleSheet" /> <keyword name="AdBlockRule.matchSubdocument" id="AdBlockRule.matchSubdocument" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.matchSubdocument" /> <keyword name="AdBlockRule.matchSubdocument" id="AdBlockRule.matchSubdocument" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchSubdocument" /> @@ -1794,16 +1828,33 @@ <keyword name="AdBlockRule.matchXmlHttpRequest" id="AdBlockRule.matchXmlHttpRequest" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.matchXmlHttpRequest" /> <keyword name="AdBlockRule.networkMatch" id="AdBlockRule.networkMatch" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.networkMatch" /> <keyword name="AdBlockRule.networkMatch" id="AdBlockRule.networkMatch" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.networkMatch" /> + <keyword name="AdBlockRule.ruleExceptions" id="AdBlockRule.ruleExceptions" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.ruleExceptions" /> + <keyword name="AdBlockRule.ruleOptions" id="AdBlockRule.ruleOptions" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.ruleOptions" /> + <keyword name="AdBlockRule.ruleType" id="AdBlockRule.ruleType" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.ruleType" /> <keyword name="AdBlockRule.setEnabled" id="AdBlockRule.setEnabled" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.setEnabled" /> <keyword name="AdBlockRule.setEnabled" id="AdBlockRule.setEnabled" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.setEnabled" /> <keyword name="AdBlockRule.setException" id="AdBlockRule.setException" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.setException" /> <keyword name="AdBlockRule.setException" id="AdBlockRule.setException" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.setException" /> <keyword name="AdBlockRule.setFilter" id="AdBlockRule.setFilter" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.setFilter" /> <keyword name="AdBlockRule.setFilter" id="AdBlockRule.setFilter" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.setFilter" /> + <keyword name="AdBlockRule.setOption" id="AdBlockRule.setOption" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.setOption" /> + <keyword name="AdBlockRule.setSubscription" id="AdBlockRule.setSubscription" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.setSubscription" /> <keyword name="AdBlockRule.subscription" id="AdBlockRule.subscription" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.subscription" /> <keyword name="AdBlockRule.subscription" id="AdBlockRule.subscription" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.subscription" /> <keyword name="AdBlockRule.urlMatch" id="AdBlockRule.urlMatch" ref="eric6.Helpviewer.AdBlock.AdBlockRule.html#AdBlockRule.urlMatch" /> <keyword name="AdBlockRule.urlMatch" id="AdBlockRule.urlMatch" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRule.urlMatch" /> + <keyword name="AdBlockRuleOption" id="AdBlockRuleOption" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRuleOption" /> + <keyword name="AdBlockRuleType" id="AdBlockRuleType" ref="eric6.WebBrowser.AdBlock.AdBlockRule.html#AdBlockRuleType" /> + <keyword name="AdBlockSearchTree" id="AdBlockSearchTree" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree" /> + <keyword name="AdBlockSearchTree (Constructor)" id="AdBlockSearchTree (Constructor)" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.__init__" /> + <keyword name="AdBlockSearchTree (Module)" id="AdBlockSearchTree (Module)" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html" /> + <keyword name="AdBlockSearchTree.__deleteNode" id="AdBlockSearchTree.__deleteNode" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.__deleteNode" /> + <keyword name="AdBlockSearchTree.__prefixSearch" id="AdBlockSearchTree.__prefixSearch" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.__prefixSearch" /> + <keyword name="AdBlockSearchTree.add" id="AdBlockSearchTree.add" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.add" /> + <keyword name="AdBlockSearchTree.clear" id="AdBlockSearchTree.clear" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.clear" /> + <keyword name="AdBlockSearchTree.find" id="AdBlockSearchTree.find" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTree.find" /> + <keyword name="AdBlockSearchTreeNode" id="AdBlockSearchTreeNode" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTreeNode" /> + <keyword name="AdBlockSearchTreeNode (Constructor)" id="AdBlockSearchTreeNode (Constructor)" ref="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html#AdBlockSearchTreeNode.__init__" /> <keyword name="AdBlockSubscription" id="AdBlockSubscription" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription" /> <keyword name="AdBlockSubscription" id="AdBlockSubscription" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription" /> <keyword name="AdBlockSubscription (Constructor)" id="AdBlockSubscription (Constructor)" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__init__" /> @@ -1815,13 +1866,11 @@ <keyword name="AdBlockSubscription.__parseUrl" id="AdBlockSubscription.__parseUrl" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__parseUrl" /> <keyword name="AdBlockSubscription.__parseUrl" id="AdBlockSubscription.__parseUrl" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__parseUrl" /> <keyword name="AdBlockSubscription.__populateCache" id="AdBlockSubscription.__populateCache" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__populateCache" /> - <keyword name="AdBlockSubscription.__populateCache" id="AdBlockSubscription.__populateCache" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__populateCache" /> <keyword name="AdBlockSubscription.__rulesDownloaded" id="AdBlockSubscription.__rulesDownloaded" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__rulesDownloaded" /> <keyword name="AdBlockSubscription.__rulesDownloaded" id="AdBlockSubscription.__rulesDownloaded" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__rulesDownloaded" /> <keyword name="AdBlockSubscription.__validateCheckSum" id="AdBlockSubscription.__validateCheckSum" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__validateCheckSum" /> <keyword name="AdBlockSubscription.__validateCheckSum" id="AdBlockSubscription.__validateCheckSum" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.__validateCheckSum" /> <keyword name="AdBlockSubscription.adBlockDisabledForUrl" id="AdBlockSubscription.adBlockDisabledForUrl" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.adBlockDisabledForUrl" /> - <keyword name="AdBlockSubscription.adBlockDisabledForUrl" id="AdBlockSubscription.adBlockDisabledForUrl" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.adBlockDisabledForUrl" /> <keyword name="AdBlockSubscription.addRule" id="AdBlockSubscription.addRule" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.addRule" /> <keyword name="AdBlockSubscription.addRule" id="AdBlockSubscription.addRule" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.addRule" /> <keyword name="AdBlockSubscription.allRules" id="AdBlockSubscription.allRules" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.allRules" /> @@ -1833,11 +1882,8 @@ <keyword name="AdBlockSubscription.checkForUpdate" id="AdBlockSubscription.checkForUpdate" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.checkForUpdate" /> <keyword name="AdBlockSubscription.checkForUpdate" id="AdBlockSubscription.checkForUpdate" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.checkForUpdate" /> <keyword name="AdBlockSubscription.elemHideDisabledForUrl" id="AdBlockSubscription.elemHideDisabledForUrl" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elemHideDisabledForUrl" /> - <keyword name="AdBlockSubscription.elemHideDisabledForUrl" id="AdBlockSubscription.elemHideDisabledForUrl" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elemHideDisabledForUrl" /> <keyword name="AdBlockSubscription.elementHidingRules" id="AdBlockSubscription.elementHidingRules" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elementHidingRules" /> - <keyword name="AdBlockSubscription.elementHidingRules" id="AdBlockSubscription.elementHidingRules" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elementHidingRules" /> <keyword name="AdBlockSubscription.elementHidingRulesForDomain" id="AdBlockSubscription.elementHidingRulesForDomain" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elementHidingRulesForDomain" /> - <keyword name="AdBlockSubscription.elementHidingRulesForDomain" id="AdBlockSubscription.elementHidingRulesForDomain" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.elementHidingRulesForDomain" /> <keyword name="AdBlockSubscription.isEnabled" id="AdBlockSubscription.isEnabled" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.isEnabled" /> <keyword name="AdBlockSubscription.isEnabled" id="AdBlockSubscription.isEnabled" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.isEnabled" /> <keyword name="AdBlockSubscription.lastUpdate" id="AdBlockSubscription.lastUpdate" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.lastUpdate" /> @@ -1845,7 +1891,6 @@ <keyword name="AdBlockSubscription.location" id="AdBlockSubscription.location" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.location" /> <keyword name="AdBlockSubscription.location" id="AdBlockSubscription.location" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.location" /> <keyword name="AdBlockSubscription.match" id="AdBlockSubscription.match" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.match" /> - <keyword name="AdBlockSubscription.match" id="AdBlockSubscription.match" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.match" /> <keyword name="AdBlockSubscription.removeRule" id="AdBlockSubscription.removeRule" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.removeRule" /> <keyword name="AdBlockSubscription.removeRule" id="AdBlockSubscription.removeRule" ref="eric6.WebBrowser.AdBlock.AdBlockSubscription.html#AdBlockSubscription.removeRule" /> <keyword name="AdBlockSubscription.replaceRule" id="AdBlockSubscription.replaceRule" ref="eric6.Helpviewer.AdBlock.AdBlockSubscription.html#AdBlockSubscription.replaceRule" /> @@ -19949,8 +19994,10 @@ <file>eric6.WebBrowser.AdBlock.AdBlockExceptionsDialog.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockIcon.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockManager.html</file> + <file>eric6.WebBrowser.AdBlock.AdBlockMatcher.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockPage.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockRule.html</file> + <file>eric6.WebBrowser.AdBlock.AdBlockSearchTree.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockSubscription.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockTreeWidget.html</file> <file>eric6.WebBrowser.AdBlock.AdBlockUrlInterceptor.html</file>
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockDialog.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockDialog.html Mon Dec 18 18:09:39 2017 +0100 @@ -78,6 +78,9 @@ <td><a href="#AdBlockDialog.__loadSubscriptions">__loadSubscriptions</a></td> <td>Private slot to load the AdBlock subscription rules.</td> </tr><tr> +<td><a href="#AdBlockDialog.__managerEnabledChanged">__managerEnabledChanged</a></td> +<td>Private slot handling a change of the AdBlock manager enabled state.</td> +</tr><tr> <td><a href="#AdBlockDialog.__removeCustomRule">__removeCustomRule</a></td> <td>Private slot to remove a custom AdBlock rule.</td> </tr><tr> @@ -128,12 +131,12 @@ <p> Constructor </p><dl> -<dt><i>manager</i></dt> +<dt><i>manager</i> (AdBlockManager)</dt> <dd> -reference to the AdBlock manager (AdBlockManager) -</dd><dt><i>parent</i></dt> +reference to the AdBlock manager +</dd><dt><i>parent</i> (QWidget)</dt> <dd> -reference to the parent object (QWidget) +reference to the parent object </dd> </dl><a NAME="AdBlockDialog.__aboutToShowActionMenu" ID="AdBlockDialog.__aboutToShowActionMenu"></a> <h4>AdBlockDialog.__aboutToShowActionMenu</h4> @@ -165,7 +168,17 @@ <b>__loadSubscriptions</b>(<i></i>) <p> Private slot to load the AdBlock subscription rules. -</p><a NAME="AdBlockDialog.__removeCustomRule" ID="AdBlockDialog.__removeCustomRule"></a> +</p><a NAME="AdBlockDialog.__managerEnabledChanged" ID="AdBlockDialog.__managerEnabledChanged"></a> +<h4>AdBlockDialog.__managerEnabledChanged</h4> +<b>__managerEnabledChanged</b>(<i>enabled</i>) +<p> + Private slot handling a change of the AdBlock manager enabled state. +</p><dl> +<dt><i>enabled</i> (bool)</dt> +<dd> +flag indicating the enabled state +</dd> +</dl><a NAME="AdBlockDialog.__removeCustomRule" ID="AdBlockDialog.__removeCustomRule"></a> <h4>AdBlockDialog.__removeCustomRule</h4> <b>__removeCustomRule</b>(<i></i>) <p> @@ -181,13 +194,12 @@ <p> Private slot to set the enabled state of a subscription. </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> subscription to set the state for - (AdBlockSubscription) -</dd><dt><i>enable</i></dt> +</dd><dt><i>enable</i> (bool)</dt> <dd> -state to set to (boolean) +state to set to </dd> </dl><a NAME="AdBlockDialog.__switchSubscriptionEnabled" ID="AdBlockDialog.__switchSubscriptionEnabled"></a> <h4>AdBlockDialog.__switchSubscriptionEnabled</h4> @@ -210,9 +222,9 @@ <p> Public slot to add a custom AdBlock rule. </p><dl> -<dt><i>filterRule</i></dt> +<dt><i>filterRule</i> (string)</dt> <dd> -filter to be added (string) +filter to be added </dd> </dl><a NAME="AdBlockDialog.addSubscription" ID="AdBlockDialog.addSubscription"></a> <h4>AdBlockDialog.addSubscription</h4> @@ -220,13 +232,13 @@ <p> Public slot adding a subscription to the list. </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> reference to the subscription to be - added (AdBlockSubscription) -</dd><dt><i>refresh</i></dt> + added +</dd><dt><i>refresh</i> (bool)</dt> <dd> -flag indicating to refresh the tree (boolean) +flag indicating to refresh the tree </dd> </dl><a NAME="AdBlockDialog.on_adBlockGroup_toggled" ID="AdBlockDialog.on_adBlockGroup_toggled"></a> <h4>AdBlockDialog.on_adBlockGroup_toggled</h4> @@ -234,9 +246,9 @@ <p> Private slot handling the enabling/disabling of AdBlock. </p><dl> -<dt><i>state</i></dt> +<dt><i>state</i> (bool)</dt> <dd> -state of the toggle (boolean) +state of the toggle </dd> </dl><a NAME="AdBlockDialog.on_searchEdit_textChanged" ID="AdBlockDialog.on_searchEdit_textChanged"></a> <h4>AdBlockDialog.on_searchEdit_textChanged</h4> @@ -244,9 +256,9 @@ <p> Private slot to set a new filter on the current widget. </p><dl> -<dt><i>filterRule</i></dt> +<dt><i>filterRule</i> (str)</dt> <dd> -filter to be set (string) +filter to be set </dd> </dl><a NAME="AdBlockDialog.on_subscriptionsTabWidget_currentChanged" ID="AdBlockDialog.on_subscriptionsTabWidget_currentChanged"></a> <h4>AdBlockDialog.on_subscriptionsTabWidget_currentChanged</h4> @@ -254,9 +266,9 @@ <p> Private slot handling the selection of another tab. </p><dl> -<dt><i>index</i></dt> +<dt><i>index</i> (int)</dt> <dd> -index of the new current tab (integer) +index of the new current tab </dd> </dl><a NAME="AdBlockDialog.on_updateSpinBox_valueChanged" ID="AdBlockDialog.on_updateSpinBox_valueChanged"></a> <h4>AdBlockDialog.on_updateSpinBox_valueChanged</h4> @@ -264,9 +276,9 @@ <p> Private slot to handle changes of the update period. </p><dl> -<dt><i>value</i></dt> +<dt><i>value</i> (int)</dt> <dd> -update period (integer) +update period </dd> </dl><a NAME="AdBlockDialog.on_useLimitedEasyListCheckBox_clicked" ID="AdBlockDialog.on_useLimitedEasyListCheckBox_clicked"></a> <h4>AdBlockDialog.on_useLimitedEasyListCheckBox_clicked</h4>
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockExceptionsDialog.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockExceptionsDialog.html Mon Dec 18 18:09:39 2017 +0100 @@ -89,9 +89,9 @@ <p> Constructor </p><dl> -<dt><i>parent</i></dt> +<dt><i>parent</i> (QWidget)</dt> <dd> -reference to the parent widget (QWidget) +reference to the parent widget </dd> </dl><a NAME="AdBlockExceptionsDialog.accept" ID="AdBlockExceptionsDialog.accept"></a> <h4>AdBlockExceptionsDialog.accept</h4> @@ -104,7 +104,7 @@ <p> Public slot to load the list of excepted hosts. </p><dl> -<dt><i>hosts</i></dt> +<dt><i>hosts</i> (list of str)</dt> <dd> list of excepted hosts </dd> @@ -124,9 +124,9 @@ <p> Private slot to handle changes of the host edit. </p><dl> -<dt><i>txt</i></dt> +<dt><i>txt</i> (str)</dt> <dd> -text of the edit (string) +text of the edit </dd> </dl><a NAME="AdBlockExceptionsDialog.on_hostList_itemSelectionChanged" ID="AdBlockExceptionsDialog.on_hostList_itemSelectionChanged"></a> <h4>AdBlockExceptionsDialog.on_hostList_itemSelectionChanged</h4>
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockIcon.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockIcon.html Mon Dec 18 18:09:39 2017 +0100 @@ -98,9 +98,9 @@ <p> Constructor </p><dl> -<dt><i>parent</i></dt> +<dt><i>parent</i> (WebBrowserWindow)</dt> <dd> -reference to the parent widget (HelpWindow) +reference to the parent widget </dd> </dl><a NAME="AdBlockIcon.__createMenu" ID="AdBlockIcon.__createMenu"></a> <h4>AdBlockIcon.__createMenu</h4> @@ -108,9 +108,9 @@ <p> Private slot to create the context menu. </p><dl> -<dt><i>menu</i></dt> +<dt><i>menu</i> (QMenu)</dt> <dd> -parent menu (QMenu) +parent menu </dd> </dl><a NAME="AdBlockIcon.__enableAdBlock" ID="AdBlockIcon.__enableAdBlock"></a> <h4>AdBlockIcon.__enableAdBlock</h4> @@ -126,7 +126,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating an exception (boolean) +flag indicating an exception +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockIcon.__setException" ID="AdBlockIcon.__setException"></a> <h4>AdBlockIcon.__setException</h4> @@ -140,9 +145,9 @@ <p> Private slot to show the context menu. </p><dl> -<dt><i>pos</i></dt> +<dt><i>pos</i> (QPoint)</dt> <dd> -position the context menu should be shown (QPoint) +position the context menu should be shown </dd> </dl><a NAME="AdBlockIcon.currentChanged" ID="AdBlockIcon.currentChanged"></a> <h4>AdBlockIcon.currentChanged</h4> @@ -157,7 +162,12 @@ </p><dl> <dt>Returns:</dt> <dd> -reference to the menu action (QAction) +reference to the menu action +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +QAction </dd> </dl><a NAME="AdBlockIcon.setEnabled" ID="AdBlockIcon.setEnabled"></a> <h4>AdBlockIcon.setEnabled</h4> @@ -165,9 +175,9 @@ <p> Public slot to set the enabled state. </p><dl> -<dt><i>enabled</i></dt> +<dt><i>enabled</i> (bool)</dt> <dd> -enabled state (boolean) +enabled state </dd> </dl><a NAME="AdBlockIcon.sourceChanged" ID="AdBlockIcon.sourceChanged"></a> <h4>AdBlockIcon.sourceChanged</h4> @@ -175,12 +185,12 @@ <p> Public slot to handle URL changes. </p><dl> -<dt><i>browser</i></dt> +<dt><i>browser</i> (WebBrowserView)</dt> <dd> -reference to the browser (HelpBrowser) -</dd><dt><i>url</i></dt> +reference to the browser +</dd><dt><i>url</i> (QUrl)</dt> <dd> -new URL (QUrl) +new URL </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockManager.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockManager.html Mon Dec 18 18:09:39 2017 +0100 @@ -45,7 +45,11 @@ Class implementing the AdBlock manager. </p><h3>Signals</h3> <dl> -<dt>requiredSubscriptionLoaded(subscription)</dt> +<dt>enabledChanged(enabled)</dt> +<dd> +emitted to indicate a change of the + enabled state +</dd><dt>requiredSubscriptionLoaded(subscription)</dt> <dd> emitted to indicate loading of a required subscription is finished (AdBlockSubscription) @@ -70,8 +74,8 @@ <td><a href="#AdBlockManager.__init__">AdBlockManager</a></td> <td>Constructor</td> </tr><tr> -<td><a href="#AdBlockManager.__canRunOnScheme">__canRunOnScheme</a></td> -<td>Private method to check, if AdBlock can be performed on the scheme.</td> +<td><a href="#AdBlockManager.__canBeBlocked">__canBeBlocked</a></td> +<td>Private method to check, if the given URL could be blocked (i.e.</td> </tr><tr> <td><a href="#AdBlockManager.__customSubscriptionLocation">__customSubscriptionLocation</a></td> <td>Private method to generate the path for custom subscriptions.</td> @@ -85,6 +89,9 @@ <td><a href="#AdBlockManager.__rulesChanged">__rulesChanged</a></td> <td>Private slot handling a change of the AdBlock rules.</td> </tr><tr> +<td><a href="#AdBlockManager.__updateMatcher">__updateMatcher</a></td> +<td>Private slot to update the adblock matcher.</td> +</tr><tr> <td><a href="#AdBlockManager.addException">addException</a></td> <td>Public method to add an exception.</td> </tr><tr> @@ -97,6 +104,9 @@ <td><a href="#AdBlockManager.block">block</a></td> <td>Public method to check, if a request should be blocked.</td> </tr><tr> +<td><a href="#AdBlockManager.canRunOnScheme">canRunOnScheme</a></td> +<td>Public method to check, if AdBlock can be performed on the scheme.</td> +</tr><tr> <td><a href="#AdBlockManager.close">close</a></td> <td>Public method to close the open search engines manager.</td> </tr><tr> @@ -180,24 +190,30 @@ <p> Constructor </p><dl> -<dt><i>parent</i></dt> +<dt><i>parent</i> (QObject)</dt> <dd> -reference to the parent object (QObject) +reference to the parent object </dd> -</dl><a NAME="AdBlockManager.__canRunOnScheme" ID="AdBlockManager.__canRunOnScheme"></a> -<h4>AdBlockManager.__canRunOnScheme</h4> -<b>__canRunOnScheme</b>(<i>scheme</i>) +</dl><a NAME="AdBlockManager.__canBeBlocked" ID="AdBlockManager.__canBeBlocked"></a> +<h4>AdBlockManager.__canBeBlocked</h4> +<b>__canBeBlocked</b>(<i>url</i>) <p> - Private method to check, if AdBlock can be performed on the scheme. + Private method to check, if the given URL could be blocked (i.e. is + not whitelisted). </p><dl> -<dt><i>scheme</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -scheme to check (string) +URL to be checked </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating, that AdBlock can be performed (boolean) +flag indicating that the given URL can be blocked +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockManager.__customSubscriptionLocation" ID="AdBlockManager.__customSubscriptionLocation"></a> <h4>AdBlockManager.__customSubscriptionLocation</h4> @@ -207,7 +223,12 @@ </p><dl> <dt>Returns:</dt> <dd> -URL for custom subscriptions (QUrl) +URL for custom subscriptions +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +QUrl </dd> </dl><a NAME="AdBlockManager.__customSubscriptionUrl" ID="AdBlockManager.__customSubscriptionUrl"></a> <h4>AdBlockManager.__customSubscriptionUrl</h4> @@ -217,7 +238,12 @@ </p><dl> <dt>Returns:</dt> <dd> -URL for custom subscriptions (QUrl) +URL for custom subscriptions +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +QUrl </dd> </dl><a NAME="AdBlockManager.__loadSubscriptions" ID="AdBlockManager.__loadSubscriptions"></a> <h4>AdBlockManager.__loadSubscriptions</h4> @@ -229,15 +255,20 @@ <b>__rulesChanged</b>(<i></i>) <p> Private slot handling a change of the AdBlock rules. +</p><a NAME="AdBlockManager.__updateMatcher" ID="AdBlockManager.__updateMatcher"></a> +<h4>AdBlockManager.__updateMatcher</h4> +<b>__updateMatcher</b>(<i></i>) +<p> + Private slot to update the adblock matcher. </p><a NAME="AdBlockManager.addException" ID="AdBlockManager.addException"></a> <h4>AdBlockManager.addException</h4> <b>addException</b>(<i>host</i>) <p> Public method to add an exception. </p><dl> -<dt><i>host</i></dt> +<dt><i>host</i> (str)</dt> <dd> -to be excepted (string) +to be excepted </dd> </dl><a NAME="AdBlockManager.addSubscription" ID="AdBlockManager.addSubscription"></a> <h4>AdBlockManager.addSubscription</h4> @@ -245,10 +276,9 @@ <p> Public method to add an AdBlock subscription. </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> AdBlock subscription to be added - (AdBlockSubscription) </dd> </dl><a NAME="AdBlockManager.addSubscriptionFromUrl" ID="AdBlockManager.addSubscriptionFromUrl"></a> <h4>AdBlockManager.addSubscriptionFromUrl</h4> @@ -278,7 +308,7 @@ </p><dl> <dt><i>info</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request info aobject +request info object </dd> </dl><dl> <dt>Returns:</dt> @@ -290,6 +320,26 @@ <dd> bool </dd> +</dl><a NAME="AdBlockManager.canRunOnScheme" ID="AdBlockManager.canRunOnScheme"></a> +<h4>AdBlockManager.canRunOnScheme</h4> +<b>canRunOnScheme</b>(<i>scheme</i>) +<p> + Public method to check, if AdBlock can be performed on the scheme. +</p><dl> +<dt><i>scheme</i> (str)</dt> +<dd> +scheme to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating, that AdBlock can be performed +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> </dl><a NAME="AdBlockManager.close" ID="AdBlockManager.close"></a> <h4>AdBlockManager.close</h4> <b>close</b>(<i></i>) @@ -303,7 +353,12 @@ </p><dl> <dt>Returns:</dt> <dd> -subscription object for custom rules (AdBlockSubscription) +subscription object for custom rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockSubscription </dd> </dl><a NAME="AdBlockManager.elementHidingRules" ID="AdBlockManager.elementHidingRules"></a> <h4>AdBlockManager.elementHidingRules</h4> @@ -313,14 +368,19 @@ </p><p> </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -URL to get hiding rules for (QUrl) +URL to get hiding rules for </dd> </dl><dl> <dt>Returns:</dt> <dd> -element hiding rules (string) +element hiding rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockManager.elementHidingRulesForDomain" ID="AdBlockManager.elementHidingRulesForDomain"></a> <h4>AdBlockManager.elementHidingRulesForDomain</h4> @@ -328,14 +388,19 @@ <p> Public method to get the element hiding rules for a domain. </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -URL to get hiding rules for (QUrl) +URL to get hiding rules for </dd> </dl><dl> <dt>Returns:</dt> <dd> -element hiding rules (string) +element hiding rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockManager.exceptions" ID="AdBlockManager.exceptions"></a> <h4>AdBlockManager.exceptions</h4> @@ -345,7 +410,12 @@ </p><dl> <dt>Returns:</dt> <dd> -list of excepted hosts (list of string) +list of excepted hosts +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of str </dd> </dl><a NAME="AdBlockManager.getDefaultSubscriptionUrl" ID="AdBlockManager.getDefaultSubscriptionUrl"></a> <h4>AdBlockManager.getDefaultSubscriptionUrl</h4> @@ -369,15 +439,19 @@ Public method to get a list of subscriptions, that require the given one. </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> -subscription to check for (AdBlockSubscription) +subscription to check for </dd> </dl><dl> <dt>Returns:</dt> <dd> -list of subscription requiring the given one (list of - AdBlockSubscription) +list of subscription requiring the given one +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of AdBlockSubscription </dd> </dl><a NAME="AdBlockManager.isEnabled" ID="AdBlockManager.isEnabled"></a> <h4>AdBlockManager.isEnabled</h4> @@ -387,7 +461,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating the enabled state (boolean) +flag indicating the enabled state +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockManager.isHostExcepted" ID="AdBlockManager.isHostExcepted"></a> <h4>AdBlockManager.isHostExcepted</h4> @@ -395,14 +474,19 @@ <p> Public slot to check, if a host is excepted. </p><dl> -<dt><i>host</i></dt> +<dt><i>host</i> (str)</dt> <dd> -host to check (string) +host to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating an exception (boolean) +flag indicating an exception +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockManager.load" ID="AdBlockManager.load"></a> <h4>AdBlockManager.load</h4> @@ -415,12 +499,12 @@ <p> Public method to load a subscription required by another one. </p><dl> -<dt><i>location</i></dt> +<dt><i>location</i> (str)</dt> <dd> -location of the required subscription (string) -</dd><dt><i>title</i></dt> +location of the required subscription +</dd><dt><i>title</i> (str)</dt> <dd> -title of the required subscription (string) +title of the required subscription </dd> </dl><a NAME="AdBlockManager.page" ID="AdBlockManager.page"></a> <h4>AdBlockManager.page</h4> @@ -430,7 +514,12 @@ </p><dl> <dt>Returns:</dt> <dd> -reference to the page block object (AdBlockPage) +reference to the page block object +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockPage </dd> </dl><a NAME="AdBlockManager.removeException" ID="AdBlockManager.removeException"></a> <h4>AdBlockManager.removeException</h4> @@ -438,9 +527,9 @@ <p> Public method to remove an exception. </p><dl> -<dt><i>host</i></dt> +<dt><i>host</i> (str)</dt> <dd> -to be removed from the list of exceptions (string) +to be removed from the list of exceptions </dd> </dl><a NAME="AdBlockManager.removeSubscription" ID="AdBlockManager.removeSubscription"></a> <h4>AdBlockManager.removeSubscription</h4> @@ -448,13 +537,12 @@ <p> Public method to remove an AdBlock subscription. </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> AdBlock subscription to be removed - (AdBlockSubscription) -</dd><dt><i>emitSignal</i></dt> +</dd><dt><i>emitSignal</i> (bool)</dt> <dd> -flag indicating to send a signal (boolean) +flag indicating to send a signal </dd> </dl><a NAME="AdBlockManager.save" ID="AdBlockManager.save"></a> <h4>AdBlockManager.save</h4> @@ -467,9 +555,9 @@ <p> Public slot to set the enabled state. </p><dl> -<dt><i>enabled</i></dt> +<dt><i>enabled</i> (bool)</dt> <dd> -flag indicating the enabled state (boolean) +flag indicating the enabled state </dd> </dl><a NAME="AdBlockManager.setExceptions" ID="AdBlockManager.setExceptions"></a> <h4>AdBlockManager.setExceptions</h4> @@ -477,9 +565,9 @@ <p> Public method to set the list of excepted hosts. </p><dl> -<dt><i>hosts</i></dt> +<dt><i>hosts</i> (list of str)</dt> <dd> -list of excepted hosts (list of string) +list of excepted hosts </dd> </dl><a NAME="AdBlockManager.setUseLimitedEasyList" ID="AdBlockManager.setUseLimitedEasyList"></a> <h4>AdBlockManager.setUseLimitedEasyList</h4> @@ -499,7 +587,12 @@ </p><dl> <dt>Returns:</dt> <dd> -reference to the dialog (AdBlockDialog) +reference to the dialog +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockDialog </dd> </dl><a NAME="AdBlockManager.showExceptionsDialog" ID="AdBlockManager.showExceptionsDialog"></a> <h4>AdBlockManager.showExceptionsDialog</h4> @@ -509,7 +602,12 @@ </p><dl> <dt>Returns:</dt> <dd> -reference to the exceptions dialog (AdBlockExceptionsDialog) +reference to the exceptions dialog +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockExceptionsDialog </dd> </dl><a NAME="AdBlockManager.subscription" ID="AdBlockManager.subscription"></a> <h4>AdBlockManager.subscription</h4> @@ -517,14 +615,19 @@ <p> Public method to get a subscription based on its location. </p><dl> -<dt><i>location</i></dt> +<dt><i>location</i> (str)</dt> <dd> -location of the subscription to search for (string) +location of the subscription to search for </dd> </dl><dl> <dt>Returns:</dt> <dd> -subscription or None (AdBlockSubscription) +subscription or None +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockSubscription </dd> </dl><a NAME="AdBlockManager.subscriptions" ID="AdBlockManager.subscriptions"></a> <h4>AdBlockManager.subscriptions</h4> @@ -534,7 +637,12 @@ </p><dl> <dt>Returns:</dt> <dd> -list of subscriptions (list of AdBlockSubscription) +list of subscriptions +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of AdBlockSubscription </dd> </dl><a NAME="AdBlockManager.updateAllSubscriptions" ID="AdBlockManager.updateAllSubscriptions"></a> <h4>AdBlockManager.updateAllSubscriptions</h4>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockMatcher.html Mon Dec 18 18:09:39 2017 +0100 @@ -0,0 +1,214 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.WebBrowser.AdBlock.AdBlockMatcher</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric6.WebBrowser.AdBlock.AdBlockMatcher</h1> +<p> +Module implementing the AdBlock matcher. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#AdBlockMatcher">AdBlockMatcher</a></td> +<td>Class implementing the AdBlock matcher.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="AdBlockMatcher" ID="AdBlockMatcher"></a> +<h2>AdBlockMatcher</h2> +<p> + Class implementing the AdBlock matcher. +</p> +<h3>Derived from</h3> +QObject +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#AdBlockMatcher.__init__">AdBlockMatcher</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#AdBlockMatcher.adBlockDisabledForUrl">adBlockDisabledForUrl</a></td> +<td>Public method to check, if AdBlock is disabled for the given URL.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.clear">clear</a></td> +<td>Public slot to clear the internal structures.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.elemHideDisabledForUrl">elemHideDisabledForUrl</a></td> +<td>Public method to check, if element hiding is disabled for the given URL.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.elementHidingRules">elementHidingRules</a></td> +<td>Public method to get the element hiding rules.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.elementHidingRulesForDomain">elementHidingRulesForDomain</a></td> +<td>Public method to get the element hiding rules for the given domain.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.match">match</a></td> +<td>Public method to match a request.</td> +</tr><tr> +<td><a href="#AdBlockMatcher.update">update</a></td> +<td>Public slot to update the internal state.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="AdBlockMatcher.__init__" ID="AdBlockMatcher.__init__"></a> +<h4>AdBlockMatcher (Constructor)</h4> +<b>AdBlockMatcher</b>(<i>manager</i>) +<p> + Constructor +</p><dl> +<dt><i>manager</i> (AdBlockManager)</dt> +<dd> +reference to the AdBlock manager object +</dd> +</dl><a NAME="AdBlockMatcher.adBlockDisabledForUrl" ID="AdBlockMatcher.adBlockDisabledForUrl"></a> +<h4>AdBlockMatcher.adBlockDisabledForUrl</h4> +<b>adBlockDisabledForUrl</b>(<i>url</i>) +<p> + Public method to check, if AdBlock is disabled for the given URL. +</p><dl> +<dt><i>url</i> (QUrl)</dt> +<dd> +URL to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating disabled state +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockMatcher.clear" ID="AdBlockMatcher.clear"></a> +<h4>AdBlockMatcher.clear</h4> +<b>clear</b>(<i></i>) +<p> + Public slot to clear the internal structures. +</p><a NAME="AdBlockMatcher.elemHideDisabledForUrl" ID="AdBlockMatcher.elemHideDisabledForUrl"></a> +<h4>AdBlockMatcher.elemHideDisabledForUrl</h4> +<b>elemHideDisabledForUrl</b>(<i>url</i>) +<p> + Public method to check, if element hiding is disabled for the given + URL. +</p><dl> +<dt><i>url</i> (QUrl)</dt> +<dd> +URL to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating disabled state +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockMatcher.elementHidingRules" ID="AdBlockMatcher.elementHidingRules"></a> +<h4>AdBlockMatcher.elementHidingRules</h4> +<b>elementHidingRules</b>(<i></i>) +<p> + Public method to get the element hiding rules. +</p><dl> +<dt>Returns:</dt> +<dd> +element hiding rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl><a NAME="AdBlockMatcher.elementHidingRulesForDomain" ID="AdBlockMatcher.elementHidingRulesForDomain"></a> +<h4>AdBlockMatcher.elementHidingRulesForDomain</h4> +<b>elementHidingRulesForDomain</b>(<i>domain</i>) +<p> + Public method to get the element hiding rules for the given domain. +</p><dl> +<dt><i>domain</i> (str)</dt> +<dd> +domain name +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +element hiding rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl><a NAME="AdBlockMatcher.match" ID="AdBlockMatcher.match"></a> +<h4>AdBlockMatcher.match</h4> +<b>match</b>(<i>request, urlDomain, urlString</i>) +<p> + Public method to match a request. +</p><dl> +<dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +URL request to be matched +</dd><dt><i>urlDomain</i> (str)</dt> +<dd> +domain of the URL +</dd><dt><i>urlString</i> (str)</dt> +<dd> +requested URL as a lowercase string +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +reference to the matched rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule +</dd> +</dl><a NAME="AdBlockMatcher.update" ID="AdBlockMatcher.update"></a> +<h4>AdBlockMatcher.update</h4> +<b>update</b>(<i></i>) +<p> + Public slot to update the internal state. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockRule.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockRule.html Mon Dec 18 18:09:39 2017 +0100 @@ -32,6 +32,12 @@ <tr> <td><a href="#AdBlockRule">AdBlockRule</a></td> <td>Class implementing the AdBlock rule.</td> +</tr><tr> +<td><a href="#AdBlockRuleOption">AdBlockRuleOption</a></td> +<td>Class implementing the rule option enum.</td> +</tr><tr> +<td><a href="#AdBlockRuleType">AdBlockRuleType</a></td> +<td>Class implementing the rule type enum.</td> </tr> </table> <h3>Functions</h3> @@ -66,21 +72,63 @@ <td><a href="#AdBlockRule.__convertPatternToRegExp">__convertPatternToRegExp</a></td> <td>Private method to convert a wildcard pattern to a regular expression.</td> </tr><tr> +<td><a href="#AdBlockRule.__filterIsOnlyDomain">__filterIsOnlyDomain</a></td> +<td>Private method to check, if the given filter is a domain only filter.</td> +</tr><tr> +<td><a href="#AdBlockRule.__filterIsOnlyEndsMatch">__filterIsOnlyEndsMatch</a></td> +<td>Private method to check, if the given filter is to match against the end of a string.</td> +</tr><tr> +<td><a href="#AdBlockRule.__hasException">__hasException</a></td> +<td>Private method to check, if the given option has been set as an exception.</td> +</tr><tr> +<td><a href="#AdBlockRule.__hasOption">__hasOption</a></td> +<td>Private method to check, if the given option has been set.</td> +</tr><tr> +<td><a href="#AdBlockRule.__isMatchingDomain">__isMatchingDomain</a></td> +<td>Private method to check, if a given domain matches the given filter string.</td> +</tr><tr> +<td><a href="#AdBlockRule.__isMatchingRegExpStrings">__isMatchingRegExpStrings</a></td> +<td>Private method to check the given URL against the fixed parts of the regexp.</td> +</tr><tr> <td><a href="#AdBlockRule.__parseDomains">__parseDomains</a></td> <td>Private method to parse a string with a domain list.</td> </tr><tr> <td><a href="#AdBlockRule.__parseFilter">__parseFilter</a></td> <td>Private method to parse the filter pattern.</td> </tr><tr> +<td><a href="#AdBlockRule.__parseRegExpFilter">__parseRegExpFilter</a></td> +<td>Private method to split the given regular expression into strings that can be used with 'in'.</td> +</tr><tr> +<td><a href="#AdBlockRule.__setException">__setException</a></td> +<td>Private method to set the given option as an exception.</td> +</tr><tr> <td><a href="#AdBlockRule.__stringMatch">__stringMatch</a></td> <td>Private method to match a domain string.</td> </tr><tr> +<td><a href="#AdBlockRule.addBlockedDomains">addBlockedDomains</a></td> +<td>Public method to add to the list of blocked domains.</td> +</tr><tr> +<td><a href="#AdBlockRule.allowedDomains">allowedDomains</a></td> +<td>Public method to get a copy of the list of allowed domains.</td> +</tr><tr> +<td><a href="#AdBlockRule.blockedDomains">blockedDomains</a></td> +<td>Public method to get a copy of the list of blocked domains.</td> +</tr><tr> +<td><a href="#AdBlockRule.caseSensitivity">caseSensitivity</a></td> +<td>Public method to get the case sensitivity.</td> +</tr><tr> +<td><a href="#AdBlockRule.copyFrom">copyFrom</a></td> +<td>Public method to copy another AdBlock rule.</td> +</tr><tr> <td><a href="#AdBlockRule.cssSelector">cssSelector</a></td> <td>Public method to get the CSS selector of the rule.</td> </tr><tr> <td><a href="#AdBlockRule.filter">filter</a></td> <td>Public method to get the rule filter string.</td> </tr><tr> +<td><a href="#AdBlockRule.getRegExpAndMatchers">getRegExpAndMatchers</a></td> +<td>Public method to get the regular expression and associated string matchers.</td> +</tr><tr> <td><a href="#AdBlockRule.isCSSRule">isCSSRule</a></td> <td>Public method to check, if the rule is a CSS rule.</td> </tr><tr> @@ -114,33 +162,57 @@ <td><a href="#AdBlockRule.matchDomain">matchDomain</a></td> <td>Public method to match a domain.</td> </tr><tr> +<td><a href="#AdBlockRule.matchFont">matchFont</a></td> +<td>Public method to match a Font rule.</td> +</tr><tr> <td><a href="#AdBlockRule.matchImage">matchImage</a></td> -<td>Public slot to match an Image rule.</td> +<td>Public method to match an Image rule.</td> +</tr><tr> +<td><a href="#AdBlockRule.matchMedia">matchMedia</a></td> +<td>Public method to match a Media rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchObject">matchObject</a></td> -<td>Public slot to match an object rule.</td> +<td>Public method to match an object rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchObjectSubrequest">matchObjectSubrequest</a></td> -<td>Public slot to match an Object Subrequest rule.</td> +<td>Public method to match an Object Subrequest rule.</td> +</tr><tr> +<td><a href="#AdBlockRule.matchOther">matchOther</a></td> +<td>Public method to match any other rule.</td> +</tr><tr> +<td><a href="#AdBlockRule.matchPing">matchPing</a></td> +<td>Public method to match a Ping rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchScript">matchScript</a></td> -<td>Public slot to match a Script rule.</td> +<td>Public method to match a Script rule.</td> +</tr><tr> +<td><a href="#AdBlockRule.matchString">matchString</a></td> +<td>Public method to get the match string.</td> </tr><tr> <td><a href="#AdBlockRule.matchStyleSheet">matchStyleSheet</a></td> -<td>Public slot to match a StyleSheet rule.</td> +<td>Public method to match a StyleSheet rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchSubdocument">matchSubdocument</a></td> -<td>Public slot to match a sub-document rule.</td> +<td>Public method to match a sub-document rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchThirdParty">matchThirdParty</a></td> -<td>Public slot to match a third-party rule.</td> +<td>Public method to match a third-party rule.</td> </tr><tr> <td><a href="#AdBlockRule.matchXmlHttpRequest">matchXmlHttpRequest</a></td> -<td>Public slot to match a XmlHttpRequest rule.</td> +<td>Public method to match a XmlHttpRequest rule.</td> </tr><tr> <td><a href="#AdBlockRule.networkMatch">networkMatch</a></td> <td>Public method to check the rule for a match.</td> </tr><tr> +<td><a href="#AdBlockRule.ruleExceptions">ruleExceptions</a></td> +<td>Public method to get the rule exceptions.</td> +</tr><tr> +<td><a href="#AdBlockRule.ruleOptions">ruleOptions</a></td> +<td>Public method to get the rule options.</td> +</tr><tr> +<td><a href="#AdBlockRule.ruleType">ruleType</a></td> +<td>Public method to get the rule type.</td> +</tr><tr> <td><a href="#AdBlockRule.setEnabled">setEnabled</a></td> <td>Public method to set the rule's enabled state.</td> </tr><tr> @@ -150,6 +222,12 @@ <td><a href="#AdBlockRule.setFilter">setFilter</a></td> <td>Public method to set the rule filter string.</td> </tr><tr> +<td><a href="#AdBlockRule.setOption">setOption</a></td> +<td>Public method to set the given option.</td> +</tr><tr> +<td><a href="#AdBlockRule.setSubscription">setSubscription</a></td> +<td>Public method to set the subscription this rule belongs to.</td> +</tr><tr> <td><a href="#AdBlockRule.subscription">subscription</a></td> <td>Public method to get the subscription this rule belongs to.</td> </tr><tr> @@ -167,13 +245,12 @@ <p> Constructor </p><dl> -<dt><i>filterRule</i></dt> +<dt><i>filterRule</i> (str)</dt> <dd> -filter string of the rule (string) -</dd><dt><i>subscription</i></dt> +filter string of the rule +</dd><dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> reference to the subscription object - (AdBlockSubscription) </dd> </dl><a NAME="AdBlockRule.__convertPatternToRegExp" ID="AdBlockRule.__convertPatternToRegExp"></a> <h4>AdBlockRule.__convertPatternToRegExp</h4> @@ -181,14 +258,146 @@ <p> Private method to convert a wildcard pattern to a regular expression. </p><dl> -<dt><i>wildcardPattern</i></dt> +<dt><i>wildcardPattern</i> (str)</dt> +<dd> +string containing the wildcard pattern +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +string containing a regular expression +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +string +</dd> +</dl><a NAME="AdBlockRule.__filterIsOnlyDomain" ID="AdBlockRule.__filterIsOnlyDomain"></a> +<h4>AdBlockRule.__filterIsOnlyDomain</h4> +<b>__filterIsOnlyDomain</b>(<i>filterString</i>) +<p> + Private method to check, if the given filter is a domain only filter. +</p><dl> +<dt><i>filterString</i> (str)</dt> +<dd> +filter string to be checked +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a domain only filter +</dd> +</dl><dl> +<dt>Return Type:</dt> <dd> -string containing the wildcard pattern (string) +bool +</dd> +</dl><a NAME="AdBlockRule.__filterIsOnlyEndsMatch" ID="AdBlockRule.__filterIsOnlyEndsMatch"></a> +<h4>AdBlockRule.__filterIsOnlyEndsMatch</h4> +<b>__filterIsOnlyEndsMatch</b>(<i>filterString</i>) +<p> + Private method to check, if the given filter is to match against the + end of a string. +</p><dl> +<dt><i>filterString</i> (str)</dt> +<dd> +filter string to be checked +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a end of string match filter +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.__hasException" ID="AdBlockRule.__hasException"></a> +<h4>AdBlockRule.__hasException</h4> +<b>__hasException</b>(<i>opt</i>) +<p> + Private method to check, if the given option has been set as an + exception. +</p><dl> +<dt><i>opt</i> (AdBlockRuleOption)</dt> +<dd> +option to check for </dd> </dl><dl> <dt>Returns:</dt> <dd> -string containing a regular expression (string) +flag indicating the exception state of the option +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.__hasOption" ID="AdBlockRule.__hasOption"></a> +<h4>AdBlockRule.__hasOption</h4> +<b>__hasOption</b>(<i>opt</i>) +<p> + Private method to check, if the given option has been set. +</p><dl> +<dt><i>opt</i> (AdBlockRuleOption)</dt> +<dd> +option to check for +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating the state of the option +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.__isMatchingDomain" ID="AdBlockRule.__isMatchingDomain"></a> +<h4>AdBlockRule.__isMatchingDomain</h4> +<b>__isMatchingDomain</b>(<i>domain, filterString</i>) +<p> + Private method to check, if a given domain matches the given filter + string. +</p><dl> +<dt><i>domain</i> (str)</dt> +<dd> +domain to be checked +</dd><dt><i>filterString</i> (str)</dt> +<dd> +filter string to check against +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.__isMatchingRegExpStrings" ID="AdBlockRule.__isMatchingRegExpStrings"></a> +<h4>AdBlockRule.__isMatchingRegExpStrings</h4> +<b>__isMatchingRegExpStrings</b>(<i>url</i>) +<p> + Private method to check the given URL against the fixed parts of + the regexp. +</p><dl> +<dt><i>url</i> (str)</dt> +<dd> +URL to be checked +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.__parseDomains" ID="AdBlockRule.__parseDomains"></a> <h4>AdBlockRule.__parseDomains</h4> @@ -196,19 +405,53 @@ <p> Private method to parse a string with a domain list. </p><dl> -<dt><i>domains</i></dt> +<dt><i>domains</i> (str)</dt> <dd> -list of domains (string) -</dd><dt><i>separator</i></dt> +list of domains +</dd><dt><i>separator</i> (str)</dt> <dd> -separator character used by the list (string) +separator character used by the list </dd> </dl><a NAME="AdBlockRule.__parseFilter" ID="AdBlockRule.__parseFilter"></a> <h4>AdBlockRule.__parseFilter</h4> <b>__parseFilter</b>(<i></i>) <p> Private method to parse the filter pattern. -</p><a NAME="AdBlockRule.__stringMatch" ID="AdBlockRule.__stringMatch"></a> +</p><a NAME="AdBlockRule.__parseRegExpFilter" ID="AdBlockRule.__parseRegExpFilter"></a> +<h4>AdBlockRule.__parseRegExpFilter</h4> +<b>__parseRegExpFilter</b>(<i>filterString</i>) +<p> + Private method to split the given regular expression into strings that + can be used with 'in'. +</p><dl> +<dt><i>filterString</i> (str)</dt> +<dd> +regexp filter string to be parsed +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +fixed string parts of the filter +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of str +</dd> +</dl><a NAME="AdBlockRule.__setException" ID="AdBlockRule.__setException"></a> +<h4>AdBlockRule.__setException</h4> +<b>__setException</b>(<i>opt, on</i>) +<p> + Private method to set the given option as an exception. +</p><dl> +<dt><i>opt</i> (AdBlockRuleOption)</dt> +<dd> +option to be set +</dd><dt><i>on</i> (bool)</dt> +<dd> +flag indicating to set or unset the exception +</dd> +</dl><a NAME="AdBlockRule.__stringMatch" ID="AdBlockRule.__stringMatch"></a> <h4>AdBlockRule.__stringMatch</h4> <b>__stringMatch</b>(<i>domain, encodedUrl</i>) <p> @@ -231,6 +474,71 @@ <dd> bool </dd> +</dl><a NAME="AdBlockRule.addBlockedDomains" ID="AdBlockRule.addBlockedDomains"></a> +<h4>AdBlockRule.addBlockedDomains</h4> +<b>addBlockedDomains</b>(<i>domains</i>) +<p> + Public method to add to the list of blocked domains. +</p><dl> +<dt><i>domains</i> (str or list of str)</dt> +<dd> +list of domains to be added +</dd> +</dl><a NAME="AdBlockRule.allowedDomains" ID="AdBlockRule.allowedDomains"></a> +<h4>AdBlockRule.allowedDomains</h4> +<b>allowedDomains</b>(<i></i>) +<p> + Public method to get a copy of the list of allowed domains. +</p><dl> +<dt>Returns:</dt> +<dd> +list of allowed domains +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of str +</dd> +</dl><a NAME="AdBlockRule.blockedDomains" ID="AdBlockRule.blockedDomains"></a> +<h4>AdBlockRule.blockedDomains</h4> +<b>blockedDomains</b>(<i></i>) +<p> + Public method to get a copy of the list of blocked domains. +</p><dl> +<dt>Returns:</dt> +<dd> +list of blocked domains +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of str +</dd> +</dl><a NAME="AdBlockRule.caseSensitivity" ID="AdBlockRule.caseSensitivity"></a> +<h4>AdBlockRule.caseSensitivity</h4> +<b>caseSensitivity</b>(<i></i>) +<p> + Public method to get the case sensitivity. +</p><dl> +<dt>Returns:</dt> +<dd> +case sensitivity +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +Qt.CaseSensitivity +</dd> +</dl><a NAME="AdBlockRule.copyFrom" ID="AdBlockRule.copyFrom"></a> +<h4>AdBlockRule.copyFrom</h4> +<b>copyFrom</b>(<i>other</i>) +<p> + Public method to copy another AdBlock rule. +</p><dl> +<dt><i>other</i> (AdBlockRule)</dt> +<dd> +reference to the AdBlock rule to copy from +</dd> </dl><a NAME="AdBlockRule.cssSelector" ID="AdBlockRule.cssSelector"></a> <h4>AdBlockRule.cssSelector</h4> <b>cssSelector</b>(<i></i>) @@ -239,7 +547,12 @@ </p><dl> <dt>Returns:</dt> <dd> -CSS selector (string) +CSS selector +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockRule.filter" ID="AdBlockRule.filter"></a> <h4>AdBlockRule.filter</h4> @@ -249,7 +562,29 @@ </p><dl> <dt>Returns:</dt> <dd> -rule filter string (string) +rule filter string +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl><a NAME="AdBlockRule.getRegExpAndMatchers" ID="AdBlockRule.getRegExpAndMatchers"></a> +<h4>AdBlockRule.getRegExpAndMatchers</h4> +<b>getRegExpAndMatchers</b>(<i></i>) +<p> + Public method to get the regular expression and associated string + matchers. +</p><dl> +<dt>Returns:</dt> +<dd> +tuple containing the regular expression and the list of + string matchers +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +tuple of (QRegExp, list of str) </dd> </dl><a NAME="AdBlockRule.isCSSRule" ID="AdBlockRule.isCSSRule"></a> <h4>AdBlockRule.isCSSRule</h4> @@ -259,7 +594,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a CSS rule (boolean) +flag indicating a CSS rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isComment" ID="AdBlockRule.isComment"></a> <h4>AdBlockRule.isComment</h4> @@ -269,7 +609,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a comment (boolean) +flag indicating a comment +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isDocument" ID="AdBlockRule.isDocument"></a> <h4>AdBlockRule.isDocument</h4> @@ -279,7 +624,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a document rule (boolean) +flag indicating a document rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isDomainRestricted" ID="AdBlockRule.isDomainRestricted"></a> <h4>AdBlockRule.isDomainRestricted</h4> @@ -289,7 +639,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a domain restriction (boolean) +flag indicating a domain restriction +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isElementHiding" ID="AdBlockRule.isElementHiding"></a> <h4>AdBlockRule.isElementHiding</h4> @@ -299,7 +654,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating an element hiding rule (boolean) +flag indicating an element hiding rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isEnabled" ID="AdBlockRule.isEnabled"></a> <h4>AdBlockRule.isEnabled</h4> @@ -309,7 +669,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating enabled state (boolean) +flag indicating enabled state +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isException" ID="AdBlockRule.isException"></a> <h4>AdBlockRule.isException</h4> @@ -319,7 +684,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating an exception (boolean) +flag indicating an exception +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isHeader" ID="AdBlockRule.isHeader"></a> <h4>AdBlockRule.isHeader</h4> @@ -329,7 +699,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a header (boolean) +flag indicating a header +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isInternalDisabled" ID="AdBlockRule.isInternalDisabled"></a> <h4>AdBlockRule.isInternalDisabled</h4> @@ -339,7 +714,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating an internally disabled rule (boolean) +flag indicating an internally disabled rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.isSlow" ID="AdBlockRule.isSlow"></a> <h4>AdBlockRule.isSlow</h4> @@ -349,7 +729,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating a slow rule (boolean) +flag indicating a slow rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchDomain" ID="AdBlockRule.matchDomain"></a> <h4>AdBlockRule.matchDomain</h4> @@ -357,134 +742,274 @@ <p> Public method to match a domain. </p><dl> -<dt><i>domain</i></dt> +<dt><i>domain</i> (str)</dt> <dd> -domain name to check (string) +domain name to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.matchFont" ID="AdBlockRule.matchFont"></a> +<h4>AdBlockRule.matchFont</h4> +<b>matchFont</b>(<i>req</i>) +<p> + Public method to match a Font rule. +</p><dl> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +request object to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchImage" ID="AdBlockRule.matchImage"></a> <h4>AdBlockRule.matchImage</h4> <b>matchImage</b>(<i>req</i>) <p> - Public slot to match an Image rule. + Public method to match an Image rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.matchMedia" ID="AdBlockRule.matchMedia"></a> +<h4>AdBlockRule.matchMedia</h4> +<b>matchMedia</b>(<i>req</i>) +<p> + Public method to match a Media rule. +</p><dl> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +request object to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchObject" ID="AdBlockRule.matchObject"></a> <h4>AdBlockRule.matchObject</h4> <b>matchObject</b>(<i>req</i>) <p> - Public slot to match an object rule. + Public method to match an object rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchObjectSubrequest" ID="AdBlockRule.matchObjectSubrequest"></a> <h4>AdBlockRule.matchObjectSubrequest</h4> <b>matchObjectSubrequest</b>(<i>req</i>) <p> - Public slot to match an Object Subrequest rule. + Public method to match an Object Subrequest rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +boolean +</dd> +</dl><a NAME="AdBlockRule.matchOther" ID="AdBlockRule.matchOther"></a> +<h4>AdBlockRule.matchOther</h4> +<b>matchOther</b>(<i>req</i>) +<p> + Public method to match any other rule. +</p><dl> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +request object to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.matchPing" ID="AdBlockRule.matchPing"></a> +<h4>AdBlockRule.matchPing</h4> +<b>matchPing</b>(<i>req</i>) +<p> + Public method to match a Ping rule. +</p><dl> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +request object to check +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchScript" ID="AdBlockRule.matchScript"></a> <h4>AdBlockRule.matchScript</h4> <b>matchScript</b>(<i>req</i>) <p> - Public slot to match a Script rule. + Public method to match a Script rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockRule.matchString" ID="AdBlockRule.matchString"></a> +<h4>AdBlockRule.matchString</h4> +<b>matchString</b>(<i></i>) +<p> + Public method to get the match string. +</p><dl> +<dt>Returns:</dt> +<dd> +match string +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockRule.matchStyleSheet" ID="AdBlockRule.matchStyleSheet"></a> <h4>AdBlockRule.matchStyleSheet</h4> <b>matchStyleSheet</b>(<i>req</i>) <p> - Public slot to match a StyleSheet rule. + Public method to match a StyleSheet rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.matchSubdocument" ID="AdBlockRule.matchSubdocument"></a> <h4>AdBlockRule.matchSubdocument</h4> <b>matchSubdocument</b>(<i>req</i>) <p> - Public slot to match a sub-document rule. + Public method to match a sub-document rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +boolean </dd> </dl><a NAME="AdBlockRule.matchThirdParty" ID="AdBlockRule.matchThirdParty"></a> <h4>AdBlockRule.matchThirdParty</h4> <b>matchThirdParty</b>(<i>req</i>) <p> - Public slot to match a third-party rule. + Public method to match a third-party rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +boolean </dd> </dl><a NAME="AdBlockRule.matchXmlHttpRequest" ID="AdBlockRule.matchXmlHttpRequest"></a> <h4>AdBlockRule.matchXmlHttpRequest</h4> <b>matchXmlHttpRequest</b>(<i>req</i>) <p> - Public slot to match a XmlHttpRequest rule. + Public method to match a XmlHttpRequest rule. </p><dl> -<dt><i>req</i></dt> +<dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> <dd> -request object to check (QWebEngineUrlRequestInfo) +request object to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockRule.networkMatch" ID="AdBlockRule.networkMatch"></a> <h4>AdBlockRule.networkMatch</h4> @@ -512,15 +1037,60 @@ <dd> bool </dd> +</dl><a NAME="AdBlockRule.ruleExceptions" ID="AdBlockRule.ruleExceptions"></a> +<h4>AdBlockRule.ruleExceptions</h4> +<b>ruleExceptions</b>(<i></i>) +<p> + Public method to get the rule exceptions. +</p><dl> +<dt>Returns:</dt> +<dd> +rule exceptions +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRuleOption +</dd> +</dl><a NAME="AdBlockRule.ruleOptions" ID="AdBlockRule.ruleOptions"></a> +<h4>AdBlockRule.ruleOptions</h4> +<b>ruleOptions</b>(<i></i>) +<p> + Public method to get the rule options. +</p><dl> +<dt>Returns:</dt> +<dd> +rule options +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRuleOption +</dd> +</dl><a NAME="AdBlockRule.ruleType" ID="AdBlockRule.ruleType"></a> +<h4>AdBlockRule.ruleType</h4> +<b>ruleType</b>(<i></i>) +<p> + Public method to get the rule type. +</p><dl> +<dt>Returns:</dt> +<dd> +rule type +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRuleType +</dd> </dl><a NAME="AdBlockRule.setEnabled" ID="AdBlockRule.setEnabled"></a> <h4>AdBlockRule.setEnabled</h4> <b>setEnabled</b>(<i>enabled</i>) <p> Public method to set the rule's enabled state. </p><dl> -<dt><i>enabled</i></dt> +<dt><i>enabled</i> (bool)</dt> <dd> -flag indicating the new enabled state (boolean) +flag indicating the new enabled state </dd> </dl><a NAME="AdBlockRule.setException" ID="AdBlockRule.setException"></a> <h4>AdBlockRule.setException</h4> @@ -528,9 +1098,9 @@ <p> Public method to set the rule's exception flag. </p><dl> -<dt><i>exception</i></dt> +<dt><i>exception</i> (bool)</dt> <dd> -flag indicating an exception rule (boolean) +flag indicating an exception rule </dd> </dl><a NAME="AdBlockRule.setFilter" ID="AdBlockRule.setFilter"></a> <h4>AdBlockRule.setFilter</h4> @@ -538,9 +1108,29 @@ <p> Public method to set the rule filter string. </p><dl> -<dt><i>filterRule</i></dt> +<dt><i>filterRule</i> (str)</dt> +<dd> +rule filter string +</dd> +</dl><a NAME="AdBlockRule.setOption" ID="AdBlockRule.setOption"></a> +<h4>AdBlockRule.setOption</h4> +<b>setOption</b>(<i>opt</i>) +<p> + Public method to set the given option. +</p><dl> +<dt><i>opt</i> (AdBlockRuleOption)</dt> <dd> -rule filter string (string) +option to be set +</dd> +</dl><a NAME="AdBlockRule.setSubscription" ID="AdBlockRule.setSubscription"></a> +<h4>AdBlockRule.setSubscription</h4> +<b>setSubscription</b>(<i>subscription</i>) +<p> + Public method to set the subscription this rule belongs to. +</p><dl> +<dt><i>subscription</i> (AdBlockSubscription)</dt> +<dd> +subscription of the rule </dd> </dl><a NAME="AdBlockRule.subscription" ID="AdBlockRule.subscription"></a> <h4>AdBlockRule.subscription</h4> @@ -550,7 +1140,12 @@ </p><dl> <dt>Returns:</dt> <dd> -subscription of the rule (AdBlockSubscription) +subscription of the rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockSubscription </dd> </dl><a NAME="AdBlockRule.urlMatch" ID="AdBlockRule.urlMatch"></a> <h4>AdBlockRule.urlMatch</h4> @@ -558,32 +1153,94 @@ <p> Public method to check an URL against the rule. </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -URL to check (QUrl) +URL to check </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a match (boolean) +flag indicating a match +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="AdBlockRuleOption" ID="AdBlockRuleOption"></a> +<h2>AdBlockRuleOption</h2> +<p> + Class implementing the rule option enum. +</p> +<h3>Derived from</h3> +IntFlag +<h3>Class Attributes</h3> +<table> +<tr><td>DocumentOption</td></tr><tr><td>DomainRestrictedOption</td></tr><tr><td>ElementHideOption</td></tr><tr><td>FontOption</td></tr><tr><td>ImageOption</td></tr><tr><td>MediaOption</td></tr><tr><td>NoOption</td></tr><tr><td>ObjectOption</td></tr><tr><td>ObjectSubrequestOption</td></tr><tr><td>OtherOption</td></tr><tr><td>PingOption</td></tr><tr><td>ScriptOption</td></tr><tr><td>StyleSheetOption</td></tr><tr><td>SubdocumentOption</td></tr><tr><td>ThirdPartyOption</td></tr><tr><td>XMLHttpRequestOption</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="AdBlockRuleType" ID="AdBlockRuleType"></a> +<h2>AdBlockRuleType</h2> +<p> + Class implementing the rule type enum. +</p> +<h3>Derived from</h3> +IntFlag +<h3>Class Attributes</h3> +<table> +<tr><td>CssRule</td></tr><tr><td>DomainMatchRule</td></tr><tr><td>Invalid</td></tr><tr><td>MatchAllUrlsRule</td></tr><tr><td>RegExpMatchRule</td></tr><tr><td>StringContainsMatchRule</td></tr><tr><td>StringEndsMatchRule</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="toSecondLevelDomain" ID="toSecondLevelDomain"></a> <h2>toSecondLevelDomain</h2> <b>toSecondLevelDomain</b>(<i>url</i>) <p> Module function to get a second level domain from the given URL. </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -URL to extract domain from (QUrl) +URL to extract domain from </dd> </dl><dl> <dt>Returns:</dt> <dd> -name of second level domain (string) +name of second level domain +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockSearchTree.html Mon Dec 18 18:09:39 2017 +0100 @@ -0,0 +1,221 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.WebBrowser.AdBlock.AdBlockSearchTree</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric6.WebBrowser.AdBlock.AdBlockSearchTree</h1> +<p> +Module implementing the AdBlock search tree. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#AdBlockSearchTree">AdBlockSearchTree</a></td> +<td>Class implementing the AdBlock search tree.</td> +</tr><tr> +<td><a href="#AdBlockSearchTreeNode">AdBlockSearchTreeNode</a></td> +<td>Class implementing the AdBlock search tree node.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="AdBlockSearchTree" ID="AdBlockSearchTree"></a> +<h2>AdBlockSearchTree</h2> +<p> + Class implementing the AdBlock search tree. +</p> +<h3>Derived from</h3> +object +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#AdBlockSearchTree.__init__">AdBlockSearchTree</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#AdBlockSearchTree.__deleteNode">__deleteNode</a></td> +<td>Private method to delete a search tree node.</td> +</tr><tr> +<td><a href="#AdBlockSearchTree.__prefixSearch">__prefixSearch</a></td> +<td>Private method to perform a prefix search.</td> +</tr><tr> +<td><a href="#AdBlockSearchTree.add">add</a></td> +<td>Public method to add a rule to the search tree.</td> +</tr><tr> +<td><a href="#AdBlockSearchTree.clear">clear</a></td> +<td>Public method to clear the search tree.</td> +</tr><tr> +<td><a href="#AdBlockSearchTree.find">find</a></td> +<td>Public method to find a matching rule.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="AdBlockSearchTree.__init__" ID="AdBlockSearchTree.__init__"></a> +<h4>AdBlockSearchTree (Constructor)</h4> +<b>AdBlockSearchTree</b>(<i></i>) +<p> + Constructor +</p><a NAME="AdBlockSearchTree.__deleteNode" ID="AdBlockSearchTree.__deleteNode"></a> +<h4>AdBlockSearchTree.__deleteNode</h4> +<b>__deleteNode</b>(<i>node</i>) +<p> + Private method to delete a search tree node. +</p><dl> +<dt><i>node</i> (AdBlockSearchTreeNode)</dt> +<dd> +reference to the node to be deleted +</dd> +</dl><a NAME="AdBlockSearchTree.__prefixSearch" ID="AdBlockSearchTree.__prefixSearch"></a> +<h4>AdBlockSearchTree.__prefixSearch</h4> +<b>__prefixSearch</b>(<i>request, domain, urlString, string, length</i>) +<p> + Private method to perform a prefix search. +</p><dl> +<dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +URL request to be matched +</dd><dt><i>domain</i> (str)</dt> +<dd> +domain of the URL +</dd><dt><i>urlString</i> (str)</dt> +<dd> +requested URL as a lowercase string +</dd><dt><i>string</i> (str)</dt> +<dd> +prefix string to search for +</dd><dt><i>length</i> (int)</dt> +<dd> +length to be considered +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +reference to the matched rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule +</dd> +</dl><a NAME="AdBlockSearchTree.add" ID="AdBlockSearchTree.add"></a> +<h4>AdBlockSearchTree.add</h4> +<b>add</b>(<i>rule</i>) +<p> + Public method to add a rule to the search tree. +</p><dl> +<dt><i>rule</i> (AdBlockRule)</dt> +<dd> +rule to be added +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +flag indicating a successful addition +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl><a NAME="AdBlockSearchTree.clear" ID="AdBlockSearchTree.clear"></a> +<h4>AdBlockSearchTree.clear</h4> +<b>clear</b>(<i></i>) +<p> + Public method to clear the search tree. +</p><a NAME="AdBlockSearchTree.find" ID="AdBlockSearchTree.find"></a> +<h4>AdBlockSearchTree.find</h4> +<b>find</b>(<i>request, domain, urlString</i>) +<p> + Public method to find a matching rule. +</p><dl> +<dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> +<dd> +URL request to be matched +</dd><dt><i>domain</i> (str)</dt> +<dd> +domain of the URL +</dd><dt><i>urlString</i> (str)</dt> +<dd> +requested URL as a lowercase string +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +reference to the matched rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="AdBlockSearchTreeNode" ID="AdBlockSearchTreeNode"></a> +<h2>AdBlockSearchTreeNode</h2> +<p> + Class implementing the AdBlock search tree node. +</p> +<h3>Derived from</h3> +object +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#AdBlockSearchTreeNode.__init__">AdBlockSearchTreeNode</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="AdBlockSearchTreeNode.__init__" ID="AdBlockSearchTreeNode.__init__"></a> +<h4>AdBlockSearchTreeNode (Constructor)</h4> +<b>AdBlockSearchTreeNode</b>(<i></i>) +<p> + Constructor +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockSubscription.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockSubscription.html Mon Dec 18 18:09:39 2017 +0100 @@ -54,6 +54,10 @@ </dd><dt>rulesChanged()</dt> <dd> emitted after the subscription's rules have changed +</dd><dt>rulesEnabledChanged()</dt> +<dd> +emitted after a rule enabled state was + changed </dd> </dl> <h3>Derived from</h3> @@ -78,18 +82,12 @@ <td><a href="#AdBlockSubscription.__parseUrl">__parseUrl</a></td> <td>Private method to parse the AdBlock URL for the subscription.</td> </tr><tr> -<td><a href="#AdBlockSubscription.__populateCache">__populateCache</a></td> -<td>Private method to populate the various rule caches.</td> -</tr><tr> <td><a href="#AdBlockSubscription.__rulesDownloaded">__rulesDownloaded</a></td> <td>Private slot to deal with the downloaded rules.</td> </tr><tr> <td><a href="#AdBlockSubscription.__validateCheckSum">__validateCheckSum</a></td> <td>Private method to check the subscription file's checksum.</td> </tr><tr> -<td><a href="#AdBlockSubscription.adBlockDisabledForUrl">adBlockDisabledForUrl</a></td> -<td>Public method to check, if AdBlock is disabled for the given URL.</td> -</tr><tr> <td><a href="#AdBlockSubscription.addRule">addRule</a></td> <td>Public method to add a rule.</td> </tr><tr> @@ -105,15 +103,6 @@ <td><a href="#AdBlockSubscription.checkForUpdate">checkForUpdate</a></td> <td>Public method to check for an update.</td> </tr><tr> -<td><a href="#AdBlockSubscription.elemHideDisabledForUrl">elemHideDisabledForUrl</a></td> -<td>Public method to check, if element hiding is disabled for the given URL.</td> -</tr><tr> -<td><a href="#AdBlockSubscription.elementHidingRules">elementHidingRules</a></td> -<td>Public method to get the element hiding rules.</td> -</tr><tr> -<td><a href="#AdBlockSubscription.elementHidingRulesForDomain">elementHidingRulesForDomain</a></td> -<td>Public method to get the element hiding rules for the given domain.</td> -</tr><tr> <td><a href="#AdBlockSubscription.isEnabled">isEnabled</a></td> <td>Public method to check, if the subscription is enabled.</td> </tr><tr> @@ -123,9 +112,6 @@ <td><a href="#AdBlockSubscription.location">location</a></td> <td>Public method to get the subscription location.</td> </tr><tr> -<td><a href="#AdBlockSubscription.match">match</a></td> -<td>Public method to check the subscription for a matching rule.</td> -</tr><tr> <td><a href="#AdBlockSubscription.removeRule">removeRule</a></td> <td>Public method to remove a rule given the offset.</td> </tr><tr> @@ -200,16 +186,11 @@ <p> Private method to parse the AdBlock URL for the subscription. </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -AdBlock URL for the subscription (QUrl) +AdBlock URL for the subscription </dd> -</dl><a NAME="AdBlockSubscription.__populateCache" ID="AdBlockSubscription.__populateCache"></a> -<h4>AdBlockSubscription.__populateCache</h4> -<b>__populateCache</b>(<i></i>) -<p> - Private method to populate the various rule caches. -</p><a NAME="AdBlockSubscription.__rulesDownloaded" ID="AdBlockSubscription.__rulesDownloaded"></a> +</dl><a NAME="AdBlockSubscription.__rulesDownloaded" ID="AdBlockSubscription.__rulesDownloaded"></a> <h4>AdBlockSubscription.__rulesDownloaded</h4> <b>__rulesDownloaded</b>(<i></i>) <p> @@ -220,32 +201,22 @@ <p> Private method to check the subscription file's checksum. </p><dl> -<dt><i>fileName</i></dt> +<dt><i>fileName</i> (str)</dt> <dd> -name of the file containing the subscription (string) +name of the file containing the subscription </dd> </dl><dl> <dt>Returns:</dt> <dd> -flag indicating a valid file (boolean). A file is considered +flag indicating a valid file. A file is considered valid, if the checksum is OK, the file does not contain a checksum (i.e. cannot be checked) or we are using the limited EasyList (because we fiddled with the original). </dd> -</dl><a NAME="AdBlockSubscription.adBlockDisabledForUrl" ID="AdBlockSubscription.adBlockDisabledForUrl"></a> -<h4>AdBlockSubscription.adBlockDisabledForUrl</h4> -<b>adBlockDisabledForUrl</b>(<i>url</i>) -<p> - Public method to check, if AdBlock is disabled for the given URL. -</p><dl> -<dt><i>url</i></dt> +</dl><dl> +<dt>Return Type:</dt> <dd> -URL to check (QUrl) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating disabled state (boolean) +bool </dd> </dl><a NAME="AdBlockSubscription.addRule" ID="AdBlockSubscription.addRule"></a> <h4>AdBlockSubscription.addRule</h4> @@ -253,14 +224,19 @@ <p> Public method to add a rule. </p><dl> -<dt><i>rule</i></dt> +<dt><i>rule</i> (AdBlockRule)</dt> <dd> -reference to the rule to add (AdBlockRule) +reference to the rule to add </dd> </dl><dl> <dt>Returns:</dt> <dd> -offset of the rule (integer) +offset of the rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +int </dd> </dl><a NAME="AdBlockSubscription.allRules" ID="AdBlockSubscription.allRules"></a> <h4>AdBlockSubscription.allRules</h4> @@ -270,7 +246,12 @@ </p><dl> <dt>Returns:</dt> <dd> -list of rules (list of AdBlockRule) +list of rules +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +list of AdBlockRule </dd> </dl><a NAME="AdBlockSubscription.canBeRemoved" ID="AdBlockSubscription.canBeRemoved"></a> <h4>AdBlockSubscription.canBeRemoved</h4> @@ -280,7 +261,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating removal is allowed (boolean) +flag indicating removal is allowed +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockSubscription.canEditRules" ID="AdBlockSubscription.canEditRules"></a> <h4>AdBlockSubscription.canEditRules</h4> @@ -290,55 +276,19 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating rules may be edited (boolean) +flag indicating rules may be edited +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockSubscription.checkForUpdate" ID="AdBlockSubscription.checkForUpdate"></a> <h4>AdBlockSubscription.checkForUpdate</h4> <b>checkForUpdate</b>(<i></i>) <p> Public method to check for an update. -</p><a NAME="AdBlockSubscription.elemHideDisabledForUrl" ID="AdBlockSubscription.elemHideDisabledForUrl"></a> -<h4>AdBlockSubscription.elemHideDisabledForUrl</h4> -<b>elemHideDisabledForUrl</b>(<i>url</i>) -<p> - Public method to check, if element hiding is disabled for the given - URL. -</p><dl> -<dt><i>url</i></dt> -<dd> -URL to check (QUrl) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating disabled state (boolean) -</dd> -</dl><a NAME="AdBlockSubscription.elementHidingRules" ID="AdBlockSubscription.elementHidingRules"></a> -<h4>AdBlockSubscription.elementHidingRules</h4> -<b>elementHidingRules</b>(<i></i>) -<p> - Public method to get the element hiding rules. -</p><dl> -<dt>Returns:</dt> -<dd> -element hiding rules (string) -</dd> -</dl><a NAME="AdBlockSubscription.elementHidingRulesForDomain" ID="AdBlockSubscription.elementHidingRulesForDomain"></a> -<h4>AdBlockSubscription.elementHidingRulesForDomain</h4> -<b>elementHidingRulesForDomain</b>(<i>domain</i>) -<p> - Public method to get the element hiding rules for the given domain. -</p><dl> -<dt><i>domain</i></dt> -<dd> -domain name (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -element hiding rules (string) -</dd> -</dl><a NAME="AdBlockSubscription.isEnabled" ID="AdBlockSubscription.isEnabled"></a> +</p><a NAME="AdBlockSubscription.isEnabled" ID="AdBlockSubscription.isEnabled"></a> <h4>AdBlockSubscription.isEnabled</h4> <b>isEnabled</b>(<i></i>) <p> @@ -346,7 +296,12 @@ </p><dl> <dt>Returns:</dt> <dd> -flag indicating the enabled status (boolean) +flag indicating the enabled status +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl><a NAME="AdBlockSubscription.lastUpdate" ID="AdBlockSubscription.lastUpdate"></a> <h4>AdBlockSubscription.lastUpdate</h4> @@ -356,7 +311,12 @@ </p><dl> <dt>Returns:</dt> <dd> -date and time of the last update (QDateTime) +date and time of the last update +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +QDateTime </dd> </dl><a NAME="AdBlockSubscription.location" ID="AdBlockSubscription.location"></a> <h4>AdBlockSubscription.location</h4> @@ -366,28 +326,12 @@ </p><dl> <dt>Returns:</dt> <dd> -URL of the subscription location (QUrl) -</dd> -</dl><a NAME="AdBlockSubscription.match" ID="AdBlockSubscription.match"></a> -<h4>AdBlockSubscription.match</h4> -<b>match</b>(<i>req, urlDomain, urlString</i>) -<p> - Public method to check the subscription for a matching rule. -</p><dl> -<dt><i>req</i></dt> -<dd> -reference to the network request (QWebEngineUrlRequestInfo) -</dd><dt><i>urlDomain</i></dt> -<dd> -domain of the URL (string) -</dd><dt><i>urlString</i></dt> -<dd> -URL (string) +URL of the subscription location </dd> </dl><dl> -<dt>Returns:</dt> +<dt>Return Type:</dt> <dd> -reference to the rule object or None (AdBlockRule) +QUrl </dd> </dl><a NAME="AdBlockSubscription.removeRule" ID="AdBlockSubscription.removeRule"></a> <h4>AdBlockSubscription.removeRule</h4> @@ -395,9 +339,9 @@ <p> Public method to remove a rule given the offset. </p><dl> -<dt><i>offset</i></dt> +<dt><i>offset</i> (int)</dt> <dd> -offset of the rule to remove (integer) +offset of the rule to remove </dd> </dl><a NAME="AdBlockSubscription.replaceRule" ID="AdBlockSubscription.replaceRule"></a> <h4>AdBlockSubscription.replaceRule</h4> @@ -405,17 +349,22 @@ <p> Public method to replace a rule given the offset. </p><dl> -<dt><i>rule</i></dt> +<dt><i>rule</i> (AdBlockRule)</dt> <dd> -reference to the rule to set (AdBlockRule) -</dd><dt><i>offset</i></dt> +reference to the rule to set +</dd><dt><i>offset</i> (int)</dt> <dd> -offset of the rule to remove (integer) +offset of the rule to remove </dd> </dl><dl> <dt>Returns:</dt> <dd> -requested rule (AdBlockRule) +requested rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule </dd> </dl><a NAME="AdBlockSubscription.requiresLocation" ID="AdBlockSubscription.requiresLocation"></a> <h4>AdBlockSubscription.requiresLocation</h4> @@ -425,7 +374,12 @@ </p><dl> <dt>Returns:</dt> <dd> -location of a required subscription (string) +location of a required subscription +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockSubscription.rule" ID="AdBlockSubscription.rule"></a> <h4>AdBlockSubscription.rule</h4> @@ -433,14 +387,19 @@ <p> Public method to get a specific rule. </p><dl> -<dt><i>offset</i></dt> +<dt><i>offset</i> (int)</dt> <dd> -offset of the rule (integer) +offset of the rule </dd> </dl><dl> <dt>Returns:</dt> <dd> -requested rule (AdBlockRule) +requested rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule </dd> </dl><a NAME="AdBlockSubscription.rulesFileName" ID="AdBlockSubscription.rulesFileName"></a> <h4>AdBlockSubscription.rulesFileName</h4> @@ -450,7 +409,12 @@ </p><dl> <dt>Returns:</dt> <dd> -name of the rules file (string) +name of the rules file +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str </dd> </dl><a NAME="AdBlockSubscription.saveRules" ID="AdBlockSubscription.saveRules"></a> <h4>AdBlockSubscription.saveRules</h4> @@ -463,9 +427,9 @@ <p> Public method to set the enabled status. </p><dl> -<dt><i>enabled</i></dt> +<dt><i>enabled</i> (bool)</dt> <dd> -flag indicating the enabled status (boolean) +flag indicating the enabled status </dd> </dl><a NAME="AdBlockSubscription.setLocation" ID="AdBlockSubscription.setLocation"></a> <h4>AdBlockSubscription.setLocation</h4> @@ -473,9 +437,9 @@ <p> Public method to set the subscription location. </p><dl> -<dt><i>url</i></dt> +<dt><i>url</i> (QUrl)</dt> <dd> -URL of the subscription location (QUrl) +URL of the subscription location </dd> </dl><a NAME="AdBlockSubscription.setRuleEnabled" ID="AdBlockSubscription.setRuleEnabled"></a> <h4>AdBlockSubscription.setRuleEnabled</h4> @@ -483,17 +447,22 @@ <p> Public method to enable a specific rule. </p><dl> -<dt><i>offset</i></dt> +<dt><i>offset</i> (int)</dt> <dd> -offset of the rule (integer) -</dd><dt><i>enabled</i></dt> +offset of the rule +</dd><dt><i>enabled</i> (bool)</dt> <dd> -new enabled state (boolean) +new enabled state </dd> </dl><dl> <dt>Returns:</dt> <dd> -reference to the changed rule (AdBlockRule) +reference to the changed rule +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockRule </dd> </dl><a NAME="AdBlockSubscription.setTitle" ID="AdBlockSubscription.setTitle"></a> <h4>AdBlockSubscription.setTitle</h4> @@ -501,9 +470,9 @@ <p> Public method to set the subscription title. </p><dl> -<dt><i>title</i></dt> +<dt><i>title</i> (str)</dt> <dd> -subscription title (string) +subscription title </dd> </dl><a NAME="AdBlockSubscription.title" ID="AdBlockSubscription.title"></a> <h4>AdBlockSubscription.title</h4> @@ -513,7 +482,12 @@ </p><dl> <dt>Returns:</dt> <dd> -subscription title (string) +subscription title +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +string </dd> </dl><a NAME="AdBlockSubscription.updateNow" ID="AdBlockSubscription.updateNow"></a> <h4>AdBlockSubscription.updateNow</h4> @@ -528,7 +502,12 @@ </p><dl> <dt>Returns:</dt> <dd> -AdBlock URL for the subscription (QUrl) +AdBlock URL for the subscription +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +QUrl </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockTreeWidget.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/eric6.WebBrowser.AdBlock.AdBlockTreeWidget.html Mon Dec 18 18:09:39 2017 +0100 @@ -104,12 +104,12 @@ <p> Constructor </p><dl> -<dt><i>subscription</i></dt> +<dt><i>subscription</i> (AdBlockSubscription)</dt> <dd> -reference to the subscription (AdBlockSubscription) -</dd><dt><i>parent</i></dt> +reference to the subscription +</dd><dt><i>parent</i> (QWidget)</dt> <dd> -reference to the parent widget (QWidget) +reference to the parent widget </dd> </dl><a NAME="AdBlockTreeWidget.__adjustItemFeatures" ID="AdBlockTreeWidget.__adjustItemFeatures"></a> <h4>AdBlockTreeWidget.__adjustItemFeatures</h4> @@ -117,12 +117,12 @@ <p> Private method to adjust an item. </p><dl> -<dt><i>itm</i></dt> +<dt><i>itm</i> (QTreeWidgetItem)</dt> <dd> -item to be adjusted (QTreeWidgetItem) -</dd><dt><i>rule</i></dt> +item to be adjusted +</dd><dt><i>rule</i> (AdBlockRule)</dt> <dd> -rule for the adjustment (AdBlockRule) +rule for the adjustment </dd> </dl><a NAME="AdBlockTreeWidget.__contextMenuRequested" ID="AdBlockTreeWidget.__contextMenuRequested"></a> <h4>AdBlockTreeWidget.__contextMenuRequested</h4> @@ -130,9 +130,9 @@ <p> Private slot to show the context menu. </p><dl> -<dt><i>pos</i></dt> +<dt><i>pos</i> (QPoint)</dt> <dd> -position for the menu (QPoint) +position for the menu </dd> </dl><a NAME="AdBlockTreeWidget.__copyFilter" ID="AdBlockTreeWidget.__copyFilter"></a> <h4>AdBlockTreeWidget.__copyFilter</h4> @@ -145,9 +145,9 @@ <p> Private slot to handle the change of an item. </p><dl> -<dt><i>itm</i></dt> +<dt><i>itm</i> (QTreeWidgetItem)</dt> <dd> -changed item (QTreeWidgetItem) +changed item </dd> </dl><a NAME="AdBlockTreeWidget.__subscriptionChanged" ID="AdBlockTreeWidget.__subscriptionChanged"></a> <h4>AdBlockTreeWidget.__subscriptionChanged</h4> @@ -160,9 +160,9 @@ <p> Public slot to add a new rule. </p><dl> -<dt><i>filterRule</i></dt> +<dt><i>filterRule</i> (str)</dt> <dd> -filter to be added (string) +filter to be added </dd> </dl><a NAME="AdBlockTreeWidget.keyPressEvent" ID="AdBlockTreeWidget.keyPressEvent"></a> <h4>AdBlockTreeWidget.keyPressEvent</h4> @@ -170,9 +170,9 @@ <p> Protected method handling key presses. </p><dl> -<dt><i>evt</i></dt> +<dt><i>evt</i> (QKeyEvent)</dt> <dd> -key press event (QKeyEvent) +key press event </dd> </dl><a NAME="AdBlockTreeWidget.refresh" ID="AdBlockTreeWidget.refresh"></a> <h4>AdBlockTreeWidget.refresh</h4> @@ -190,9 +190,9 @@ <p> Public method to highlight the given rule. </p><dl> -<dt><i>rule</i></dt> +<dt><i>rule</i> (AdBlockRule)</dt> <dd> -AdBlock rule to be shown (AdBlockRule) +AdBlock rule to be shown </dd> </dl><a NAME="AdBlockTreeWidget.subscription" ID="AdBlockTreeWidget.subscription"></a> <h4>AdBlockTreeWidget.subscription</h4> @@ -202,7 +202,12 @@ </p><dl> <dt>Returns:</dt> <dd> -reference to the subscription (AdBlockSubscription) +reference to the subscription +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +AdBlockSubscription </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/index-eric6.WebBrowser.AdBlock.html Thu Dec 14 19:25:34 2017 +0100 +++ b/Documentation/Source/index-eric6.WebBrowser.AdBlock.html Mon Dec 18 18:09:39 2017 +0100 @@ -40,12 +40,18 @@ <td><a href="eric6.WebBrowser.AdBlock.AdBlockManager.html">AdBlockManager</a></td> <td>Module implementing the AdBlock manager.</td> </tr><tr> +<td><a href="eric6.WebBrowser.AdBlock.AdBlockMatcher.html">AdBlockMatcher</a></td> +<td>Module implementing the AdBlock matcher.</td> +</tr><tr> <td><a href="eric6.WebBrowser.AdBlock.AdBlockPage.html">AdBlockPage</a></td> <td>Module implementing a class to apply AdBlock rules to a web page.</td> </tr><tr> <td><a href="eric6.WebBrowser.AdBlock.AdBlockRule.html">AdBlockRule</a></td> <td>Module implementing the AdBlock rule class.</td> </tr><tr> +<td><a href="eric6.WebBrowser.AdBlock.AdBlockSearchTree.html">AdBlockSearchTree</a></td> +<td>Module implementing the AdBlock search tree.</td> +</tr><tr> <td><a href="eric6.WebBrowser.AdBlock.AdBlockSubscription.html">AdBlockSubscription</a></td> <td>Module implementing the AdBlock subscription class.</td> </tr><tr>
--- a/WebBrowser/AdBlock/AdBlockDialog.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockDialog.py Mon Dec 18 18:09:39 2017 +0100 @@ -28,8 +28,10 @@ """ Constructor - @param manager reference to the AdBlock manager (AdBlockManager) - @param parent reference to the parent object (QWidget) + @param manager reference to the AdBlock manager + @type AdBlockManager + @param parent reference to the parent object + @type QWidget """ super(AdBlockDialog, self).__init__(parent) self.setupUi(self) @@ -49,6 +51,7 @@ self.adBlockGroup.setChecked(self.__manager.isEnabled()) self.__manager.requiredSubscriptionLoaded.connect(self.addSubscription) + self.__manager.enabledChanged.connect(self.__managerEnabledChanged) self.__currentTreeWidget = None self.__currentSubscription = None @@ -99,8 +102,10 @@ Public slot adding a subscription to the list. @param subscription reference to the subscription to be - added (AdBlockSubscription) - @param refresh flag indicating to refresh the tree (boolean) + added + @type AdBlockSubscription + @param refresh flag indicating to refresh the tree + @type bool """ from .AdBlockTreeWidget import AdBlockTreeWidget tree = AdBlockTreeWidget(subscription, self.subscriptionsTabWidget) @@ -159,7 +164,8 @@ """ Public slot to add a custom AdBlock rule. - @param filterRule filter to be added (string) + @param filterRule filter to be added + @type string """ self.subscriptionsTabWidget.setCurrentIndex( self.subscriptionsTabWidget.count() - 1) @@ -256,8 +262,9 @@ Private slot to set the enabled state of a subscription. @param subscription subscription to set the state for - (AdBlockSubscription) - @param enable state to set to (boolean) + @type AdBlockSubscription + @param enable state to set to + @type bool """ if enable: # enable required one as well @@ -284,7 +291,8 @@ """ Private slot to handle changes of the update period. - @param value update period (integer) + @param value update period + @type int """ if value != Preferences.getWebBrowser("AdBlockUpdatePeriod"): Preferences.setWebBrowser("AdBlockUpdatePeriod", value) @@ -299,7 +307,8 @@ """ Private slot handling the selection of another tab. - @param index index of the new current tab (integer) + @param index index of the new current tab + @type int """ if index != -1: self.__currentTreeWidget = \ @@ -317,7 +326,8 @@ """ Private slot to set a new filter on the current widget. - @param filterRule filter to be set (string) + @param filterRule filter to be set + @type str """ if self.__currentTreeWidget and self.adBlockGroup.isChecked(): self.__currentTreeWidget.filterString(filterRule) @@ -327,7 +337,8 @@ """ Private slot handling the enabling/disabling of AdBlock. - @param state state of the toggle (boolean) + @param state state of the toggle + @type bool """ self.__manager.setEnabled(state) @@ -344,3 +355,13 @@ """ self.__manager.setUseLimitedEasyList( self.useLimitedEasyListCheckBox.isChecked()) + + @pyqtSlot(bool) + def __managerEnabledChanged(self, enabled): + """ + Private slot handling a change of the AdBlock manager enabled state. + + @param enabled flag indicating the enabled state + @type bool + """ + self.adBlockGroup.setChecked(enabled)
--- a/WebBrowser/AdBlock/AdBlockExceptionsDialog.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockExceptionsDialog.py Mon Dec 18 18:09:39 2017 +0100 @@ -25,7 +25,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ super(AdBlockExceptionsDialog, self).__init__(parent) self.setupUi(self) @@ -43,6 +44,7 @@ Public slot to load the list of excepted hosts. @param hosts list of excepted hosts + @type list of str """ self.hostList.clear() self.hostList.addItems(hosts) @@ -52,7 +54,8 @@ """ Private slot to handle changes of the host edit. - @param txt text of the edit (string) + @param txt text of the edit + @type str """ self.addButton.setEnabled(bool(txt))
--- a/WebBrowser/AdBlock/AdBlockIcon.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockIcon.py Mon Dec 18 18:09:39 2017 +0100 @@ -25,7 +25,8 @@ """ Constructor - @param parent reference to the parent widget (HelpWindow) + @param parent reference to the parent widget + @type WebBrowserWindow """ super(AdBlockIcon, self).__init__(parent) @@ -44,7 +45,8 @@ """ Public slot to set the enabled state. - @param enabled enabled state (boolean) + @param enabled enabled state + @type bool """ self.__enabled = enabled if enabled: @@ -57,7 +59,8 @@ """ Private slot to create the context menu. - @param menu parent menu (QMenu) + @param menu parent menu + @type QMenu """ if menu is None: menu = self.sender() @@ -102,7 +105,8 @@ """ Public method to get a reference to the menu action. - @return reference to the menu action (QAction) + @return reference to the menu action + @rtype QAction """ if not self.__menuAction: self.__menuAction = QAction(self.tr("AdBlock"), self) @@ -122,7 +126,8 @@ """ Private slot to show the context menu. - @param pos position the context menu should be shown (QPoint) + @param pos position the context menu should be shown + @type QPoint """ menu = QMenu() self.__createMenu(menu) @@ -141,7 +146,8 @@ Private method to check, if the host of the current browser is excepted. - @return flag indicating an exception (boolean) + @return flag indicating an exception + @rtype bool """ browser = self.__mw.currentBrowser() if browser is None: @@ -181,8 +187,10 @@ """ Public slot to handle URL changes. - @param browser reference to the browser (HelpBrowser) - @param url new URL (QUrl) + @param browser reference to the browser + @type WebBrowserView + @param url new URL + @type QUrl """ if browser == self.__mw.currentBrowser(): self.currentChanged()
--- a/WebBrowser/AdBlock/AdBlockManager.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockManager.py Mon Dec 18 18:09:39 2017 +0100 @@ -12,13 +12,14 @@ import os from PyQt5.QtCore import pyqtSignal, QObject, QUrl, QUrlQuery, QFile, \ - QByteArray + QByteArray, QMutex, QMutexLocker from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo from E5Gui import E5MessageBox from .AdBlockSubscription import AdBlockSubscription from .AdBlockUrlInterceptor import AdBlockUrlInterceptor +from .AdBlockMatcher import AdBlockMatcher from Utilities.AutoSaver import AutoSaver import Utilities @@ -32,15 +33,19 @@ @signal rulesChanged() emitted after some rule has changed @signal requiredSubscriptionLoaded(subscription) emitted to indicate loading of a required subscription is finished (AdBlockSubscription) + @signal enabledChanged(enabled) emitted to indicate a change of the + enabled state """ rulesChanged = pyqtSignal() requiredSubscriptionLoaded = pyqtSignal(AdBlockSubscription) + enabledChanged = pyqtSignal(bool) def __init__(self, parent=None): """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super(AdBlockManager, self).__init__(parent) @@ -64,6 +69,9 @@ self.__customSubscriptionUrlString = \ bytes(self.__customSubscriptionUrl().toEncoded()).decode() + self.__mutex = QMutex() + self.__matcher = AdBlockMatcher(self) + self.rulesChanged.connect(self.__saveTimer.changeOccurred) self.rulesChanged.connect(self.__rulesChanged) @@ -79,6 +87,7 @@ """ from WebBrowser.WebBrowserWindow import WebBrowserWindow WebBrowserWindow.mainWindow().reloadUserStyleSheet() + self.__updateMatcher() def close(self): """ @@ -94,7 +103,8 @@ """ Public method to check, if blocking ads is enabled. - @return flag indicating the enabled state (boolean) + @return flag indicating the enabled state + @rtype bool """ if not self.__loaded: self.load() @@ -105,7 +115,8 @@ """ Public slot to set the enabled state. - @param enabled flag indicating the enabled state (boolean) + @param enabled flag indicating the enabled state + @type bool """ if self.isEnabled() == enabled: return @@ -116,60 +127,59 @@ mainWindow.adBlockIcon().setEnabled(enabled) if enabled: self.__loadSubscriptions() + self.rulesChanged.emit() + self.enabledChanged.emit(enabled) def block(self, info): """ Public method to check, if a request should be blocked. - @param info request info aobject + @param info request info object @type QWebEngineUrlRequestInfo @return flag indicating to block the request @rtype bool """ + locker = QMutexLocker(self.__mutex) # __IGNORE_WARNING__ + + if not self.isEnabled(): + return False + urlString = bytes(info.requestUrl().toEncoded()).decode().lower() urlDomain = info.requestUrl().host().lower() urlScheme = info.requestUrl().scheme().lower() - refererHost = info.firstPartyUrl().host().lower() - if not self.isEnabled() or not self.__canRunOnScheme(urlScheme): + if not self.canRunOnScheme(urlScheme) or \ + not self.__canBeBlocked(info.firstPartyUrl()): return False - if self.isHostExcepted(urlDomain) or self.isHostExcepted(refererHost): - return False - res = False + blockedRule = self.__matcher.match(info, urlDomain, urlString) - for subscription in self.subscriptions(): - if subscription.isEnabled(): - if subscription.adBlockDisabledForUrl(info.requestUrl()): - continue - - blockedRule = subscription.match(info, urlDomain, urlString) - if blockedRule: - res = True - if info.resourceType() == \ - QWebEngineUrlRequestInfo.ResourceTypeMainFrame: - url = QUrl("eric:adblock") - query = QUrlQuery() - query.addQueryItem("rule", blockedRule.filter()) - query.addQueryItem( - "subscription", blockedRule.subscription().title()) - url.setQuery(query) - info.redirect(url) - res = False - else: - info.block(True) - break + if blockedRule: + res = True + if info.resourceType() == \ + QWebEngineUrlRequestInfo.ResourceTypeMainFrame: + url = QUrl("eric:adblock") + query = QUrlQuery() + query.addQueryItem("rule", blockedRule.filter()) + query.addQueryItem( + "subscription", blockedRule.subscription().title()) + url.setQuery(query) + info.redirect(url) + else: + info.block(True) return res - def __canRunOnScheme(self, scheme): + def canRunOnScheme(self, scheme): """ - Private method to check, if AdBlock can be performed on the scheme. + Public method to check, if AdBlock can be performed on the scheme. - @param scheme scheme to check (string) - @return flag indicating, that AdBlock can be performed (boolean) + @param scheme scheme to check + @type str + @return flag indicating, that AdBlock can be performed + @rtype bool """ return scheme not in ["data", "eric", "qthelp", "qrc", "file", "abp"] @@ -177,7 +187,8 @@ """ Public method to get a reference to the page block object. - @return reference to the page block object (AdBlockPage) + @return reference to the page block object + @rtype AdBlockPage """ if self.__adBlockPage is None: from .AdBlockPage import AdBlockPage @@ -188,7 +199,8 @@ """ Private method to generate the path for custom subscriptions. - @return URL for custom subscriptions (QUrl) + @return URL for custom subscriptions + @rtype QUrl """ dataDir = os.path.join(Utilities.getConfigDir(), "web_browser", "subscriptions") @@ -201,7 +213,8 @@ """ Private method to generate the URL for custom subscriptions. - @return URL for custom subscriptions (QUrl) + @return URL for custom subscriptions + @rtype QUrl """ location = self.__customSubscriptionLocation() encodedUrl = bytes(location.toEncoded()).decode() @@ -213,7 +226,8 @@ """ Public method to get a subscription for custom rules. - @return subscription object for custom rules (AdBlockSubscription) + @return subscription object for custom rules + @rtype AdBlockSubscription """ location = self.__customSubscriptionLocation() for subscription in self.__subscriptions: @@ -229,7 +243,8 @@ """ Public method to get all subscriptions. - @return list of subscriptions (list of AdBlockSubscription) + @return list of subscriptions + @rtype list of AdBlockSubscription """ if not self.__loaded: self.load() @@ -240,8 +255,10 @@ """ Public method to get a subscription based on its location. - @param location location of the subscription to search for (string) - @return subscription or None (AdBlockSubscription) + @param location location of the subscription to search for + @type str + @return subscription or None + @rtype AdBlockSubscription """ if location != "": for subscription in self.__subscriptions: @@ -262,8 +279,9 @@ Public method to remove an AdBlock subscription. @param subscription AdBlock subscription to be removed - (AdBlockSubscription) - @param emitSignal flag indicating to send a signal (boolean) + @type AdBlockSubscription + @param emitSignal flag indicating to send a signal + @type bool """ if subscription is None: return @@ -320,13 +338,15 @@ dlg.addSubscription(subscription, False) dlg.setFocus() dlg.raise_() + + return res def addSubscription(self, subscription): """ Public method to add an AdBlock subscription. @param subscription AdBlock subscription to be added - (AdBlockSubscription) + @type AdBlockSubscription """ if subscription is None: return @@ -410,16 +430,24 @@ adBlockSubscription.rulesChanged.connect(self.rulesChanged) adBlockSubscription.changed.connect(self.rulesChanged) adBlockSubscription.enabledChanged.connect(self.rulesChanged) + adBlockSubscription.rulesEnabledChanged.connect( + self.__updateMatcher) + adBlockSubscription.rulesEnabledChanged.connect( + self.__saveTimer.changeOccurred) self.__subscriptions.append(adBlockSubscription) self.__subscriptionsLoaded = True + + self.__updateMatcher() def loadRequiredSubscription(self, location, title): """ Public method to load a subscription required by another one. - @param location location of the required subscription (string) - @param title title of the required subscription (string) + @param location location of the required subscription + @type str + @param title title of the required subscription + @type str """ # Step 1: check, if the subscription is in the list of subscriptions urlString = "abp:subscribe?location={0}&title={1}".format( @@ -440,9 +468,10 @@ Public method to get a list of subscriptions, that require the given one. - @param subscription subscription to check for (AdBlockSubscription) - @return list of subscription requiring the given one (list of - AdBlockSubscription) + @param subscription subscription to check for + @type AdBlockSubscription + @return list of subscription requiring the given one + @rtype list of AdBlockSubscription """ subscriptions = [] location = subscription.location().toString() @@ -456,7 +485,8 @@ """ Public slot to show the AdBlock subscription management dialog. - @return reference to the dialog (AdBlockDialog) + @return reference to the dialog + @rtype AdBlockDialog """ if self.__adBlockDialog is None: from .AdBlockDialog import AdBlockDialog @@ -470,54 +500,40 @@ Public method to get the element hiding rules. - @param url URL to get hiding rules for (QUrl) - @return element hiding rules (string) + @param url URL to get hiding rules for + @type QUrl + @return element hiding rules + @rtype str """ - if not self.isEnabled() or not self.__canRunOnScheme(url.scheme()): + if not self.isEnabled() or \ + not self.canRunOnScheme(url.scheme()) or \ + not self.__canBeBlocked(url): return "" - rules = "" - - for subscription in self.__subscriptions: - rules += subscription.elementHidingRules() - - if rules: - # remove last ", - rules = rules[:-1] - - return rules + return self.__matcher.elementHidingRules() def elementHidingRulesForDomain(self, url): """ Public method to get the element hiding rules for a domain. - @param url URL to get hiding rules for (QUrl) - @return element hiding rules (string) + @param url URL to get hiding rules for + @type QUrl + @return element hiding rules + @rtype str """ - if not self.isEnabled(): + if not self.isEnabled() or \ + not self.canRunOnScheme(url.scheme()) or \ + not self.__canBeBlocked(url): return "" - rules = "" - - for subscription in self.__subscriptions: - if subscription.elemHideDisabledForUrl(url): - continue - - rules += subscription.elementHidingRulesForDomain(url.host()) - - if rules: - # remove last "," - rules = rules[:-1] - - rules += "{display:none !important;}\n" - - return rules + return self.__matcher.elementHidingRulesForDomain(url.host()) def exceptions(self): """ Public method to get a list of excepted hosts. - @return list of excepted hosts (list of string) + @return list of excepted hosts + @rtype list of str """ return self.__exceptedHosts @@ -525,7 +541,8 @@ """ Public method to set the list of excepted hosts. - @param hosts list of excepted hosts (list of string) + @param hosts list of excepted hosts + @type list of str """ self.__exceptedHosts = [host.lower() for host in hosts] Preferences.setWebBrowser("AdBlockExceptions", self.__exceptedHosts) @@ -534,7 +551,8 @@ """ Public method to add an exception. - @param host to be excepted (string) + @param host to be excepted + @type str """ host = host.lower() if host and host not in self.__exceptedHosts: @@ -546,7 +564,8 @@ """ Public method to remove an exception. - @param host to be removed from the list of exceptions (string) + @param host to be removed from the list of exceptions + @type str """ host = host.lower() if host in self.__exceptedHosts: @@ -558,8 +577,10 @@ """ Public slot to check, if a host is excepted. - @param host host to check (string) - @return flag indicating an exception (boolean) + @param host host to check + @type str + @return flag indicating an exception + @rtype bool """ host = host.lower() return host in self.__exceptedHosts @@ -568,7 +589,8 @@ """ Public method to show the AdBlock Exceptions dialog. - @return reference to the exceptions dialog (AdBlockExceptionsDialog) + @return reference to the exceptions dialog + @rtype AdBlockExceptionsDialog """ if self.__adBlockExceptionsDialog is None: from .AdBlockExceptionsDialog import AdBlockExceptionsDialog @@ -611,3 +633,24 @@ @rtype str """ return self.__defaultSubscriptionUrlString + + def __updateMatcher(self): + """ + Private slot to update the adblock matcher. + """ + if self.__enabled: + self.__matcher.update() + else: + self.__matcher.clear() + + def __canBeBlocked(self, url): + """ + Private method to check, if the given URL could be blocked (i.e. is + not whitelisted). + + @param url URL to be checked + @type QUrl + @return flag indicating that the given URL can be blocked + @rtype bool + """ + return not self.__matcher.adBlockDisabledForUrl(url)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebBrowser/AdBlock/AdBlockMatcher.py Mon Dec 18 18:09:39 2017 +0100 @@ -0,0 +1,235 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing the AdBlock matcher. +""" + +from __future__ import unicode_literals + +from PyQt5.QtCore import QObject + +from .AdBlockSearchTree import AdBlockSearchTree +from .AdBlockRule import AdBlockRule, AdBlockRuleOption + + +class AdBlockMatcher(QObject): + """ + Class implementing the AdBlock matcher. + """ + def __init__(self, manager): + """ + Constructor + + @param manager reference to the AdBlock manager object + @type AdBlockManager + """ + super(AdBlockMatcher, self).__init__(manager) + + self.__manager = manager + + self.__createdRules = [] + self.__networkExceptionRules = [] + self.__networkBlockRules = [] + self.__domainRestrictedCssRules = [] + self.__documentRules = [] + self.__elemhideRules = [] + + self.__elementHidingRules = "" + self.__networkBlockTree = AdBlockSearchTree() + self.__networkExceptionTree = AdBlockSearchTree() + + def match(self, request, urlDomain, urlString): + """ + Public method to match a request. + + @param request URL request to be matched + @type QWebEngineUrlRequestInfo + @param urlDomain domain of the URL + @type str + @param urlString requested URL as a lowercase string + @type str + @return reference to the matched rule + @rtype AdBlockRule + """ + # exception rules + if self.__networkExceptionTree.find(request, urlDomain, urlString): + return None + + for rule in self.__networkExceptionRules: + if rule.networkMatch(request, urlDomain, urlString): + return None + + # block rules + rule = self.__networkBlockTree.find(request, urlDomain, urlString) + if rule: + return rule + + for rule in self.__networkBlockRules: + if rule.networkMatch(request, urlDomain, urlString): + return rule + + return None + + def adBlockDisabledForUrl(self, url): + """ + Public method to check, if AdBlock is disabled for the given URL. + + @param url URL to check + @type QUrl + @return flag indicating disabled state + @rtype bool + """ + for rule in self.__documentRules: + if rule.urlMatch(url): + return True + + return False + + def elemHideDisabledForUrl(self, url): + """ + Public method to check, if element hiding is disabled for the given + URL. + + @param url URL to check + @type QUrl + @return flag indicating disabled state + @rtype bool + """ + if self.adBlockDisabledForUrl(url): + return True + + for rule in self.__elemhideRules: + if rule.urlMatch(url): + return True + + return False + + def elementHidingRules(self): + """ + Public method to get the element hiding rules. + + @return element hiding rules + @rtype str + """ + return self.__elementHidingRules + + def elementHidingRulesForDomain(self, domain): + """ + Public method to get the element hiding rules for the given domain. + + @param domain domain name + @type str + @return element hiding rules + @rtype str + """ + rules = "" + addedRulesCount = 0 + + for rule in self.__domainRestrictedCssRules: + if not rule.matchDomain(domain): + continue + + if addedRulesCount == 1000: + rules += rule.cssSelector() + rules += "{display:none !important;}\n" + addedRulesCount = 0 + else: + rules += rule.cssSelector() + "," + addedRulesCount += 1 + + if addedRulesCount != 0: + rules = rules[:-1] + rules += "{display:none !important;}\n" + + return rules + + def update(self): + """ + Public slot to update the internal state. + """ + self.clear() + + cssRulesDict = {} + exceptionCssRules = [] + + for subscription in self.__manager.subscriptions(): + if subscription.isEnabled(): + for rule in subscription.allRules(): + # Don't add internally disabled rules to the cache + if rule.isInternalDisabled(): + continue + + if rule.isCSSRule(): + # Only enabled CSS rules are added to the cache because + # there is no enabled/disabled check on match. They are + # directly embedded to pages. + if not rule.isEnabled(): + continue + + if rule.isException(): + exceptionCssRules.append(rule) + else: + cssRulesDict[rule.cssSelector()] = rule + elif rule.isDocument(): + self.__documentRules.append(rule) + elif rule.isElementHiding(): + self.__elemhideRules.append(rule) + elif rule.isException(): + if not self.__networkExceptionTree.add(rule): + self.__networkBlockRules.append(rule) + else: + if not self.__networkBlockTree.add(rule): + self.__networkBlockRules.append(rule) + + for rule in exceptionCssRules: + try: + originalRule = cssRulesDict[rule.cssSelector()] + except KeyError: + # If there is no such selector, the exception does nothing. + continue + + copiedRule = AdBlockRule() + copiedRule.copyFrom(originalRule) + copiedRule.setOption(AdBlockRuleOption.DomainRestrictedOption) + copiedRule.addBlockedDomains(rule.allowedDomains()) + + cssRulesDict[rule.cssSelector()] = copiedRule + self.__createdRules.append(copiedRule) + + # Excessive amount of selectors for one CSS rule is not what the + # rendering engine likes. So split them up by 1.000 selectors. + hidingRulesCount = 0 + for key in cssRulesDict: + rule = cssRulesDict[key] + + if rule.isDomainRestricted(): + self.__domainRestrictedCssRules.append(rule) + elif hidingRulesCount == 1000: + self.__elementHidingRules += rule.cssSelector() + self.__elementHidingRules += "{display:none !important;} " + hidingRulesCount = 0 + else: + self.__elementHidingRules += rule.cssSelector() + "," + hidingRulesCount += 1 + + if hidingRulesCount != 0: + self.__elementHidingRules = self.__elementHidingRules[:-1] + self.__elementHidingRules += "{display:none !important;} " + + def clear(self): + """ + Public slot to clear the internal structures. + """ + self.__createdRules = [] + self.__networkExceptionRules = [] + self.__networkBlockRules = [] + self.__domainRestrictedCssRules = [] + self.__documentRules = [] + self.__elemhideRules = [] + + self.__elementHidingRules = "" + self.__networkBlockTree.clear() + self.__networkExceptionTree.clear()
--- a/WebBrowser/AdBlock/AdBlockRule.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockRule.py Mon Dec 18 18:09:39 2017 +0100 @@ -11,6 +11,8 @@ import re +from enum import IntFlag + from PyQt5.QtCore import PYQT_VERSION, Qt, QRegExp from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo @@ -21,8 +23,10 @@ """ Module function to get a second level domain from the given URL. - @param url URL to extract domain from (QUrl) - @return name of second level domain (string) + @param url URL to extract domain from + @type QUrl + @return name of second level domain + @rtype str """ topLevelDomain = url.topLevelDomain() urlHost = url.host() @@ -40,6 +44,43 @@ return domain + topLevelDomain +class AdBlockRuleType(IntFlag): + """ + Class implementing the rule type enum. + """ + CssRule = 0 + DomainMatchRule = 1 + RegExpMatchRule = 2 + StringEndsMatchRule = 3 + StringContainsMatchRule = 4 + MatchAllUrlsRule = 5 + Invalid = 6 + + +class AdBlockRuleOption(IntFlag): + """ + Class implementing the rule option enum. + """ + NoOption = 0 + DomainRestrictedOption = 1 + ThirdPartyOption = 2 + ObjectOption = 4 + SubdocumentOption = 8 + XMLHttpRequestOption = 16 + ImageOption = 32 + ScriptOption = 64 + StyleSheetOption = 128 + ObjectSubrequestOption = 256 + PingOption = 512 + MediaOption = 1024 + FontOption = 2048 + OtherOption = 4096 + + # Exception only options + DocumentOption = 8192 + ElementHideOption = 16384 + + class AdBlockRule(object): """ Class implementing the AdBlock rule. @@ -48,45 +89,27 @@ """ Constructor - @param filterRule filter string of the rule (string) + @param filterRule filter string of the rule + @type str @param subscription reference to the subscription object - (AdBlockSubscription) + @type AdBlockSubscription """ self.__subscription = subscription - self.__regExp = QRegExp() - self.__options = [] + self.__regExp = None + self.__stringMatchers = [] + self.__blockedDomains = [] self.__allowedDomains = [] - self.__enabled = True - self.__cssRule = False - self.__exception = False - self.__internalDisabled = False - self.__domainRestricted = False - self.__useRegExp = False - self.__useDomainMatch = False - self.__useEndsMatch = False - self.__thirdParty = False - self.__thirdPartyException = False - self.__object = False - self.__objectException = False - self.__subdocument = False - self.__subdocumentException = False - self.__xmlhttprequest = False - self.__xmlhttprequestException = False - self.__document = False - self.__elemhide = False + self.__isEnabled = True + self.__isException = False + self.__isInternalDisabled = False self.__caseSensitivity = Qt.CaseInsensitive - self.__image = False - self.__imageException = False - self.__script = False - self.__scriptException = False - self.__stylesheet = False - self.__stylesheetException = False - self.__objectSubrequest = False - self.__objectSubrequestException = False - self.__stringMatchRule = False + + self.__type = AdBlockRuleType.StringContainsMatchRule + self.__options = AdBlockRuleOption.NoOption + self.__exceptions = AdBlockRuleOption.NoOption self.setFilter(filterRule) @@ -94,15 +117,26 @@ """ Public method to get the subscription this rule belongs to. - @return subscription of the rule (AdBlockSubscription) + @return subscription of the rule + @rtype AdBlockSubscription """ return self.__subscription + def setSubscription(self, subscription): + """ + Public method to set the subscription this rule belongs to. + + @param subscription subscription of the rule + @type AdBlockSubscription + """ + self.__subscription = subscription + def filter(self): """ Public method to get the rule filter string. - @return rule filter string (string) + @return rule filter string + @rtype str """ return self.__filter @@ -110,7 +144,8 @@ """ Public method to set the rule filter string. - @param filterRule rule filter string (string) + @param filterRule rule filter string + @type str """ self.__filter = filterRule self.__parseFilter() @@ -122,13 +157,15 @@ parsedLine = self.__filter # empty rule or just a comment - if not parsedLine.strip() or parsedLine.startswith(("!", "[Adblock")): - self.__enabled = False + if not parsedLine.strip() or parsedLine.startswith("!"): + self.__isEnabled = False + self.__isInternalDisabled = True + self.__type = AdBlockRuleType.Invalid return # CSS element hiding rule if "##" in parsedLine or "#@#" in parsedLine: - self.__cssRule = True + self.__type = AdBlockRuleType.CssRule pos = parsedLine.find("#") # domain restricted rule @@ -136,24 +173,26 @@ domains = parsedLine[:pos] self.__parseDomains(domains, ",") - self.__exception = parsedLine[pos + 1] == "@" + self.__isException = parsedLine[pos + 1] == "@" + if self.__isException: + self.__matchString = parsedLine[pos + 3:] + else: + self.__matchString = parsedLine[pos + 2:] - if self.__exception: - self.__cssSelector = parsedLine[pos + 3:] - else: - self.__cssSelector = parsedLine[pos + 2:] # CSS rule cannot have more options -> stop parsing return # Exception always starts with @@ if parsedLine.startswith("@@"): - self.__exception = True + self.__isException = True parsedLine = parsedLine[2:] # Parse all options following '$' character optionsIndex = parsedLine.find("$") if optionsIndex >= 0: - options = parsedLine[optionsIndex + 1:].split(",") + options = [opt + for opt in parsedLine[optionsIndex + 1:].split(",") + if opt] handledOptions = 0 for option in options: @@ -164,47 +203,74 @@ self.__caseSensitivity = Qt.CaseSensitive handledOptions += 1 elif option.endswith("third-party"): - self.__thirdParty = True - self.__thirdPartyException = option.startswith("~") + self.setOption(AdBlockRuleOption.ThirdPartyOption) + self.__setException(AdBlockRuleOption.ThirdPartyOption, + option.startswith("~")) handledOptions += 1 elif option.endswith("object"): - self.__object = True - self.__objectException = option.startswith("~") + self.setOption(AdBlockRuleOption.ObjectOption) + self.__setException(AdBlockRuleOption.ObjectOption, + option.startswith("~")) handledOptions += 1 elif option.endswith("subdocument"): - self.__subdocument = True - self.__subdocumentException = option.startswith("~") + self.setOption(AdBlockRuleOption.SubdocumentOption) + self.__setException(AdBlockRuleOption.SubdocumentOption, + option.startswith("~")) handledOptions += 1 elif option.endswith("xmlhttprequest"): - self.__xmlhttprequest = True - self.__xmlhttprequestException = option.startswith("~") + self.setOption(AdBlockRuleOption.XMLHttpRequestOption) + self.__setException(AdBlockRuleOption.XMLHttpRequestOption, + option.startswith("~")) handledOptions += 1 elif option.endswith("image"): - self.__image = True - self.__imageException = option.startswith("~") + self.setOption(AdBlockRuleOption.ImageOption) + self.__setException(AdBlockRuleOption.ImageOption, + option.startswith("~")) elif option.endswith("script"): - self.__script = True - self.__scriptException = option.startswith("~") + self.setOption(AdBlockRuleOption.ScriptOption) + self.__setException(AdBlockRuleOption.ScriptOption, + option.startswith("~")) elif option.endswith("stylesheet"): - self.__stylesheet = True - self.__stylesheetException = option.startswith("~") + self.setOption(AdBlockRuleOption.StyleSheetOption) + self.__setException(AdBlockRuleOption.StyleSheetOption, + option.startswith("~")) elif option.endswith("object-subrequest"): - self.__objectSubrequest = True - self.__objectSubrequestException = option.startswith("~") - elif option == "document" and self.__exception: - self.__document = True + self.setOption(AdBlockRuleOption.ObjectSubrequestOption) + self.__setException( + AdBlockRuleOption.ObjectSubrequestOption, + option.startswith("~")) + elif option.endswith("ping"): + self.setOption(AdBlockRuleOption.PingOption) + self.__setException(AdBlockRuleOption.PingOption, + option.startswith("~")) + elif option.endswith("media"): + self.setOption(AdBlockRuleOption.MediaOption) + self.__setException(AdBlockRuleOption.MediaOption, + option.startswith("~")) + elif option.endswith("font"): + self.setOption(AdBlockRuleOption.FontOption) + self.__setException(AdBlockRuleOption.FontOption, + option.startswith("~")) + elif option.endswith("other"): + self.setOption(AdBlockRuleOption.OtherOption) + self.__setException(AdBlockRuleOption.OtherOption, + option.startswith("~")) + elif option == "document" and self.__isException: + self.setOption(AdBlockRuleOption.DocumentOption) handledOptions += 1 - elif option == "elemhide" and self.__exception: - self.__elemhide = True + elif option == "elemhide" and self.__isException: + self.setOption(AdBlockRuleOption.ElementHideOption) handledOptions += 1 elif option == "collapse": - # Hiding placeholders of blocked elements + # Hiding placeholders of blocked elements is enabled by + # default handledOptions += 1 # If we don't handle all options, it's safer to just disable # this rule if handledOptions != len(options): - self.__internalDisabled = True + self.__isInternalDisabled = True + self.__type = AdBlockRuleType.Invalid return parsedLine = parsedLine[:optionsIndex] @@ -212,57 +278,66 @@ # Rule is classic regexp if parsedLine.startswith("/") and parsedLine.endswith("/"): parsedLine = parsedLine[1:-1] - self.__useRegExp = True + self.__type = AdBlockRuleType.RegExpMatchRule self.__regExp = QRegExp(parsedLine, self.__caseSensitivity, QRegExp.RegExp) + self.__stringMatchers = self.__parseRegExpFilter(parsedLine) return - # Remove starting / ending wildcards + # Remove starting / ending wildcards (*) if parsedLine.startswith("*"): parsedLine = parsedLine[1:] if parsedLine.endswith("*"): parsedLine = parsedLine[:-1] - # Fast string matching for domain can be used - if parsedLine.startswith("||") and \ - parsedLine.endswith("^") and \ - QRegExp("[/:?=&\\*]").indexIn(parsedLine) == -1: + # Fast string matching for domain here + if self.__filterIsOnlyDomain(parsedLine): parsedLine = parsedLine[2:-1] - self.__useDomainMatch = True + self.__type = AdBlockRuleType.DomainMatchRule self.__matchString = parsedLine return # If rule contains '|' only at the end, string matching can be used - if parsedLine.endswith("|") and \ - QRegExp("[\\^\\*]").indexIn(parsedLine) == -1 and \ - parsedLine.count("|") == 1: + if self.__filterIsOnlyEndsMatch(parsedLine): parsedLine = parsedLine[:-1] - self.__useEndsMatch = True + self.__type = AdBlockRuleType.StringEndsMatchRule self.__matchString = parsedLine return # If there is still a wildcard (*) or separator (^) or (|), # the rule must be modified to comply with QRegExp. if "*" in parsedLine or "^" in parsedLine or "|" in parsedLine: + self.__type = AdBlockRuleType.RegExpMatchRule pattern = self.__convertPatternToRegExp(parsedLine) - self.__useRegExp = True self.__regExp = QRegExp(pattern, self.__caseSensitivity, QRegExp.RegExp) + self.__stringMatchers = self.__parseRegExpFilter(parsedLine) + return + + # This rule matches all URLs + if len(parsedLine) == 0: + if self.__options == AdBlockRuleOption.NoOption: + self.__isInternalDisabled = True + self.__type = AdBlockRuleType.Invalid + return + + self.__type = AdBlockRuleType.MatchAllUrlsRule return # no regexp required - self.__useRegExp = False + self.__type = AdBlockRuleType.StringContainsMatchRule self.__matchString = parsedLine - self.__stringMatchRule = True def __parseDomains(self, domains, separator): """ Private method to parse a string with a domain list. - @param domains list of domains (string) - @param separator separator character used by the list (string) + @param domains list of domains + @type str + @param separator separator character used by the list + @type str """ - domainsList = domains.split(separator) + domainsList = [d for d in domains.split(separator) if d] for domain in domainsList: if not domain: @@ -272,8 +347,8 @@ else: self.__allowedDomains.append(domain) - self.__domainRestricted = \ - bool(self.__blockedDomains) or bool(self.__allowedDomains) + if bool(self.__blockedDomains) or bool(self.__allowedDomains): + self.setOption(AdBlockRuleOption.DomainRestrictedOption) def networkMatch(self, request, domain, encodedUrl): """ @@ -288,48 +363,72 @@ @return flag indicating a match @rtype bool """ - if self.__cssRule or not self.__enabled or self.__internalDisabled: + if self.__type == AdBlockRuleType.CssRule or \ + not self.__isEnabled or \ + self.__isInternalDisabled: return False matched = self.__stringMatch(domain, encodedUrl) if matched: # check domain restrictions - if self.__domainRestricted and \ - not self.matchDomain(request.firstPartyUrl().host()): + if self.__hasOption(AdBlockRuleOption.DomainRestrictedOption) and \ + not self.matchDomain(request.firstPartyUrl().host()): return False # check third-party restrictions - if self.__thirdParty and not self.matchThirdParty(request): + if self.__hasOption(AdBlockRuleOption.ThirdPartyOption) and \ + not self.matchThirdParty(request): return False # check object restrictions - if self.__object and not self.matchObject(request): + if self.__hasOption(AdBlockRuleOption.ObjectOption) and \ + not self.matchObject(request): return False # check subdocument restrictions - if self.__subdocument and not self.matchSubdocument(request): + if self.__hasOption(AdBlockRuleOption.SubdocumentOption) and \ + not self.matchSubdocument(request): return False # check xmlhttprequest restriction - if self.__xmlhttprequest and not self.matchXmlHttpRequest(request): + if self.__hasOption(AdBlockRuleOption.XMLHttpRequestOption) and \ + not self.matchXmlHttpRequest(request): return False # check image restriction - if self.__image and not self.matchImage(request): + if self.__hasOption(AdBlockRuleOption.ImageOption) and \ + not self.matchImage(request): return False # check script restriction - if self.__script and not self.matchScript(request): + if self.__hasOption(AdBlockRuleOption.ScriptOption) and \ + not self.matchScript(request): return False # check stylesheet restriction - if self.__stylesheet and not self.matchStyleSheet(request): + if self.__hasOption(AdBlockRuleOption.StyleSheetOption) and \ + not self.matchStyleSheet(request): return False # check object-subrequest restriction - if self.__objectSubrequest and \ - not self.matchObjectSubrequest(request): + if self.__hasOption(AdBlockRuleOption.ObjectSubrequestOption) and \ + not self.matchObjectSubrequest(request): + return False + + # check ping restriction + if self.__hasOption(AdBlockRuleOption.PingOption) and \ + not self.matchPing(request): + return False + + # check media restriction + if self.__hasOption(AdBlockRuleOption.MediaOption) and \ + not self.matchMedia(request): + return False + + # check font restriction + if self.__hasOption(AdBlockRuleOption.FontOption) and \ + not self.matchFont(request): return False return matched @@ -338,10 +437,13 @@ """ Public method to check an URL against the rule. - @param url URL to check (QUrl) - @return flag indicating a match (boolean) + @param url URL to check + @type QUrl + @return flag indicating a match + @rtype bool """ - if not self.__document and not self.__elemhide: + if not self.__hasOption(AdBlockRuleOption.DocumentOption) and \ + not self.__hasOption(AdBlockRuleOption.ElementHideOption): return False encodedUrl = bytes(url.toEncoded()).decode() @@ -359,26 +461,28 @@ @return flag indicating a match @rtype bool """ - if self.__cssRule or not self.__enabled or self.__internalDisabled: - return False - matched = False - if self.__useRegExp: - matched = self.__regExp.indexIn(encodedUrl) != -1 - elif self.__useDomainMatch: - matched = domain.endswith(self.__matchString) - elif self.__useEndsMatch: + if self.__type == AdBlockRuleType.StringContainsMatchRule: + if self.__caseSensitivity == Qt.CaseInsensitive: + matched = self.__matchString.lower() in encodedUrl.lower() + else: + matched = self.__matchString in encodedUrl + elif self.__type == AdBlockRuleType.DomainMatchRule: + matched = self.__isMatchingDomain(domain, self.__matchString) + elif self.__type == AdBlockRuleType.StringEndsMatchRule: if self.__caseSensitivity == Qt.CaseInsensitive: matched = encodedUrl.lower().endswith( self.__matchString.lower()) else: matched = encodedUrl.endswith(self.__matchString) - else: - if self.__caseSensitivity == Qt.CaseInsensitive: - matched = self.__matchString.lower() in encodedUrl.lower() + elif self.__type == AdBlockRuleType.RegExpMatchRule: + if not self.__isMatchingRegExpStrings(encodedUrl): + matched = False else: - matched = self.__matchString in encodedUrl + matched = self.__regExp.indexIn(encodedUrl) != -1 + elif self.__type == AdBlockRuleType.MatchAllUrlsRule: + matched = True return matched @@ -386,40 +490,44 @@ """ Public method to match a domain. - @param domain domain name to check (string) - @return flag indicating a match (boolean) + @param domain domain name to check + @type str + @return flag indicating a match + @rtype bool """ - if not self.__enabled: + if not self.__isEnabled: return False - if not self.__domainRestricted: + if not self.__hasOption(AdBlockRuleOption.DomainRestrictedOption): return True if len(self.__blockedDomains) == 0: for dom in self.__allowedDomains: - if domain.endswith(dom): + if self.__isMatchingDomain(domain, dom): return True elif len(self.__allowedDomains) == 0: for dom in self.__blockedDomains: - if domain.endswith(dom): + if self.__isMatchingDomain(domain, dom): return False return True else: for dom in self.__blockedDomains: - if domain.endswith(dom): + if self.__isMatchingDomain(domain, dom): return False for dom in self.__allowedDomains: - if domain.endswith(dom): + if self.__isMatchingDomain(domain, dom): return True return False def matchThirdParty(self, req): """ - Public slot to match a third-party rule. + Public method to match a third-party rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype boolean """ # Third-party matching should be performed on second-level domains firstPartyHost = toSecondLevelDomain(req.firstPartyUrl()) @@ -427,109 +535,123 @@ match = firstPartyHost != host - if self.__thirdPartyException: + if self.__hasException(AdBlockRuleOption.ThirdPartyOption): return not match else: return match def matchObject(self, req): """ - Public slot to match an object rule. + Public method to match an object rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeObject) - if self.__objectException: + if self.__hasException(AdBlockRuleOption.ObjectOption): return not match else: return match def matchSubdocument(self, req): """ - Public slot to match a sub-document rule. + Public method to match a sub-document rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype boolean """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeSubFrame) - if self.__subdocumentException: + if self.__hasException(AdBlockRuleOption.SubdocumentOption): return not match else: return match def matchXmlHttpRequest(self, req): """ - Public slot to match a XmlHttpRequest rule. + Public method to match a XmlHttpRequest rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeXhr) - if self.__xmlhttprequestException: + if self.__hasException(AdBlockRuleOption.XMLHttpRequestOption): return not match else: return match def matchImage(self, req): """ - Public slot to match an Image rule. + Public method to match an Image rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeImage) - if self.__imageException: + if self.__hasException(AdBlockRuleOption.ImageOption): return not match else: return match def matchScript(self, req): """ - Public slot to match a Script rule. + Public method to match a Script rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeScript) - if self.__scriptException: + if self.__hasException(AdBlockRuleOption.ScriptOption): return not match else: return match def matchStyleSheet(self, req): """ - Public slot to match a StyleSheet rule. + Public method to match a StyleSheet rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool """ match = ( req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeStylesheet) - if self.__stylesheetException: + if self.__hasException(AdBlockRuleOption.StyleSheetOption): return not match else: return match def matchObjectSubrequest(self, req): """ - Public slot to match an Object Subrequest rule. + Public method to match an Object Subrequest rule. - @param req request object to check (QWebEngineUrlRequestInfo) - @return flag indicating a match (boolean) + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype boolean """ match = ( req.resourceType() == @@ -544,87 +666,169 @@ else: return match + def matchPing(self, req): + """ + Public method to match a Ping rule. + + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool + """ + match = ( + req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypePing) + + if self.__hasException(AdBlockRuleOption.PingOption): + return not match + else: + return match + + def matchMedia(self, req): + """ + Public method to match a Media rule. + + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool + """ + match = ( + req.resourceType() == QWebEngineUrlRequestInfo.ResourceTypeMedia) + + if self.__hasException(AdBlockRuleOption.MediaOption): + return not match + else: + return match + + def matchFont(self, req): + """ + Public method to match a Font rule. + + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool + """ + match = ( + req.resourceType() == + QWebEngineUrlRequestInfo.ResourceTypeFontResource) + + if self.__hasException(AdBlockRuleOption.FontOption): + return not match + else: + return match + + def matchOther(self, req): + """ + Public method to match any other rule. + + @param req request object to check + @type QWebEngineUrlRequestInfo + @return flag indicating a match + @rtype bool + """ + match = req.resourceType() in [ + QWebEngineUrlRequestInfo.ResourceTypeSubResource, + QWebEngineUrlRequestInfo.ResourceTypeWorker, + QWebEngineUrlRequestInfo.ResourceTypeSharedWorker, + QWebEngineUrlRequestInfo.ResourceTypeServiceWorker, + QWebEngineUrlRequestInfo.ResourceTypePrefetch, + QWebEngineUrlRequestInfo.ResourceTypeFavicon, + QWebEngineUrlRequestInfo.ResourceTypeUnknown, + ] + + if self.__hasException(AdBlockRuleOption.OtherOption): + return not match + else: + return match + def isException(self): """ Public method to check, if the rule defines an exception. - @return flag indicating an exception (boolean) + @return flag indicating an exception + @rtype bool """ - return self.__exception + return self.__isException def setException(self, exception): """ Public method to set the rule's exception flag. - @param exception flag indicating an exception rule (boolean) + @param exception flag indicating an exception rule + @type bool """ - self.__exception = exception + self.__isException = exception def isEnabled(self): """ Public method to check, if the rule is enabled. - @return flag indicating enabled state (boolean) + @return flag indicating enabled state + @rtype bool """ - return self.__enabled + return self.__isEnabled def setEnabled(self, enabled): """ Public method to set the rule's enabled state. - @param enabled flag indicating the new enabled state (boolean) + @param enabled flag indicating the new enabled state + @type bool """ - self.__enabled = enabled - if not enabled: - self.__filter = "!" + self.__filter - else: - self.__filter = self.__filter[1:] + self.__isEnabled = enabled def isCSSRule(self): """ Public method to check, if the rule is a CSS rule. - @return flag indicating a CSS rule (boolean) + @return flag indicating a CSS rule + @rtype bool """ - return self.__cssRule + return self.__type == AdBlockRuleType.CssRule def cssSelector(self): """ Public method to get the CSS selector of the rule. - @return CSS selector (string) + @return CSS selector + @rtype str """ - return self.__cssSelector + return self.__matchString def isDocument(self): """ Public method to check, if this is a document rule. - @return flag indicating a document rule (boolean) + @return flag indicating a document rule + @rtype bool """ - return self.__document + return self.__hasOption(AdBlockRuleOption.DocumentOption) def isElementHiding(self): """ Public method to check, if this is an element hiding rule. - @return flag indicating an element hiding rule (boolean) + @return flag indicating an element hiding rule + @rtype bool """ - return self.__elemhide + return self.__hasOption(AdBlockRuleOption.ElementHideOption) def isDomainRestricted(self): """ Public method to check, if this rule is restricted by domain. - @return flag indicating a domain restriction (boolean) + @return flag indicating a domain restriction + @rtype bool """ - return self.__domainRestricted + return self.__hasOption(AdBlockRuleOption.DomainRestrictedOption) def isComment(self): """ Public method to check, if this is a comment. - @return flag indicating a comment (boolean) + @return flag indicating a comment + @rtype bool """ return self.__filter.startswith("!") @@ -632,7 +836,8 @@ """ Public method to check, if this is a header. - @return flag indicating a header (boolean) + @return flag indicating a header + @rtype bool """ return self.__filter.startswith("[Adblock") @@ -640,24 +845,28 @@ """ Public method to check, if this is a slow rule. - @return flag indicating a slow rule (boolean) + @return flag indicating a slow rule + @rtype bool """ - return self.__useRegExp + return self.__regExp is not None def isInternalDisabled(self): """ Public method to check, if this rule was disabled internally. - @return flag indicating an internally disabled rule (boolean) + @return flag indicating an internally disabled rule + @rtype bool """ - return self.__internalDisabled + return self.__isInternalDisabled def __convertPatternToRegExp(self, wildcardPattern): """ Private method to convert a wildcard pattern to a regular expression. - @param wildcardPattern string containing the wildcard pattern (string) - @return string containing a regular expression (string) + @param wildcardPattern string containing the wildcard pattern + @type str + @return string containing a regular expression + @rtype string """ pattern = wildcardPattern @@ -685,3 +894,264 @@ pattern = re.sub(r"\\\*", ".*", pattern) return pattern + + def __hasOption(self, opt): + """ + Private method to check, if the given option has been set. + + @param opt option to check for + @type AdBlockRuleOption + @return flag indicating the state of the option + @rtype bool + """ + return bool(self.__options & opt) + + def setOption(self, opt): + """ + Public method to set the given option. + + @param opt option to be set + @type AdBlockRuleOption + """ + self.__options |= opt + + def __hasException(self, opt): + """ + Private method to check, if the given option has been set as an + exception. + + @param opt option to check for + @type AdBlockRuleOption + @return flag indicating the exception state of the option + @rtype bool + """ + return bool(self.__exceptions & opt) + + def __setException(self, opt, on): + """ + Private method to set the given option as an exception. + + @param opt option to be set + @type AdBlockRuleOption + @param on flag indicating to set or unset the exception + @type bool + """ + if on: + self.__exceptions |= opt + else: + self.__exceptions &= ~opt + + def __filterIsOnlyDomain(self, filterString): + """ + Private method to check, if the given filter is a domain only filter. + + @param filterString filter string to be checked + @type str + @return flag indicating a domain only filter + @rtype bool + """ + if not filterString.endswith("^") or not filterString.startswith("||"): + return False + + for filterChar in filterString: + if filterChar in ["/", ":", "?", "=", "&", "*"]: + return False + + return True + + def __filterIsOnlyEndsMatch(self, filterString): + """ + Private method to check, if the given filter is to match against the + end of a string. + + @param filterString filter string to be checked + @type str + @return flag indicating a end of string match filter + @rtype bool + """ + index = 0 + for filterChar in filterString: + if filterChar in ["^", "*"]: + return False + elif filterChar == "|": + return bool(index == len(filterString) - 1) + index += 1 + + return False + + def __isMatchingDomain(self, domain, filterString): + """ + Private method to check, if a given domain matches the given filter + string. + + @param domain domain to be checked + @type str + @param filterString filter string to check against + @type str + @return flag indicating a match + @rtype bool + """ + if filterString == domain: + return True + + if not domain.endswith(filterString): + return False + + index = domain.find(filterString) + + return bool(index > 0 and domain[index - 1] == ".") + + def __isMatchingRegExpStrings(self, url): + """ + Private method to check the given URL against the fixed parts of + the regexp. + + @param url URL to be checked + @type str + @return flag indicating a match + @rtype bool + """ + assert self.__regExp is not None + + for matcher in self.__stringMatchers: + if matcher not in url: + return False + + return True + + def __parseRegExpFilter(self, filterString): + """ + Private method to split the given regular expression into strings that + can be used with 'in'. + + @param filterString regexp filter string to be parsed + @type str + @return fixed string parts of the filter + @rtype list of str + """ + matchers = [] + + startPos = -1 + for index in range(len(filterString)): + filterChar = filterString[index] + if filterChar in ["|", "*", "^"]: + sub = filterString[startPos:index] + if len(sub) > 1: + matchers.append(sub) + startPos = index + 1 + + sub = filterString[startPos:] + if len(sub) > 1: + matchers.append(sub) + + return list(set(matchers)) + + def ruleType(self): + """ + Public method to get the rule type. + + @return rule type + @rtype AdBlockRuleType + """ + return self.__type + + def ruleOptions(self): + """ + Public method to get the rule options. + + @return rule options + @rtype AdBlockRuleOption + """ + return self.__options + + def ruleExceptions(self): + """ + Public method to get the rule exceptions. + + @return rule exceptions + @rtype AdBlockRuleOption + """ + return self.__exceptions + + def matchString(self): + """ + Public method to get the match string. + + @return match string + @rtype str + """ + return self.__matchString + + def caseSensitivity(self): + """ + Public method to get the case sensitivity. + + @return case sensitivity + @rtype Qt.CaseSensitivity + """ + return self.__caseSensitivity + + def allowedDomains(self): + """ + Public method to get a copy of the list of allowed domains. + + @return list of allowed domains + @rtype list of str + """ + return self.__allowedDomains[:] + + def blockedDomains(self): + """ + Public method to get a copy of the list of blocked domains. + + @return list of blocked domains + @rtype list of str + """ + return self.__blockedDomains[:] + + def addBlockedDomains(self, domains): + """ + Public method to add to the list of blocked domains. + + @param domains list of domains to be added + @type str or list of str + """ + if isinstance(domains, list): + self.__blockedDomains.extend(domains) + else: + self.__blockedDomains.append(domains) + + def getRegExpAndMatchers(self): + """ + Public method to get the regular expression and associated string + matchers. + + @return tuple containing the regular expression and the list of + string matchers + @rtype tuple of (QRegExp, list of str) + """ + if self.__regExp is not None: + return (QRegExp(self.__regExp), self.__stringMatchers[:]) + else: + return (None, []) + + def copyFrom(self, other): + """ + Public method to copy another AdBlock rule. + + @param other reference to the AdBlock rule to copy from + @type AdBlockRule + """ + self.__subscription = other.subscription() + self.__type = other.ruleType() + self.__options = other.ruleOptions() + self.__exceptions = other.ruleExceptions() + self.__filter = other.filter() + self.__matchString = other.matchString() + self.__caseSensitivity = other.caseSensitivity() + self.__isEnabled = other.isEnabled() + self.__isException = other.isException() + self.__isInternalDisabled = other.isInternalDisabled() + self.__allowedDomains = other.allowedDomains() + self.__blockedDomains = other.blockedDomains() + self.__regExp, self.__stringMatchers = other.getRegExpAndMatchers()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebBrowser/AdBlock/AdBlockSearchTree.py Mon Dec 18 18:09:39 2017 +0100 @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing the AdBlock search tree. +""" + +from __future__ import unicode_literals + +from .AdBlockRule import AdBlockRuleType + + +class AdBlockSearchTreeNode(object): + """ + Class implementing the AdBlock search tree node. + """ + def __init__(self): + """ + Constructor + """ + self.char = '' + self.rule = None + self.children = {} + + +class AdBlockSearchTree(object): + """ + Class implementing the AdBlock search tree. + """ + def __init__(self): + """ + Constructor + """ + self.__root = AdBlockSearchTreeNode() + + def clear(self): + """ + Public method to clear the search tree. + """ + self.__deleteNode(self.__root) + self.__root = AdBlockSearchTreeNode() + + def add(self, rule): + """ + Public method to add a rule to the search tree. + + @param rule rule to be added + @type AdBlockRule + @return flag indicating a successful addition + @rtype bool + """ + if rule.ruleType() != AdBlockRuleType.StringContainsMatchRule: + return False + + filterString = rule.matchString() + + if len(filterString) <= 0: + return False + + node = self.__root + + for filterChar in filterString: + try: + nextNode = node.children[filterChar] + except KeyError: + nextNode = AdBlockSearchTreeNode() + nextNode.char = filterChar + node.children[filterChar] = nextNode + node = nextNode + + node.rule = rule + + return True + + def find(self, request, domain, urlString): + """ + Public method to find a matching rule. + + @param request URL request to be matched + @type QWebEngineUrlRequestInfo + @param domain domain of the URL + @type str + @param urlString requested URL as a lowercase string + @type str + @return reference to the matched rule + @rtype AdBlockRule + """ + length = len(urlString) + + if length <= 0: + return None + + for index in range(length): + rule = self.__prefixSearch(request, domain, urlString, + urlString[index:], length - index) + if rule: + return rule + + return None + + def __deleteNode(self, node): + """ + Private method to delete a search tree node. + + @param node reference to the node to be deleted + @type AdBlockSearchTreeNode + """ + if not node: + return + + for key in node.children.keys(): + self.__deleteNode(node.children[key]) + + node.children = {} + node = None + + def __prefixSearch(self, request, domain, urlString, string, length): + """ + Private method to perform a prefix search. + + @param request URL request to be matched + @type QWebEngineUrlRequestInfo + @param domain domain of the URL + @type str + @param urlString requested URL as a lowercase string + @type str + @param string prefix string to search for + @type str + @param length length to be considered + @type int + @return reference to the matched rule + @rtype AdBlockRule + """ + if length <= 0: + return None + + char = string[0] + + try: + node = self.__root.children[char] + except KeyError: + return None + + for char in string[1:]: + if node.rule and \ + node.rule.networkMatch(request, domain, urlString): + return node.rule + + try: + node = node.children[char] + except KeyError: + return None + + if node.rule and node.rule.networkMatch(request, domain, urlString): + return node.rule + + return None
--- a/WebBrowser/AdBlock/AdBlockSubscription.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockSubscription.py Mon Dec 18 18:09:39 2017 +0100 @@ -32,10 +32,13 @@ @signal changed() emitted after the subscription has changed @signal rulesChanged() emitted after the subscription's rules have changed @signal enabledChanged(bool) emitted after the enabled state was changed + @signal rulesEnabledChanged() emitted after a rule enabled state was + changed """ changed = pyqtSignal() rulesChanged = pyqtSignal() enabledChanged = pyqtSignal(bool) + rulesEnabledChanged = pyqtSignal() def __init__(self, url, custom, parent=None, default=False): """ @@ -65,13 +68,6 @@ self.__rules = [] # list containing all AdBlock rules - self.__networkExceptionRules = [] - self.__networkBlockRules = [] - self.__domainRestrictedCssRules = [] - self.__elementHidingRules = "" - self.__documentRules = [] - self.__elemhideRules = [] - self.__checksumRe = re.compile( r"""^\s*!\s*checksum[\s\-:]+([\w\+\/=]+).*\n""", re.IGNORECASE | re.MULTILINE) @@ -105,7 +101,8 @@ """ Private method to parse the AdBlock URL for the subscription. - @param url AdBlock URL for the subscription (QUrl) + @param url AdBlock URL for the subscription + @type QUrl """ if url.scheme() != "abp": return @@ -142,7 +139,8 @@ """ Public method to generate the URL for this subscription. - @return AdBlock URL for the subscription (QUrl) + @return AdBlock URL for the subscription + @rtype QUrl """ url = QUrl() url.setScheme("abp") @@ -169,7 +167,8 @@ """ Public method to check, if the subscription is enabled. - @return flag indicating the enabled status (boolean) + @return flag indicating the enabled status + @rtype bool """ return self.__enabled @@ -177,7 +176,8 @@ """ Public method to set the enabled status. - @param enabled flag indicating the enabled status (boolean) + @param enabled flag indicating the enabled status + @type bool """ if self.__enabled == enabled: return @@ -189,7 +189,8 @@ """ Public method to get the subscription title. - @return subscription title (string) + @return subscription title + @rtype string """ return self.__title @@ -197,7 +198,8 @@ """ Public method to set the subscription title. - @param title subscription title (string) + @param title subscription title + @type str """ if self.__title == title: return @@ -209,7 +211,8 @@ """ Public method to get the subscription location. - @return URL of the subscription location (QUrl) + @return URL of the subscription location + @rtype QUrl """ return QUrl.fromEncoded(self.__location) @@ -217,7 +220,8 @@ """ Public method to set the subscription location. - @param url URL of the subscription location (QUrl) + @param url URL of the subscription location + @type QUrl """ if url == self.location(): return @@ -230,7 +234,8 @@ """ Public method to get the location of a required subscription. - @return location of a required subscription (string) + @return location of a required subscription + @rtype str """ return self.__requiresLocation @@ -238,7 +243,8 @@ """ Public method to get the date and time of the last update. - @return date and time of the last update (QDateTime) + @return date and time of the last update + @rtype QDateTime """ return self.__lastUpdate @@ -246,7 +252,8 @@ """ Public method to get the name of the rules file. - @return name of the rules file (string) + @return name of the rules file + @rtype str """ if self.location().scheme() == "file": return self.location().toLocalFile() @@ -322,7 +329,6 @@ if time: self.__remoteModified.setTime( QTime(int(hour), int(minute))) - self.__populateCache() self.changed.emit() elif not fileName.endswith("_custom"): self.__lastUpdate = QDateTime() @@ -445,11 +451,13 @@ """ Private method to check the subscription file's checksum. - @param fileName name of the file containing the subscription (string) - @return flag indicating a valid file (boolean). A file is considered + @param fileName name of the file containing the subscription + @type str + @return flag indicating a valid file. A file is considered valid, if the checksum is OK, the file does not contain a checksum (i.e. cannot be checked) or we are using the limited EasyList (because we fiddled with the original). + @rtype bool """ try: f = open(fileName, "r", encoding="utf-8") @@ -515,84 +523,14 @@ for rule in self.__rules: textStream << rule.filter() << "\n" - def match(self, req, urlDomain, urlString): - """ - Public method to check the subscription for a matching rule. - - @param req reference to the network request (QWebEngineUrlRequestInfo) - @param urlDomain domain of the URL (string) - @param urlString URL (string) - @return reference to the rule object or None (AdBlockRule) - """ - for rule in self.__networkExceptionRules: - if rule.networkMatch(req, urlDomain, urlString): - return None - - for rule in self.__networkBlockRules: - if rule.networkMatch(req, urlDomain, urlString): - return rule - - return None - - def adBlockDisabledForUrl(self, url): - """ - Public method to check, if AdBlock is disabled for the given URL. - - @param url URL to check (QUrl) - @return flag indicating disabled state (boolean) - """ - for rule in self.__documentRules: - if rule.urlMatch(url): - return True - - return False - - def elemHideDisabledForUrl(self, url): - """ - Public method to check, if element hiding is disabled for the given - URL. - - @param url URL to check (QUrl) - @return flag indicating disabled state (boolean) - """ - if self.adBlockDisabledForUrl(url): - return True - - for rule in self.__elemhideRules: - if rule.urlMatch(url): - return True - - return False - - def elementHidingRules(self): - """ - Public method to get the element hiding rules. - - @return element hiding rules (string) - """ - return self.__elementHidingRules - - def elementHidingRulesForDomain(self, domain): - """ - Public method to get the element hiding rules for the given domain. - - @param domain domain name (string) - @return element hiding rules (string) - """ - rules = "" - - for rule in self.__domainRestrictedCssRules: - if rule.matchDomain(domain): - rules += rule.cssSelector() + "," - - return rules - def rule(self, offset): """ Public method to get a specific rule. - @param offset offset of the rule (integer) - @return requested rule (AdBlockRule) + @param offset offset of the rule + @type int + @return requested rule + @rtype AdBlockRule """ if offset >= len(self.__rules): return None @@ -603,7 +541,8 @@ """ Public method to get the list of rules. - @return list of rules (list of AdBlockRule) + @return list of rules + @rtype list of AdBlockRule """ return self.__rules[:] @@ -611,11 +550,12 @@ """ Public method to add a rule. - @param rule reference to the rule to add (AdBlockRule) - @return offset of the rule (integer) + @param rule reference to the rule to add + @type AdBlockRule + @return offset of the rule + @rtype int """ self.__rules.append(rule) - self.__populateCache() self.rulesChanged.emit() return len(self.__rules) - 1 @@ -624,66 +564,40 @@ """ Public method to remove a rule given the offset. - @param offset offset of the rule to remove (integer) + @param offset offset of the rule to remove + @type int """ if offset < 0 or offset > len(self.__rules): return del self.__rules[offset] - self.__populateCache() self.rulesChanged.emit() def replaceRule(self, rule, offset): """ Public method to replace a rule given the offset. - @param rule reference to the rule to set (AdBlockRule) - @param offset offset of the rule to remove (integer) - @return requested rule (AdBlockRule) + @param rule reference to the rule to set + @type AdBlockRule + @param offset offset of the rule to remove + @type int + @return requested rule + @rtype AdBlockRule """ if offset >= len(self.__rules): return None self.__rules[offset] = rule - self.__populateCache() self.rulesChanged.emit() return self.__rules[offset] - def __populateCache(self): - """ - Private method to populate the various rule caches. - """ - self.__networkExceptionRules = [] - self.__networkBlockRules = [] - self.__domainRestrictedCssRules = [] - self.__elementHidingRules = "" - self.__documentRules = [] - self.__elemhideRules = [] - - for rule in self.__rules: - if not rule.isEnabled(): - continue - - if rule.isCSSRule(): - if rule.isDomainRestricted(): - self.__domainRestrictedCssRules.append(rule) - else: - self.__elementHidingRules += rule.cssSelector() + "," - elif rule.isDocument(): - self.__documentRules.append(rule) - elif rule.isElementHiding(): - self.__elemhideRules.append(rule) - elif rule.isException(): - self.__networkExceptionRules.append(rule) - else: - self.__networkBlockRules.append(rule) - def canEditRules(self): """ Public method to check, if rules can be edited. - @return flag indicating rules may be edited (boolean) + @return flag indicating rules may be edited + @rtype bool """ return self.__custom @@ -691,7 +605,8 @@ """ Public method to check, if the subscription can be removed. - @return flag indicating removal is allowed (boolean) + @return flag indicating removal is allowed + @rtype bool """ return not self.__custom and not self.__defaultSubscription @@ -699,18 +614,22 @@ """ Public method to enable a specific rule. - @param offset offset of the rule (integer) - @param enabled new enabled state (boolean) - @return reference to the changed rule (AdBlockRule) + @param offset offset of the rule + @type int + @param enabled new enabled state + @type bool + @return reference to the changed rule + @rtype AdBlockRule """ if offset >= len(self.__rules): return None rule = self.__rules[offset] rule.setEnabled(enabled) + self.rulesEnabledChanged.emit() + if rule.isCSSRule(): from WebBrowser.WebBrowserWindow import WebBrowserWindow - self.__populateCache() WebBrowserWindow.mainWindow().reloadUserStyleSheet() return rule
--- a/WebBrowser/AdBlock/AdBlockTreeWidget.py Thu Dec 14 19:25:34 2017 +0100 +++ b/WebBrowser/AdBlock/AdBlockTreeWidget.py Mon Dec 18 18:09:39 2017 +0100 @@ -25,8 +25,10 @@ """ Constructor - @param subscription reference to the subscription (AdBlockSubscription) - @param parent reference to the parent widget (QWidget) + @param subscription reference to the subscription + @type AdBlockSubscription + @param parent reference to the parent widget + @type QWidget """ super(AdBlockTreeWidget, self).__init__(parent) @@ -49,7 +51,8 @@ """ Public method to get a reference to the subscription. - @return reference to the subscription (AdBlockSubscription) + @return reference to the subscription + @rtype AdBlockSubscription """ return self.__subscription @@ -57,13 +60,12 @@ """ Public method to highlight the given rule. - @param rule AdBlock rule to be shown (AdBlockRule) + @param rule AdBlock rule to be shown + @type AdBlockRule """ - if rule: + if not bool(self.__topItem) and bool(rule): self.__ruleToBeSelected = rule.filter() - if not self.__topItem: - return - if self.__ruleToBeSelected: + elif self.__ruleToBeSelected: items = self.findItems(self.__ruleToBeSelected, Qt.MatchRecursive) if items: item = items[0] @@ -110,7 +112,8 @@ """ Public slot to add a new rule. - @param filterRule filter to be added (string) + @param filterRule filter to be added + @type str """ if not self.__subscription.canEditRules(): return @@ -146,7 +149,8 @@ """ Private slot to show the context menu. - @param pos position for the menu (QPoint) + @param pos position for the menu + @type QPoint """ if not self.__subscription.canEditRules(): return @@ -168,7 +172,8 @@ """ Private slot to handle the change of an item. - @param itm changed item (QTreeWidgetItem) + @param itm changed item + @type QTreeWidgetItem """ if itm is None or self.__itemChangingBlock: return @@ -219,8 +224,10 @@ """ Private method to adjust an item. - @param itm item to be adjusted (QTreeWidgetItem) - @param rule rule for the adjustment (AdBlockRule) + @param itm item to be adjusted + @type QTreeWidgetItem + @param rule rule for the adjustment + @type AdBlockRule """ if not rule.isEnabled(): font = QFont() @@ -251,7 +258,8 @@ """ Protected method handling key presses. - @param evt key press event (QKeyEvent) + @param evt key press event + @type QKeyEvent """ if evt.key() == Qt.Key_C and \ evt.modifiers() & Qt.ControlModifier:
--- a/eric6.e4p Thu Dec 14 19:25:34 2017 +0100 +++ b/eric6.e4p Mon Dec 18 18:09:39 2017 +0100 @@ -1390,8 +1390,10 @@ <Source>WebBrowser/AdBlock/AdBlockExceptionsDialog.py</Source> <Source>WebBrowser/AdBlock/AdBlockIcon.py</Source> <Source>WebBrowser/AdBlock/AdBlockManager.py</Source> + <Source>WebBrowser/AdBlock/AdBlockMatcher.py</Source> <Source>WebBrowser/AdBlock/AdBlockPage.py</Source> <Source>WebBrowser/AdBlock/AdBlockRule.py</Source> + <Source>WebBrowser/AdBlock/AdBlockSearchTree.py</Source> <Source>WebBrowser/AdBlock/AdBlockSubscription.py</Source> <Source>WebBrowser/AdBlock/AdBlockTreeWidget.py</Source> <Source>WebBrowser/AdBlock/AdBlockUrlInterceptor.py</Source>