Merge 906f7c4f24 into 7e3df43463
This commit is contained in:
commit
f093244657
|
|
@ -507,3 +507,29 @@ with the newest dependencies.
|
||||||
Alternatively, you can update your local copy of the code (e.g. by pulling the
|
Alternatively, you can update your local copy of the code (e.g. by pulling the
|
||||||
git repo, or extracting a new version) and the virtualenv should automatically
|
git repo, or extracting a new version) and the virtualenv should automatically
|
||||||
use the updated versions. However, dependencies won't be updated that way.
|
use the updated versions. However, dependencies won't be updated that way.
|
||||||
|
|
||||||
|
Ad blocking
|
||||||
|
------------
|
||||||
|
Blocking ads in qutebrowser can be done in two ways; host-based or rules-based blocking.
|
||||||
|
Host-based blocking works by preventing a list of urls from loading
|
||||||
|
and can be turned on with a single option
|
||||||
|
(see documentation of settings for `content.blocking`).
|
||||||
|
|
||||||
|
More advanced rule based blocking uses Brave's adblocking library via
|
||||||
|
a python library `adblock`, which is an optional dependency of
|
||||||
|
qutebrowser.
|
||||||
|
|
||||||
|
Some linux distributions ship this library in official repositories,
|
||||||
|
but in general you can only get it by installing
|
||||||
|
a library `adblock` via pip, e.g. run:
|
||||||
|
|
||||||
|
`pip3 install adblock`
|
||||||
|
|
||||||
|
By default, this library is used if found and
|
||||||
|
the host-based blocking servers as a fallback.
|
||||||
|
|
||||||
|
If not, make sure blocking is on by having
|
||||||
|
`content.blocking.enabled` set to `true` and
|
||||||
|
settings `content.blocking.method` set to `auto`,
|
||||||
|
see documentation for other options.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,12 @@ class Completer(QObject):
|
||||||
log.completion.debug('Starting command completion')
|
log.completion.debug('Starting command completion')
|
||||||
return miscmodels.command
|
return miscmodels.command
|
||||||
try:
|
try:
|
||||||
cmd = objects.commands[before_cursor[0]]
|
cmdname = before_cursor[0]
|
||||||
|
if before_cursor[0] in config.cache['aliases']:
|
||||||
|
cmdname = config.cache['aliases'][before_cursor[0]].split(
|
||||||
|
maxsplit=1)[0]
|
||||||
|
|
||||||
|
cmd = objects.commands[cmdname]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
log.completion.debug("No completion for unknown command: {}"
|
log.completion.debug("No completion for unknown command: {}"
|
||||||
.format(before_cursor[0]))
|
.format(before_cursor[0]))
|
||||||
|
|
|
||||||
|
|
@ -189,12 +189,18 @@ def _set_cmd_prompt(cmd, txt):
|
||||||
(':config-cycle option |', 'value', '', ['option']),
|
(':config-cycle option |', 'value', '', ['option']),
|
||||||
(':config-cycle option one |', 'value', '', ['option', 'one']),
|
(':config-cycle option one |', 'value', '', ['option', 'one']),
|
||||||
(':config-cycle option one two |', 'value', '', ['option', 'one', 'two']),
|
(':config-cycle option one two |', 'value', '', ['option', 'one', 'two']),
|
||||||
|
(':openalias |', 'url', '', []),
|
||||||
|
(':bindalias |', None, '', []),
|
||||||
|
(':bindalias <c-x> |', 'command', '', ['<c-x>']),
|
||||||
|
(':bindalias <c-x> foo|', 'command', 'foo', ['<c-x>']),
|
||||||
|
(':bindalias <c-x>| foo', None, '<c-x>', []),
|
||||||
])
|
])
|
||||||
def test_update_completion(txt, kind, pattern, pos_args, status_command_stub,
|
def test_update_completion(txt, kind, pattern, pos_args, status_command_stub,
|
||||||
completer_obj, completion_widget_stub, config_stub,
|
completer_obj, completion_widget_stub, config_stub,
|
||||||
key_config_stub):
|
key_config_stub):
|
||||||
"""Test setting the completion widget's model based on command text."""
|
"""Test setting the completion widget's model based on command text."""
|
||||||
# this test uses | as a placeholder for the current cursor position
|
# this test uses | as a placeholder for the current cursor position
|
||||||
|
config_stub.val.aliases = {"bindalias": "bind", "openalias": "open -t"}
|
||||||
_set_cmd_prompt(status_command_stub, txt)
|
_set_cmd_prompt(status_command_stub, txt)
|
||||||
completer_obj.schedule_completion_update()
|
completer_obj.schedule_completion_update()
|
||||||
if kind is None:
|
if kind is None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue