Commit Graph

9396 Commits

Author SHA1 Message Date
Florian Bruhin
f6c36ccbee Rename openurl to load_url
We still call the :open command openurl, but in the tab API and in
TabbedBrowser it's now called load_url.
2018-11-30 08:31:03 +01:00
Florian Bruhin
5bf0dffa95 Move history (de)serializing to a private_api object 2018-11-30 08:23:52 +01:00
Florian Bruhin
27ee3280b2 Separate success/error callbacks 2018-11-29 20:29:43 +01:00
Florian Bruhin
0104490978 Use enum values for load_status_changed 2018-11-29 19:44:48 +01:00
Florian Bruhin
a6d3a935d3 Use an enum for IgnoreCase 2018-11-29 19:40:20 +01:00
Florian Bruhin
2cd2c60a8b Rename key_press to fake_key_press 2018-11-29 19:30:28 +01:00
Florian Bruhin
7a3d1b0212 AbstractHistory: Check count 2018-11-29 19:28:11 +01:00
Florian Bruhin
b2796d4a85 Rename some AbstractZoom methods 2018-11-29 19:26:05 +01:00
Florian Bruhin
73e196ff65 Make url(requested=True) a keyword-only arg 2018-11-29 19:23:14 +01:00
Florian Bruhin
cd8e3094b9 Avoid circular import 2018-11-29 19:22:28 +01:00
Florian Bruhin
609b8f1cee Fix return values of AbstractPrinting.check_*_support 2018-11-29 19:10:47 +01:00
Florian Bruhin
f81c5b7eab Move common key_press implementation 2018-11-29 19:10:19 +01:00
Florian Bruhin
4b7c60da9f Improve docstrings 2018-11-29 19:08:48 +01:00
Florian Bruhin
595e152729 Remove AbstractAudio.toggle_muted 2018-11-29 19:03:45 +01:00
Florian Bruhin
c7179e35cc Remove old code 2018-11-29 19:02:36 +01:00
Florian Bruhin
6ccba16b72 Fix coverage 2018-11-29 19:02:03 +01:00
Florian Bruhin
b7de287e7b Move CommandError to api.cmdutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
f9858733c1 Improve docstrings 2018-11-29 14:18:11 +01:00
Florian Bruhin
e576847b91 Add partial type annotations for qtutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
7cbba4b3f1 Add type annotations for cmdutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
19628d0ae9 Move cmdutils.cmd_dict to objects.commands 2018-11-29 14:18:11 +01:00
Florian Bruhin
4caa2e056b Add type annotations to misc.objects 2018-11-29 14:18:11 +01:00
Thorsten Wißmann
65c51931c7 Wrap url quoting into new line 2018-11-29 08:29:56 +01:00
Thorsten Wißmann
31a122e97b Encode slashes in search terms for searchengines
If a search term contains a slash, this should be encoded. While this
makes no differences for search engines of the form

    http://example.org?q={}

it does for engines like these:

    http://example.org/search/{}

For a real world example, try:

    https://www.doi2bib.org/bib/{}
2018-11-29 08:29:56 +01:00
Florian Bruhin
ee2461a6fe Fix accessing user_agent() 2018-11-28 21:57:01 +01:00
Florian Bruhin
1d4729c7f7 Fix shutdown call 2018-11-28 19:56:52 +01:00
Florian Bruhin
89650d89f1 Fix lint 2018-11-28 18:03:10 +01:00
Florian Bruhin
5f5f202098 Move private tab API into an own object 2018-11-28 17:59:27 +01:00
Florian Bruhin
d60dff2623 Renaem private attribute to is_private 2018-11-28 17:34:33 +01:00
Florian Bruhin
8765ebef23 mypy: Don't claim to be a QWebEngineView 2018-11-28 16:06:25 +01:00
Florian Bruhin
63fa65df65
Merge pull request #4440 from qutebrowser/pyup-scheduled-update-2018-11-26
Scheduled weekly dependency update for week 47
2018-11-28 15:58:32 +01:00
Florian Bruhin
b5253ec473 Fix lint 2018-11-28 13:01:43 +01:00
Florian Bruhin
2237ca2bcf Remove now unneeded pylint suppressions 2018-11-28 12:54:19 +01:00
Florian Bruhin
2453134011 Remove unnecessary pass statements 2018-11-28 12:51:53 +01:00
Florian Bruhin
d7786c694f Add type hints for qutebrowser.browser.browsertab 2018-11-27 20:45:37 +01:00
Florian Bruhin
caca60087f Fix coverage 2018-11-27 13:24:48 +01:00
Florian Bruhin
21edeca3e0 pylint: disable=unused-import for typing
Apparently marking modules as used based on type comments doesn't work with
Python 3.7:

https://github.com/PyCQA/pylint/issues/2345
https://github.com/python/typed_ast/issues/60
2018-11-27 09:56:23 +01:00
Florian Bruhin
c931654a8d Remove old exit status values
Those weren't used anymore since bc8176ff21.
Since the values were removed in v1.0.0 and never used since then, it seems
fine to re-use them in the future.
2018-11-27 08:57:49 +01:00
Florian Bruhin
80808ee9d2 Add docstring 2018-11-27 08:54:25 +01:00
Florian Bruhin
7934dc9a95 mypy: Fix assert location 2018-11-27 08:37:59 +01:00
Florian Bruhin
06afd3604e Don't try to iterate over auth info
This caused a crash when trying to use a proxy with authentication on QtWebKit.
It was introduced in 3a5241b642 since it was a
namedtuple before and was iterable like this.
2018-11-26 23:30:55 +01:00
Florian Bruhin
e851480a2b Use empty tuple instead of None
While None works (as logging.py does "if args:" consistently), it was never
intended to be used like that.
2018-11-26 23:30:21 +01:00
Florian Bruhin
462e07a578 Use integer division to set font weight
QFont::setFontWeight takes an int only - it looks like PyQt accepts a float and
just truncates it. That's the behaviour we actually want here, but let's be
explicit about it.
2018-11-26 23:25:13 +01:00
Florian Bruhin
d2751935e0 Convert *args to list
It being a tuple also happens to work, but is somewhat inconsistent.
2018-11-26 23:24:41 +01:00
Florian Bruhin
1f36e56e1c Complete partial annotations
Unfortunately we can't turn on mypy's --disallow-incomplete-defs (yet) due to
https://github.com/python/mypy/issues/5954
2018-11-26 20:12:03 +01:00
Florian Bruhin
4b4b746791 mypy: Add type annotations for browsertab.AbstractAction 2018-11-26 18:25:12 +01:00
Florian Bruhin
12b26512fc mypy: Fix :session-save
We use a sentinel value for the argument so we can check whether the default
was used. To express that in the type system, it needs a separate class.
2018-11-26 18:25:12 +01:00
Florian Bruhin
8b1fd83366 mypy: Fix AbstractSettings default values 2018-11-26 18:25:12 +01:00
Florian Bruhin
8083091967 mypy: Fix _color_flag init 2018-11-26 18:25:12 +01:00
Florian Bruhin
923fd89323 mypy: Fix int-issues in commands.py 2018-11-26 18:25:12 +01:00
Florian Bruhin
08bd47bc16 mypy: Fix type for :scroll 2018-11-26 18:25:12 +01:00
Florian Bruhin
b63ed090d8 mypy: Fix log handler access 2018-11-26 18:25:12 +01:00
Florian Bruhin
c2c3f68828 mypy: Move tabbed_browser 2018-11-26 18:25:12 +01:00
Florian Bruhin
052c3f92ad mypy: Fix issues with config default values 2018-11-26 18:25:12 +01:00
Florian Bruhin
b37dbc4572 mypy: Add missing annotations 2018-11-26 18:25:12 +01:00
Florian Bruhin
a1e83f0773 mypy: Use class-based API for enum.IntEnum
See https://github.com/python/mypy/issues/4865
2018-11-26 18:25:12 +01:00
Florian Bruhin
563e1e8294 mypy: Ignore yaml.CSafe{Loader,Dumper}
See https://github.com/python/typeshed/blob/master/third_party/2and3/yaml/__init__.pyi#L9
2018-11-26 18:24:19 +01:00
Florian Bruhin
97d0cff93b mypy: Ignore ImportError handling
See https://github.com/python/mypy/issues/1153
2018-11-26 18:24:19 +01:00
Florian Bruhin
4d1b3df5e0 mypy: Fix logging.VDEBUG issues 2018-11-22 13:52:05 +01:00
Florian Bruhin
2152081d82 s/an URL/a URL/g 2018-11-16 12:37:30 +01:00
Florian Bruhin
0786af0f28
Merge pull request #4412 from rcorre/url-title-completion
Don't complete url and title from same search word.
2018-11-14 11:51:59 +01:00
Florian Bruhin
ed84aa8c7b stylesheet.js: Check if document.documentElement exists
Fixes #4244
2018-11-14 11:44:15 +01:00
Ryan Roden-Corrent
bf10f483e1
Fix sql comment to match updated code. 2018-11-13 20:44:57 -05:00
Jay Kamat
6010ce69b9
Merge pull request #4408 from lyeoh/master
Strip fragment and query only for `:navigate up`
2018-11-12 21:12:53 -08:00
Jay Kamat
3e1bfc3e28
Fix 'in' vs 'equal' error 2018-11-12 18:35:11 -08:00
Florian Bruhin
3fd097066a Disallow spaces in search engine names 2018-11-08 12:43:53 +01:00
Ryan Roden-Corrent
2e562a926b
Don't complete url and title from same search word.
Resolves #4411:

> When opening a webpage, the suggested results will include those whose
> URL ends with the beginning of the string you've typed and whose title
> begins with the rest of the string.

By joining the url and title with a space, we ensure that the last word
of the url and the first word of the title are treated as separate
words.
2018-11-06 08:05:17 -05:00
Florian Bruhin
c09c34f465 Update _chromium_version comment for Qt 5.12 2018-11-05 18:58:52 +01:00
Florian Bruhin
6931f17f13 Add debug logging for netrc 2018-11-05 14:52:18 +01:00
lyeoh
8c7c686d3f Strip fragment and query only for :navigate up 2018-11-03 12:36:19 -05:00
Florian Bruhin
08278138c4 Add :yank markdown 2018-11-03 07:54:37 +01:00
Florian Bruhin
cac04d4001 Add workaround for accepting third-party cookies
An empty first-party URL is considered a first-party request. This workaround
is equivalent to the Qt fix: https://codereview.qt-project.org/#/c/244021/

Note that later versions of Chromium changed that check:
https://bugs.chromium.org/p/chromium/issues/detail?id=882107
That shouldn't be a problem since we disable our workaround with Qt 5.11.3, so
once Qt catches up there, the check isn't done anymore.

Fixes #4281
2018-10-31 08:54:29 +01:00
Florian Bruhin
e23b6ef64e Merge remote-tracking branch 'origin/pr/4382' 2018-10-30 08:56:03 +01:00
Jay Kamat
9c73bf9e97
Add tests for selection persisting
- Remove unneeded override of qt home method
2018-10-27 16:15:24 -07:00
Florian Bruhin
a52c24791d Release v1.5.2
(cherry picked from commit a42f37a0c6be5651073754dd6e62cd968df07130)
2018-10-26 10:21:28 +02:00
Florian Bruhin
a5dba34088 Set content.cookies.accept to all by default
Setting it to no-3rdparty is a nice idea from a "privacy by default"
perspective, but it also breaks various pages.

In particular, due to what's probably a Qt bug, it breaks the new GMail:
https://bugreports.qt.io/browse/QTBUG-71393

Let's be in line with what other browsers by default here.

Fixes #4281
2018-10-26 10:14:30 +02:00
Florian Bruhin
5ce1229ee5 Add temporary fix for test_caret.py flakiness
Fixes #4311
Conflicts with #4087, we might be able to revert this for that PR.
2018-10-26 10:05:44 +02:00
Florian Bruhin
c0dac51459 Merge remote-tracking branch 'origin/pr/4361' 2018-10-26 09:40:20 +02:00
Florian Bruhin
d1640ec064 Merge remote-tracking branch 'origin/pr/4362' 2018-10-26 09:35:21 +02:00
Florian Bruhin
cbc36666d0 Remove old _stop_timers 2018-10-26 09:33:00 +02:00
Florian Bruhin
20c9397b86 Merge remote-tracking branch 'origin/pr/4363' 2018-10-26 09:32:50 +02:00
Jay Kamat
11b5958bc4
Fix selection clearing when using <shift-home>
Closes #2886
2018-10-24 20:39:14 -07:00
Jay Kamat
078f5f9f1c
Fix dragging with visibility toggle 2018-10-24 20:00:08 -07:00
Christian Helbling
95e874fd26 simplify and clearly separate the toggling code from the code to remember the state before fullscreen 2018-10-20 11:29:04 +02:00
Christian Helbling
af0648dd59 remove superfluous blank line 2018-10-19 09:46:42 +02:00
Christian Helbling
ac1b59a311 revert 559059d and cd20c32 to fix #4349 (Exiting video player exits fullscreen) 2018-10-18 17:48:49 +02:00
user202729
c5f4587d4e Fix _partial_timer connection in modeparsers 2018-10-18 18:20:45 +07:00
user202729
1bcf57f630 Simplify logic in HintKeyParser.handle 2018-10-18 17:13:20 +07:00
Jay Kamat
8ca30df7d6
Cache hot config accesses for hints 2018-10-17 19:52:24 -07:00
user202729
6f505566b8 Fix docstring for HintManager.filter_hints 2018-10-17 23:44:03 +07:00
Florian Bruhin
5840b60967 Fix utils.ceil_log with invalid log values 2018-10-16 12:29:49 +02:00
Florian Bruhin
5b7615886b Merge remote-tracking branch 'origin/pr/4330' 2018-10-16 12:02:22 +02:00
Florian Bruhin
cde94e7356 Merge remote-tracking branch 'origin/pr/4332' 2018-10-16 11:38:28 +02:00
Florian Bruhin
e33d582764 Merge remote-tracking branch 'origin/pr/4342' 2018-10-16 11:16:36 +02:00
Florian Bruhin
965a2e2806 Remove unneeded win_id argument for HintManager.start 2018-10-16 11:09:27 +02:00
user202729
77f3ca8727 Optimize HintLabel.update_text 2018-10-15 22:44:40 +07:00
user202729
97bc4fa6a2 Add comment for explanation 2018-10-13 15:13:26 +07:00
user202729
622ef9294c Use integer arithmetic to compute ceil log 2018-10-13 13:49:08 +07:00
Jay Kamat
87dffa5afc
Update docs and fix style 2018-10-12 21:02:52 -07:00
Jay Kamat
2403a0fd73
Cache hot config accesses in completion 2018-10-12 18:23:36 -07:00
user202729
fad9c902c9 Fix _hint_scattered 2018-10-12 22:35:15 +07:00
Florian Bruhin
9d09aa1b40 Swap noun/verb in :config-{add,remove}-{dict-list}
See https://github.com/qutebrowser/qutebrowser/pull/4324#issuecomment-428934193
2018-10-11 14:29:10 +02:00
Florian Bruhin
1c1223821c Update docs 2018-10-11 14:18:02 +02:00
Florian Bruhin
019811f2cb Merge remote-tracking branch 'origin/pr/4324' 2018-10-11 14:16:06 +02:00
Florian Bruhin
49850b61ed Don't show no_autoconfig settings for :config-add-(list|dict) 2018-10-11 14:07:57 +02:00
Florian Bruhin
3e39fc0e69 Simplify HintManager.start 2018-10-11 14:01:47 +02:00
Milo Gertjejansen
9fd57b9be0 New config: More powerful :config- commands: remove
- `:config-remove-list` command to remove items from a list.
- `:config-remove-dict` command to remove items from a dict.
- Test coverage.

Continues #2794
2018-10-10 20:23:44 -05:00
Florian Bruhin
ae6fda3699 Release v1.5.1 2018-10-10 08:24:08 +02:00
Florian Bruhin
64b308ebeb Adjust workaround comment 2018-10-10 08:03:51 +02:00
Florian Bruhin
69d2433584 Remove TextBase.setText workaround
Reverts 561a7e1cdd
https://bugreports.qt.io/browse/QTBUG-36945 apparently got fixed at some point.
2018-10-10 07:56:59 +02:00
Florian Bruhin
d46b0cf3cd Update docs 2018-10-08 20:07:56 +02:00
Florian Bruhin
3fe64085f8 Add tabindex to default 'all' selector
See #178
2018-10-08 19:43:25 +02:00
Florian Bruhin
f36285658e Don't allow to set hints.selectors in autoconfig.yml
Also, set all settings temporarily for end2end tests.
This allows us to set things which aren't settable in autoconfig.yml.
2018-10-08 19:40:33 +02:00
Florian Bruhin
0423ec6f91 Add webelem.css_selector 2018-10-08 19:40:33 +02:00
Florian Bruhin
121483aa90 Add error handling for invalid selectors 2018-10-08 19:07:53 +02:00
Florian Bruhin
6d4c8f5b13 Merge remote-tracking branch 'origin/pr/3806' into test 2018-10-08 18:09:58 +02:00
Florian Bruhin
91ae86db62 Merge remote-tracking branch 'origin/pr/3950' 2018-10-08 17:36:10 +02:00
Florian Bruhin
6168622de3 Update docs 2018-10-07 17:12:01 +02:00
Florian Bruhin
7cea4e3262 Merge remote-tracking branch 'origin/pr/4283' 2018-10-07 17:00:12 +02:00
Florian Bruhin
b130162d56 Fix crash when closing tab during a search 2018-10-07 15:46:40 +02:00
Milo Gertjejansen
bcfc8fa3a8 New config: More powerful :config- commands: add #4283
Missed a small comment change.

Continues #2794
2018-10-06 19:45:36 -05:00
Milo Gertjejansen
a3528dcee8 New config: More powerful :config- commands: add #4283
Made minor changes to the second commit which broke tests out into
success and failure tests taking advantage of pytests.raises.

Additionally updated several grammar issues.

Continues #2794
2018-10-06 19:42:30 -05:00
Jay Kamat
2f21551322
Cache config accesses in minimumTabSizeHint 2018-10-06 14:13:23 -07:00
Florian Bruhin
c689760872 Sort keys in configtypes.Dict.to_str
Otherwise, we get inconsistent output between runs on Python 3.5
2018-10-06 19:18:43 +02:00
Florian Bruhin
4b76dc56e1 Merge remote-tracking branch 'origin/pr/4296' 2018-10-06 12:24:02 +02:00
Florian Bruhin
587b11f60d Make completion highlighting case-insensitive again
Fixes #4297
2018-10-06 09:57:01 +02:00
Jay Kamat
2f155e5d2b
Fix tabs appearing when updating all tab titles
Closes #4295
2018-10-05 18:55:30 -07:00
Florian Bruhin
5fd20da915 Update docs 2018-10-06 00:13:58 +02:00
Florian Bruhin
c6dc9206e6 Handle invalid QUrl objects in HostBlocker.is_blocked
For some requests, we don't know a first party URL, so we get an invalid QUrl
object from QtWebKit/QtWebEngine.

However, the config system wants either a valid QUrl or None (for the global
value), so we don't accidentally pass an invalid QUrl in. Thus, do the
conversion here.
2018-10-06 00:13:58 +02:00
Florian Bruhin
14957c75ff Merge remote-tracking branch 'origin/pr/4046' 2018-10-05 23:36:40 +02:00
Florian Bruhin
c225e724ac Merge remote-tracking branch 'origin/pr/4133' 2018-10-05 22:56:53 +02:00
Florian Bruhin
bb35285914 Fix passing filename to GreasemonkeyScript 2018-10-05 19:25:19 +02:00
Florian Bruhin
4b13609553 Fix lint 2018-10-05 18:50:14 +02:00
Florian Bruhin
81e5173c9c Fix getting searchengines in URL model 2018-10-05 17:51:04 +02:00
Florian Bruhin
42ef645cf1 Merge remote-tracking branch 'origin/pr/4004' 2018-10-05 17:46:49 +02:00
Florian Bruhin
1e8bb202e9 Make :q only close the active window
Closes #4061
Fixes #1089
2018-10-05 17:31:00 +02:00
Florian Bruhin
2c3f144cd5 Update docs 2018-10-05 17:21:36 +02:00
Florian Bruhin
fddb10e157 Merge remote-tracking branch 'origin/pr/4008' 2018-10-05 17:15:42 +02:00
Florian Bruhin
5eb0447fec Update docs 2018-10-05 16:21:02 +02:00
Florian Bruhin
95f816c224 Merge remote-tracking branch 'origin/pr/4292' 2018-10-05 16:20:08 +02:00
Florian Bruhin
616cd0a59c Fix and test remaining PDF.js OSError issues 2018-10-05 16:06:39 +02:00
Florian Bruhin
b5b4fda676 Fix issues with PDF.js path changes 2018-10-05 14:05:54 +02:00
Milo Gertjejansen
7f0ae252cd New config: More powerful :config- commands: add #4283
Made requested changes:

- Separated list add and dict add commands.
- Separated list and dict completion models.
- Created tests for each command.
- Simplified the configmodel options by breaking them into a separate
function to do work that is similar.
- General simplification of both add commands.

Continues #2794
2018-10-04 18:42:33 -05:00
Viacheslav Chimishuk
8e2723fa77 Add yank --quiet option support. 2018-10-04 21:41:17 +03:00
Florian Bruhin
6c245ca7a0 Merge remote-tracking branch 'origin/pr/4220' 2018-10-04 19:34:03 +02:00
Florian Bruhin
8a3704fbe4 Update docs 2018-10-04 19:33:02 +02:00
Florian Bruhin
923b726e38 Merge remote-tracking branch 'origin/pr/4220' 2018-10-04 19:28:01 +02:00
Florian Bruhin
5514ddeed5 Log OSError for PDF.js more explicitly
Closes #4289
2018-10-04 16:54:44 +02:00
Florian Bruhin
659be2296f Don't log stacktraces for qute:// errors 2018-10-04 16:54:44 +02:00
Florian Bruhin
29142f763c Use a proper data dir for PDF.js 2018-10-04 16:54:44 +02:00