diff options
-rw-r--r-- | README.asciidoc | 2 | ||||
-rw-r--r-- | misc/requirements/requirements-qutebrowser.txt-raw | 2 | ||||
-rw-r--r-- | qutebrowser/components/braveadblock.py | 10 | ||||
-rw-r--r-- | qutebrowser/config/configdata.yml | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/README.asciidoc b/README.asciidoc index cb1bb9833..4da2c0edc 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -135,7 +135,7 @@ The following software and libraries are required to run qutebrowser: The following libraries are optional: -* https://pypi.org/project/adblock/[adblock] (for Ad-blocking using ABP syntax) +* https://pypi.org/project/adblock/[adblock] (for improved adblocking using ABP syntax) * http://cthedot.de/cssutils/[cssutils] (for an improved `:download --mhtml` with QtWebKit). * On Windows, https://pypi.python.org/pypi/colorama/[colorama] for colored log diff --git a/misc/requirements/requirements-qutebrowser.txt-raw b/misc/requirements/requirements-qutebrowser.txt-raw index a5027bdca..eb7ed011d 100644 --- a/misc/requirements/requirements-qutebrowser.txt-raw +++ b/misc/requirements/requirements-qutebrowser.txt-raw @@ -5,4 +5,4 @@ PyYAML colorama cssutils attrs -adblock +adblock # Optional, for improved adblocking diff --git a/qutebrowser/components/braveadblock.py b/qutebrowser/components/braveadblock.py index 80329d62c..21145c5f3 100644 --- a/qutebrowser/components/braveadblock.py +++ b/qutebrowser/components/braveadblock.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. -"""Functions related to ad blocking.""" +"""Functions related to the Brave adblocker.""" import io import os.path @@ -114,7 +114,7 @@ def resource_type_to_string(resource_type: typing.Optional[ResourceType]) -> str class BraveAdBlocker: - """Manage blocked hosts based from /etc/hosts-like files. + """Manage blocked hosts based on Brave's adblocker. Attributes: enabled: Should we block ads or not @@ -173,7 +173,7 @@ class BraveAdBlocker: if not result.matched: return False - if result.exception is not None and not result.important: + elif result.exception is not None and not result.important: logger.debug( "Excepting %s from being blocked by %s because of %s", request_url.toDisplayString(), @@ -181,7 +181,7 @@ class BraveAdBlocker: result.exception, ) return False - if _is_whitelisted_url(request_url): + elif _is_whitelisted_url(request_url): logger.debug( "Request to %s is whitelisted, thus not blocked", request_url.toDisplayString(), @@ -229,7 +229,7 @@ class BraveAdBlocker: url, self._on_download_finished, self._in_progress ) self._finished_registering_downloads = True - if len(self._in_progress) == 0 and self._wip_filter_set is not None: + if not self._in_progress and self._wip_filter_set is not None: self._on_lists_downloaded() def _on_lists_downloaded(self) -> None: diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index cf3100582..46b8aff85 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -668,7 +668,7 @@ content.blocking.adblock.lists: valtype: Url none_ok: true desc: | - List of URLs of lists which contain adblock rules. + List of URLs to ABP-style adblocking rulesets. content.blocking.whitelist: default: [] |