Commit Graph

947 Commits

Author SHA1 Message Date
Florian Bruhin
9a5839650c Allow 'yes' value for geolocation/notifications.
Fixes #655.
2015-05-06 22:21:11 +02:00
Florian Bruhin
024549e3b0 Use a namedtuple for authentication prompts. 2015-05-06 11:05:17 +02:00
Florian Bruhin
842c69dfdd Cache proxy authentication credentials. 2015-05-06 10:46:42 +02:00
Artur Shaik
489c913e58 Implement caret selection and positioning
Added option to webview for selection enabled caret mode.
In status bar checking value of this option to identificate about it.

Added bindings: <Space> for toggle selection mode, <Ctrl+Space> drop
selection and keep selection mode enabled.

In webview added javascript snippet to position caret at top of the
viewport after caret enabling. This code mostly was taken from cVim sources.
2015-05-05 12:21:48 +06:00
Florian Bruhin
32562c6878 Fix lint. 2015-04-28 16:50:42 +02:00
Florian Bruhin
9e8c781871 Use clearFocus/setFocus as workaround. 2015-04-28 16:12:23 +02:00
Florian Bruhin
640f758605 Merge branch 'master' into visual
Conflicts:
	qutebrowser/browser/commands.py
2015-04-28 15:54:26 +02:00
Florian Bruhin
e1f2259e98 Fix typo. 2015-04-22 07:46:01 +02:00
Florian Bruhin
c21ae0b651 Add a :debug-webaction command. 2015-04-22 07:13:56 +02:00
Florian Bruhin
6c8e073dc8 Merge branch 'caret_visual_mode' of https://github.com/artur-shaik/qutebrowser into visual
Conflicts:
      qutebrowser/browser/commands.py
      qutebrowser/browser/webview.py
      qutebrowser/config/configdata.py
2015-04-21 21:29:00 +02:00
Florian Bruhin
9ee74253e4 Remove name annotation for cmdutils.register.
See #637.
2015-04-20 22:25:27 +02:00
Florian Bruhin
b805f903c9 Fix lint. 2015-04-20 20:50:51 +02:00
Florian Bruhin
f7cf33b596 Remember web inspector geometry in state file. 2015-04-20 20:40:03 +02:00
Florian Bruhin
7439586334 Move special params to cmdutils.register decorator
See #637.
2015-04-20 19:33:05 +02:00
Florian Bruhin
8f1b074595 Show commandline being executed with :spawn.
Closes #616.
2015-04-20 18:44:58 +02:00
Florian Bruhin
f93eef848c Store QUTE_TEXT/QUTE_HTML in files for userscripts.
Fixes #644.
2015-04-20 07:50:47 +02:00
Florian Bruhin
38d34e1dea Fix deprecation message for :cancel-download. 2015-04-17 14:33:45 +02:00
Florian Bruhin
4436941d97 Clean up unused imports. 2015-04-17 08:00:56 +02:00
Florian Bruhin
006b7716c8 Move WebPage init out from QWebView's __init__. 2015-04-17 08:00:15 +02:00
Florian Bruhin
ffd1e673b3 Get rid of SearchRunner.
A SearchRunner was per-mainwindow, which caused bugs when searching in a tab
and in another before clearing the search.

Instead we now split it between WebView/CommandDispatcher.

Fixes #638.
2015-04-17 07:51:21 +02:00
Florian Bruhin
71ffe8f656 Use config.get() for qute:settings.
Fixes #628.
2015-04-16 22:20:38 +02:00
Florian Bruhin
f313bcaf13 Fix for cache never being saved.
This is a regression introduced in 76c5c8bf8e.
See #43.
2015-04-15 06:54:55 +02:00
Florian Bruhin
9381aac501 Merge {Pastebin,PyPIVersion}Client into HTTPClient. 2015-04-13 20:42:28 +02:00
Artur Shaik
e603d9a2d0 Slight modify of autofocus caret
Make mouseclick event point slightly down.
Add commented tries of more reliable methods of caret focusing.
2015-04-13 19:55:45 +06:00
Florian Bruhin
e294e325f0 Ignore invalid history entries on start. 2015-04-10 06:40:48 +02:00
Artur Shaik
695712e50c Basic caret and visual modes implementation
Allow user switch in caret mode for browsing with caret, and visual mode
for select and yank text with keyboard.

Default keybindings is c or v for caret mode, and again v for visual mode. All
basic movements provided by WebAction enum implemened with vim-like
bindings. Yanking with y and Y for selection and clipboard respectively.

There is bug/feature in WebKit that after caret enabled, caret doesn't
show until mouse click (or sometimes Tab helps). So I add some workaround
for that with mouse event. I think should be better aproach.

Signed-off-by: Artur Shaik <ashaihullin@gmail.com>
2015-04-09 22:55:42 +06:00
Florian Bruhin
7160a89cb9 Fix NameError in hints.py. 2015-04-09 17:47:09 +02:00
Florian Bruhin
2d8df76609 Add $QUTE_HTML and $QUTE_TEXT for userscripts. 2015-04-09 17:45:16 +02:00
Florian Bruhin
2876ba5cfa Pass a parent to global QObjects. 2015-04-06 00:10:37 +02:00
Florian Bruhin
9f9996bc66 Refuse to add empty URLs to history. 2015-04-02 09:09:17 +02:00
Florian Bruhin
37ab5296a7 Adjust URL completion when quickmarks are changed.
Fixes #590.
2015-04-02 07:40:00 +02:00
Florian Bruhin
8ebac8d38c Various spelling fixes. 2015-03-31 21:11:47 +02:00
Florian Bruhin
2f629befc3 Add an option to disable host blocking. 2015-03-30 18:33:10 +02:00
Florian Bruhin
70ccdd86b2 Add zooming with Ctrl-mousewheel.
Closes #51.
2015-03-30 15:26:07 +02:00
Florian Bruhin
a38c3ae1e1 Add a :tab-detach command.
See #62.
2015-03-30 12:14:15 +02:00
Florian Bruhin
5233e7fac8 Fix UnboundLocalError on invalid quickmarks.
This also improves FuzzyUrlError messages.
2015-03-29 21:20:42 +02:00
Florian Bruhin
b2427701fa Handle element webFrame being None when hinting. 2015-03-29 19:52:30 +02:00
Florian Bruhin
d062ff5138 Fix starting with -c '' again.
Before c5a2039da4 (standarddir refactoring), we
only checked the commandline arguments for the config file, but not when
getting the quickmarks location (as the 'args' argument was None). This means
quickmarks were saved to the default config dir even with -c ''.

With that commit, this was "fixed" accidentally, but quickmarks couldn't handle
the filename being None.
2015-03-27 12:29:12 +01:00
Florian Bruhin
82322beb03 Fix pep257 issues. 2015-03-26 07:08:54 +01:00
Florian Bruhin
ec487dd6b1 Add some logging for javascript messages. 2015-03-24 11:35:58 +01:00
Florian Bruhin
21d2bb2291 Simplify some unneeded lambdas. 2015-03-23 07:04:50 +01:00
Florian Bruhin
8811947f50 Re-enable some pylint checks. 2015-03-23 07:04:41 +01:00
Florian Bruhin
157c25bb13 Queue messages for 'current' window if unfocused.
Fixes #512.
2015-03-22 22:39:56 +01:00
Florian Bruhin
565303ebcd Fix hinting when page has no URL set yet. 2015-03-20 08:35:33 +01:00
Florian Bruhin
adb11360db Disallow tab=None with objreg.get(scope='tab').
This would've made it a lot easier to detect #563.
2015-03-19 22:28:24 +01:00
Florian Bruhin
218822d6e8 Clear rejected SSL questions when reloading page.
Fixes #565.
2015-03-19 21:21:40 +01:00
Florian Bruhin
d6732c64a3 Revert "Handle NavigationTypeOther acceptNavigationRequest"
This reverts commit 4b4bb3af88.

Fixes #567. #488 is still okay because of
f3b55d68db05247b5c3f5dc576dadb0aa1848ca3.
2015-03-19 19:06:58 +01:00
Florian Bruhin
94bc10405a Merge branch 'histcomplete' 2015-03-17 06:16:26 +01:00
Florian Bruhin
1aaa538b45 Ignore empty lines in history. 2015-03-16 10:45:50 +01:00
Florian Bruhin
806742abd3 Move new entries to the end when loading history.
Before, if an URL was present early in the history and then again later, we
didn't move it to the end of the OrderedDict. This means it won't be loaded in
the completion.
2015-03-16 07:54:39 +01:00
Florian Bruhin
553d8cf986 Also save the QUrl in a HistoryEntry.
We also use QUrl::toDisplayString for the completion so things like spaces or
umlauts are decoded properly.
2015-03-16 07:03:30 +01:00
Florian Bruhin
d266665955 Fix adding of URLs to history completion.
Before, the item_added signal was emitted *after* an item was added, which
means the on_history_item_added slot always assumed the item already is in the
history.
2015-03-15 21:16:45 +01:00
Florian Bruhin
901db0911e Add __len__ to WebHistory. 2015-03-13 19:45:43 +01:00
Florian Bruhin
994546f04d Use an OrderedDict for WebHistory.
We need the URLs in the correct order to get the newest items anyways.
2015-03-13 19:44:15 +01:00
Florian Bruhin
7a28b6c821 Fix lint. 2015-03-12 14:55:54 +01:00
Florian Bruhin
299dbfa56a history: Remove unneeded _old_hit and _old_miss.
The need for those were removed in #548.
2015-03-12 14:46:49 +01:00
Jimmy
61e732f217 history: simplify 2015-03-12 21:35:56 +13:00
Jimmy
1efe18ecc6 Prevent duplicates in history completion.
Two things here. One is to use `WebHistory._new_history` only as a to-save
queue, so we now add entries to `_old_urls` when they are first created and
can now no longer iterate of `_new_history` in `__iter__()`.

Second is to stop blindly tacking new history entries on the end of the
history completion model. It does involve iterating over the model to find the
existing entry but we only do that if we know the duplicate is there, which is
fast to check.

This also ads another point of mutation to the history completion model which
may prove problematic if it leads to more segfaults.
2015-03-12 20:15:03 +13:00
Jimmy
734268187c Clean up incomprehensible comment. 2015-03-12 20:12:59 +13:00
Florian Bruhin
9ee19be70d Convert the atime to float in HistoryEntry. 2015-03-12 08:07:40 +01:00
Florian Bruhin
34b24aafa8 Fix lint 2015-03-11 22:22:49 +01:00
Jimmy
834832e3ba Web history changed signal now emits the new entry.
Each new HistoryEntry is emitted after being added to the global history
store. Current members of the HistoryEntry are `url` and `atime`. `title`
should be coming soon.
2015-03-11 21:50:16 +01:00
Jimmy
59948a038c Add new UrlCompletion model which includes web history and quickmarks.
I went to some effort to avoid duplipcating code which which leads to some
arguably ugly class method calling.
2015-03-11 21:50:16 +01:00
Jimmy
f6a7ef3985 Add url history completion for open.
Adds a basic completion model implementation around the global browser
history and registers that for the open command.

Modifies WebHistory to add an __iter__ method and to use a dict instead of a
set to store an entire HistoryEntry for each archived item instead of just the
URL. Brief tests showed that the lookup time for set and dict are very
similar. They are at least on the same order of magnitude. Testing membership
of a list on the other hand, as was the case before a set was used, was four
orders of magnitude slower on my machine.
2015-03-11 21:50:16 +01:00
Florian Bruhin
e8e6d8409b Adjust pylint exceptions. 2015-03-11 20:14:39 +01:00
Florian Bruhin
1ead66a4d5 quickmarks: Ignore empty and whitespace-only lines. 2015-03-10 23:25:02 +01:00
Florian Bruhin
d87a1bb2b4 Add a hints -> scatter option.
This is enabled by default to keep the same default behaviour which is like
Vimium - mixing e.g. single-char letters and double-char letters, and
scattering/shuffling the labels to have an uniform hint key distribution.

If disabled, the behaviour is more similiar to dwb, which has a fixed hint
string length and simply fills the string starting with the first possible hint
char.
2015-03-10 21:19:47 +01:00
Florian Bruhin
2f0522ebb0 Add a --rapid option to :hint, remove rapid target
This makes it possible to use rapid hinting for the run/hover/userscript/spawn
targets as well, and makes more sense anyways.
2015-03-10 19:40:30 +01:00
Florian Bruhin
4b6d49e926 Make QSslError hashable for Qt <= 5.4.
PyQt uses qHash() for __hash__, and qHash for QSslError was added with Qt 5.4.

This means 2da45e98ca raised TypeError there as
QSslError is unhashable.

For those older Qt versions, we implement __hash__ ourselves which does about
the same thing as Qt does, combining the DER (binary) representation of the
certificate and the error() (which is just a QEnum, hashable as int).
2015-03-10 08:29:56 +01:00
Florian Bruhin
2da45e98ca Auto-handle equal SSL errors for the same host.
For every (scheme, host, port) tuple, we save all SSL errors we asked the user
about, and if everything matches (scheme, host, port, error, certificate), we
don't ask the user again.

Fixes #422.
2015-03-10 07:58:40 +01:00
Florian Bruhin
9ffb30a16f Ignore RuntimeError in mouserelease_insertmode.
It seems when clicking certain elements, the webview can get deleted before the
singleShot QTimer will activate.
2015-03-09 11:49:01 +01:00
Florian Bruhin
e78fa431c5 Hide Qt warning when aborting download reply. 2015-03-09 07:49:02 +01:00
Florian Bruhin
6a16875f50 Fix retrying of downloads from closed tabs.
Fixes #502.
2015-03-09 07:39:40 +01:00
Florian Bruhin
27f4ada799 Add AppendLineParser and use it in WebHistory.
The former approach (always reading the whole history from disk) was rather
inefficient, and we had performance problems e.g. when marking text in Qt
documentation.
2015-03-08 21:53:42 +01:00
Florian Bruhin
99de995813 Rename/move config.parsers.line.LineConfigParser.
It's now misc.lineparser.LineParser since it handles other stuff than just
config.
2015-03-08 21:53:42 +01:00
Florian Bruhin
ee8beb174d Fix :tab-clone -w (i.e. back -w). Fixes #536. 2015-03-08 15:02:18 +01:00
Florian Bruhin
cd34562d34 Fix :tab-clone with tabs -> tabs-are-windows=true.
See #536.
2015-03-08 14:54:42 +01:00
Joel Torstensson
0fb74da4ff Can now handle relative paths. 2015-03-05 23:44:12 +01:00
Joel Torstensson
d449a60078 Fixed bug using download dirs with trailing slash. 2015-03-05 20:33:02 +01:00
Joel Torstensson
9cfa34c009 Readded suggested_filename fallback. 2015-03-05 20:17:48 +01:00
Joel Torstensson
7d48845afa Made static functions private. 2015-03-04 23:05:23 +01:00
Joel Torstensson
4e7e97232e Downloads using get_request specifying only path now works. 2015-03-04 12:24:26 +01:00
Joel Torstensson
49c666a4a8 get_request is now correct. 2015-03-04 12:06:08 +01:00
Joel Torstensson
68774a2c75 Style fixes. 2015-03-04 11:31:54 +01:00
Joel Torstensson
8e0c1cff7b Made download suggestion configurable.
Fix #505
2015-03-04 11:31:54 +01:00
Joel Torstensson
82deaeed2e Downloads now shows path in question. 2015-03-04 11:29:36 +01:00
Florian Bruhin
40af99bacc Clear open target in acceptNavigationRequest.
This is a regression introduced in a76868c0f4.
Fixes #530.
2015-03-03 23:28:45 +01:00
Gregor Pohl
c8c095d499 Add Opera-like mouse rocker gestures. 2015-03-03 12:58:32 +01:00
Florian Bruhin
f19eba3b40 Don't log cur_link_hovered signals. 2015-03-03 09:07:30 +01:00
Florian Bruhin
21ab5f8685 Add logging for acceptNavigationRequest. 2015-03-03 09:06:43 +01:00
Florian Bruhin
072210c47b Log rfc6266 UnicodeDecodeError to correct logger. 2015-02-27 12:35:46 +01:00
Florian Bruhin
bfd0a3fbc2 Fix AttributeError when doing extended hinting. 2015-02-27 08:44:44 +01:00
Florian Bruhin
561ebd07f9 Make it possible to use :open -[twb] without url. 2015-02-27 08:10:00 +01:00
Florian Bruhin
6d51fcfb2e Add a do_search argument to fuzzy_url.
This turns off searching no matter what autosearch is set to, and also makes it
possible to use fuzzy_url before the config is up.

For now, we use this for quickmarks and the startpage.
2015-02-27 08:07:40 +01:00
Florian Bruhin
a76868c0f4 Refactor how click/hint open targets are handled. 2015-02-26 20:41:04 +01:00
Florian Bruhin
eb8bad3d18 Reset open_target in acceptNavigationRequest.
After ddb39275eb, when something was opened via
hints in a new tab, the open_target still was set afterwards and the next
regular open did open in a new tab.
2015-02-26 20:17:01 +01:00
Florian Bruhin
a12dee8898 hints: Include button in buttons().
From the QMouseEvent::buttons documentation:

    For mouse move events, this is all buttons that are pressed down. For mouse
    press and double click events this includes the button that caused the
    event. For mouse release events this excludes the button that caused the
    event.
2015-02-26 20:12:48 +01:00
Florian Bruhin
ddb39275eb Simulate Ctrl-click when hinting in new tab/win.
This works around the fact some pages (e.g. github) load their content via AJAX
on a normal left click, so we'll never get acceptNavigationRequest and thus
can't open them in a new tab.

Fixes #488.
2015-02-26 20:11:13 +01:00
Florian Bruhin
4b4bb3af88 Handle NavigationTypeOther acceptNavigationRequest
This fixes hinting in some cases where javascript is used to load content, e.g.
on duckduckgo. However it still doesn't seem to help with github files etc.

See #488.
2015-02-26 20:04:00 +01:00
Florian Bruhin
fcbd69e209 Clean up standarddir handling #2.
We already attempted this in c5a2039da4, but
having the directories as module attributes means they'll be created on start
(rather than when they're actually used), and it'd also be impossible to change
them after init for some reason in the future.

To still have a nice short API, we simply change the attributes to functions.
2015-02-26 07:01:22 +01:00
Florian Bruhin
0d9bf5e2c9 Fix lint. 2015-02-26 06:13:27 +01:00
Samir Benmendil
81af41d77f Add option to set minimum number of chars in hints 2015-02-26 00:49:50 +00:00
Florian Bruhin
1d27dcca81 Ignore RuntimeError because of deleted Question. 2015-02-25 23:12:23 +01:00
Florian Bruhin
31d9018fc4 Disable insecure SSL ciphers (< 128bit) for Qt 5.2.
This is only an issue for the users which are stuck on Ubuntu Trusty.
2015-02-25 21:07:44 +01:00
Florian Bruhin
0fcd016427 Move cursor to end of textboxes when hinting. 2015-02-25 19:56:03 +01:00
Florian Bruhin
94434ea739 Decorate DownloadItem slots with @pyqtSlot.
Before, using the right-click menu to cancel the download didn't actually
cancel it, as the QAction.toggled signal was emitted with checked=False which
got interpreted as remove_data=False.
2015-02-23 10:01:37 +01:00
Florian Bruhin
c5a2039da4 Refactor QStandardPaths handling. 2015-02-22 19:13:51 +01:00
Florian Bruhin
634028e277 Fix QIODevice warnings when closing tabs.
This is a regression introduced in 43c9d69295.
Fixes #517.
2015-02-20 07:43:40 +01:00
Florian Bruhin
87951ee3a8 Fix crash when closing tabs on Qt 5.2.1 (Trusty)
This issue was introduced in 8f1d81a644.
2015-02-19 22:20:39 +01:00
Florian Bruhin
b31a432a1a Add options to ignore javascript prompts/alerts.
New options: content -> ignore-javascript-{prompt,alert}.
2015-02-17 19:03:18 +01:00
Florian Bruhin
238761bd5b Don't write zoom to QWebHistory.
If we set the zoom, it seems WebCore sets its own zoom independent of the
QtWebKit zoom, which leads to funny effects.
2015-02-17 07:48:19 +01:00
Florian Bruhin
56b0ae2b6e Get rid of mainwindow.MainWindow.spawn. 2015-02-16 22:56:12 +01:00
Florian Bruhin
d8fe62bc61 Add workaround for adblock-message without window. 2015-02-16 22:21:36 +01:00
Florian Bruhin
8f1d81a644 Add session support.
Closes #12.
See #499.
See #11.

This adds PyYAML as a new dependency.

It adds the following new commands:

    :session-delete <name>
    Delete a session.

    :session-load <name>
    Load a session.

    :session-save [<name>]
    Save a session.

    :wq [<name>]
    Save open pages and quit.

And the following new settings:

    general -> save-session:
    Whether to always save the open pages.
2015-02-16 20:26:09 +01:00
Florian Bruhin
8e2e996369 Merge branch 'download_cmd_interface' of https://github.com/oed/qutebrowser into oed-download_cmd_interface 2015-02-14 19:06:47 +01:00
Joel Torstensson
4d2aa6a4d4 Fixed errors in update_indexes, etc. 2015-02-14 14:11:38 +01:00
Florian Bruhin
66d3ec1c08 Make it possible to configure tab titles. 2015-02-13 23:57:31 +01:00
Florian Bruhin
e459e1a472 Fix loading of history with URLs containing spaces
Fixes #508.
2015-02-13 18:58:44 +01:00
Joel Torstensson
049a360abc Fixed error messages. 2015-02-13 12:40:37 +01:00
Joel Torstensson
dfb801a0b7 dataChanged is now emited in update_indexes. 2015-02-12 23:29:05 +01:00
Joel Torstensson
9f0658f191 Minor fixes. 2015-02-12 22:21:30 +01:00
Joel Torstensson
8cd5f9e6d1 Implemented :download-delete. 2015-02-12 22:20:22 +01:00
Joel Torstensson
dd995c434c :download-cancel now only cancels downloads that are done. 2015-02-12 21:17:23 +01:00
Joel Torstensson
1f39200b28 :download-open and :download-remove now complains if you try to execute on a download that is not done. 2015-02-12 21:05:53 +01:00
Joel Torstensson
91f7056649 Added indexes to download view. 2015-02-12 20:43:13 +01:00
Joel Torstensson
658ab70e98 :download-open now also checks whether download was successful. 2015-02-11 22:13:29 +01:00
Florian Bruhin
d4ef66714f Deny HTML5 permissions when question is cancelled.
Before we just ignored the request but deleted the Question object, which lead
to a RuntimeError when the question was cancelled and the page was reloaded,
because on_permission_canceled tried to abort the question.
2015-02-10 21:15:17 +01:00
Florian Bruhin
e44c5aee5b Add config options for geolocation/notifications. 2015-02-10 21:09:08 +01:00
Joel Torstensson
6e3d5867f9 Fixed docs. 2015-02-09 17:38:50 +01:00
Joel Torstensson
55193803a1 Changed :downloads-clear to :download-remove. 2015-02-09 17:17:34 +01:00
Joel Torstensson
e9da7b5391 :download-open now only opens finished downloads. 2015-02-09 17:03:02 +01:00
Florian Bruhin
43c9d69295 Handle shutdown of page with prompt correctly.
Before we didn't cancel javascript prompts when a page was closed, which lead
to exceptions or segfaults.
2015-02-09 15:41:27 +01:00
Florian Bruhin
bc43fb5e4c Implement requests for geolocation/notifications.
Closes #503.
2015-02-09 15:32:26 +01:00
Joel Torstensson
767ca42e46 Some style fixes. 2015-02-09 12:06:49 +01:00
Florian Bruhin
494825fed0 Don't log statusbar messages in signalfilter. 2015-02-09 07:50:32 +01:00
Florian Bruhin
4704e81b41 Don't log javascript console messages by default. 2015-02-09 07:46:31 +01:00
Joel Torstensson
6bbb655a54 Fixed bug when specifying filename on download. 2015-02-08 22:21:34 +01:00
Joel Torstensson
9428338389 Merged :download and :download-page.
Fix #449
2015-02-08 22:08:16 +01:00
Joel Torstensson
6f89ab628b More command actions on downloads. 2015-02-08 22:03:29 +01:00
Florian Bruhin
31e71ed6d9 Fix copyright years.
Files created in 2015 don't need to have 2014 as copyright year.
2015-02-06 00:21:57 +01:00
Florian Bruhin
5ed592a447 Replace some QTimers by named Timers. 2015-02-05 07:17:58 +01:00
Florian Bruhin
cbde36948a Abort download override question on error/cancel.
If a download error occured or the user cancelled the download during the file
override question, an exception occured as the download was no longer valid
when the question was answered.

See #416.
2015-02-02 06:53:55 +01:00
Florian Bruhin
18b58b2001 Set a higher z-index for hint labels.
This fixes hinting on the youtube top bar.

Fixes #496.
2015-02-02 06:35:45 +01:00
Florian Bruhin
9b1729c77e Always write config files to disk on first start. 2015-02-01 23:47:40 +01:00
Florian Bruhin
dc6aaecc78 Add __getitem__ to WebHistory. 2015-02-01 23:12:02 +01:00
Florian Bruhin
33a2181e31 Record global page history to disk.
We currently don't do anything with it yet, but people could use it in scripts
already and we have the history later when completion or other stuff will be
added based on it.

See #33.
2015-02-01 22:27:58 +01:00
Florian Bruhin
43c5dc3bf6 Refactor saving logic, only save stuff if modified.
Fixes #113.
See #11.
2015-02-01 00:43:07 +01:00
Florian Bruhin
d6e87a2672 Hide adblocked iframes.
We now hide iframes which have been blocked completely instead of displaying an
error page in there. Displaying the error page also did break back/forward,
e.g. on reddit.

Fixes #493.
2015-01-31 22:38:31 +01:00
Florian Bruhin
9736224fa6 Close contextmenu when closing tab to avoid crash.
Fixes #494.
2015-01-31 21:01:03 +01:00
Florian Bruhin
55649882a0 Revert "Paste primary selection into forms on Shift-Insert."
This reverts commit 68a0428a09.

Even if this works fine for me, various people reported segfault issues when
using Shift-Insert, so I'm reverting this for now until I find a proper
solution.

See #491.
2015-01-30 11:50:05 +01:00
Florian Bruhin
c40e70ed11 Revert "Also copy QByteArray of clipboard data."
This reverts commit 4138debd1e.

It seems even with this, there are still weird segfault issues.

See #491.
2015-01-30 11:48:40 +01:00
Florian Bruhin
4138debd1e Also copy QByteArray of clipboard data.
This could possibly fix segfaults some people have seen when pasting after
68a0428a09.

See #491.
2015-01-30 06:42:55 +01:00
Florian Bruhin
b721a0e992 Clean up NetworkManager after downloads finished.
Fixes #490.
2015-01-28 22:52:24 +01:00
Florian Bruhin
1526cf1532 Merge branch 'master' of ssh://tonks/qutebrowser 2015-01-28 08:43:48 +01:00
Florian Bruhin
68a0428a09 Paste primary selection into forms on Shift-Insert.
Closes #491.
2015-01-28 06:56:38 +01:00
Florian Bruhin
4c87287f4e Don't set up on_ssl_errors slot without SSL. 2015-01-26 13:23:41 +01:00
Florian Bruhin
bc380fca61 Clone zoom factor when cloning tab. 2015-01-26 07:20:03 +01:00
Florian Bruhin
ab2d2d79ca Clone text/icon as well when cloning tabs.
Closes #316.
2015-01-26 07:18:07 +01:00
Florian Bruhin
6576796718 Fix retrying of downloads after the tab is closed. 2015-01-25 23:53:23 +01:00
Florian Bruhin
b387b4c7a9 Merge branch 'master' of ssh://git/qutebrowser 2015-01-22 10:41:58 +01:00
Florian Bruhin
5c92144f6b Fix spawn --userscript with multiple args.
This is a regression introduced in 4485e4ee1b.

We didn't unpack the argument list properly before passing it to
run_userscripts.

Fixes #476.
See #448.
2015-01-22 07:10:32 +01:00
Florian Bruhin
aae33a0308 Handle another webelem.IsNullError with hints. 2015-01-16 09:09:12 +01:00
Florian Bruhin
4485e4ee1b Merge :run-userscripts into :spawn.
:run-userscripts is now marked as deprecated, and :spawn has a new
-u/--userscript option instead.

Closes #448.
2015-01-15 22:29:06 +01:00
Florian Bruhin
3eac528716 Switch Qt style to Fusion on OS X on Qt 5.4.
Fixes #462.
See #459.

Upstream bugs:

https://bugreports.qt.io/browse/QTBUG-42948
https://bugreports.qt.io/browse/QTBUG-43070
2015-01-09 15:43:03 +01:00
Florian Bruhin
5947994479 Fix error handling for local files in :adblock-update 2015-01-09 06:53:00 +01:00
Florian Bruhin
77df4c7241 Add !important to all hint properties. 2015-01-06 17:10:54 +01:00
Error 800
82ee78b3db Added !important to hint styles
Prevents websites from overriding hint styles
2015-01-06 16:23:45 +01:00
Error 800
c008ee8dd7 Added !important to hint styles
Prevents websites from overriding hint styles
2015-01-06 16:13:28 +01:00
Error 800
ce5629eab3 Fixed uppercase hints option
Corrected CSS property from 'texttransform' to 'text-transform'
2015-01-05 16:20:45 +01:00
Florian Bruhin
efe96462c9 Pass more useful information to userscripts.
Closes #379.
2015-01-04 20:16:15 +01:00
Florian Bruhin
013f906c3b hints: Small cleanup (add _show_url_error method). 2015-01-04 20:15:45 +01:00
Florian Bruhin
b8a04f5309 Don't raise CommandError in TabbedBrowser.current_url.
TabbedBrowser.current_url used to process the qtutils.QtValueError exception
and raise a cmdexc.CommandError based on it. While this was useful for some
callers, it made handling it in others weird, and it doesn't really belong
there - so now the caller handles this.
2015-01-04 20:13:25 +01:00
Florian Bruhin
04c8a17b2e Merge branch 'userscript-runner' 2015-01-04 15:21:31 +01:00
Florian Bruhin
2203db298d Abort blocking questions when new page is loaded.
Fixes #430.
Fixes #431.
Hopefully fixes #354.
Hopefully fixes #434.
2015-01-03 22:21:47 +01:00
Florian Bruhin
f811f511fa Use self._win_id in QNetworkManager._ask. 2015-01-03 22:04:56 +01:00
Florian Bruhin
7dbbfedd3b Replace unencodable chars in download filenames.
Fixes #427.
2015-01-03 17:50:59 +01:00
Florian Bruhin
450d1ab70d Update copyright years 2015-01-03 15:51:31 +01:00
Florian Bruhin
4471f81c11 Expand ~ to home dir with :run-userscript. 2014-12-29 22:17:58 +01:00
Florian Bruhin
0cd0f97587 Call triggerAction on page, not view. 2014-12-29 22:12:09 +01:00
Florian Bruhin
0ea25c6ef0 Add missing imports 2014-12-29 22:04:09 +01:00
HalosGhost
0a1fa87ac9 Add -f option to reload 2014-12-29 22:03:54 +01:00
Florian Bruhin
ed253f23c6 Pass window id to DownloadItem. 2014-12-28 02:00:31 +01:00
Florian Bruhin
60cc70151c Merge branch 'prevent_downloading_existing_file' of https://github.com/oed/qutebrowser into oed-prevent_downloading_existing_file 2014-12-28 01:57:14 +01:00
Florian Bruhin
03ac8874ff Rewrite keymode handling to use only one mode.
Fixes #417.
Fixes #418.
See 4ab5d2df28.
2014-12-28 00:01:27 +01:00
Joel Torstensson
6c6ae4e465 Refactored question logic. 2014-12-27 00:50:52 +01:00
Joel Torstensson
f0779f8cc0 User now asked if it wants to overwrite existing file.
Fix #318
2014-12-26 21:58:45 +01:00
Florian Bruhin
769bc65343 Fix name collision. 2014-12-26 15:09:27 +01:00
Florian Bruhin
5d0dd5b11b Fix AttributeError on config changes on Ubuntu.
Fixes #390.
2014-12-26 12:25:42 +01:00
Florian Bruhin
b01041e455 Set zoom to default instead of 100% with :zoom/=. 2014-12-22 18:04:28 +01:00
Florian Bruhin
f50a19a488 Adjust page zoom if default zoom changed.
Fixes #393.
2014-12-22 18:01:32 +01:00
Florian Bruhin
3752733f15 Actually connect QWebView.on_config_changed slot. 2014-12-22 18:01:17 +01:00
Florian Bruhin
89e051ff51 Ignore clicks on failed downloads.
Fixes #396.
2014-12-22 17:36:02 +01:00
Florian Bruhin
58c991145c Revert "Use scrollRequested signal instead of paintEvent."
It seems on some pages like Twitter or blog.fdik.org, the
QWebPage::scrollRequested signal never gets emitted, so we use this for now.

Fixes #400.
See https://bugreports.qt-project.org/browse/QTBUG-43521.

This reverts commit 03fb21c476.

Conflicts:
	qutebrowser/browser/webview.py
2014-12-22 17:20:43 +01:00
Florian Bruhin
ef9ddb2d5f Encode Content-Disposition header name properly.
PyQt <= 5.3 accepted a Python string containing only latin1 chars as argument
for a QByteArray. This is deprecated in 5.4 and will be removed in 5.5 so we
should encode it by hand here.
2014-12-18 23:24:50 +01:00
Florian Bruhin
07957b105d Handle data being None in download read timer.
Fixes #307.
2014-12-18 23:09:33 +01:00
Florian Bruhin
5c15f56213 Stop download read timer when reply has finished.
See #307.
2014-12-18 23:08:19 +01:00
Florian Bruhin
3cc1134e82 Fix AttributeError on HTTP/proxy authentications.
This is a regression introduced in cafb487ac9.

Fixes #355.
See #333.
2014-12-17 13:40:15 +01:00
Florian Bruhin
512d7c4448 Simplify config exception tree and handling.
Also make sure we catch all config-related errors in all related places.
Fixes #324.
2014-12-17 11:17:18 +01:00
Florian Bruhin
655ab31d48 Add a network -> proxy-dns-requests option.
Closes #330.
2014-12-16 23:27:55 +01:00
Florian Bruhin
cafb487ac9 Abort questions in NetworkManager on destroyed.
Hopefully fixes #333.
2014-12-16 17:22:01 +01:00
Florian Bruhin
676313e7ae Fix indent. 2014-12-16 15:09:47 +01:00
Florian Bruhin
05e6515aad Allow min-/maximizing of print preview on Windows.
Fixes #327.
2014-12-16 15:08:28 +01:00
Florian Bruhin
965a1256a3 Add "Remove finished" to the download context menu
Closes #344.
2014-12-16 14:30:47 +01:00
Florian Bruhin
ed013ac3cf Simplify generating of download context menu. 2014-12-16 14:10:25 +01:00
Florian Bruhin
e0271eff34 Open and remove clicked downloads.
Fixes #343.
2014-12-16 14:02:01 +01:00
Florian Bruhin
888a17b7c3 Fix height calculation of download view. 2014-12-16 13:53:54 +01:00
Florian Bruhin
b899d8b44d Always auto-remove adblock downloads when done.
Fixes #342.
2014-12-16 13:44:09 +01:00
Florian Bruhin
512e51eeb4 Fix type annotation for :zoom. Fixes #332. 2014-12-15 22:59:45 +01:00
Florian Bruhin
ba9bb0e418 Fix updating of scroll position with gg/G/etc. 2014-12-14 16:44:18 +01:00
Florian Bruhin
06ec1a3885 Big file tree reorganisation.
Closes #255.
Should make a lot more sense now ;)
2014-12-13 17:28:50 +01:00
Florian Bruhin
67001665a2 Cleanups in hint.py. 2014-12-13 00:30:35 +01:00
Johannes Altmanninger
d0bed460eb Hints: Use the src html attribute in addition to href in _resolve_url.
See issue #286
2014-12-12 18:40:12 +01:00
Johannes Altmanninger
582e3e57e9 Add hint target 'run' to execute a command based on a hint URL.
Fixes Issue #285.
The command is not preceded by a colon because there is no need to
distinguish between a search and a command.
2014-12-12 18:17:58 +01:00
Florian Bruhin
841e31283c hints: Store id() of destroyed frames.
Fixes #305. #152 should still be okay.
2014-12-12 01:38:13 +01:00
Florian Bruhin
aefa637bc5 Check if command text is valid when hinting. 2014-12-11 22:16:56 +01:00
Florian Bruhin
39cd36c8cd Don't use maxsplit=0 with :spawn. 2014-12-11 21:27:44 +01:00
Florian Bruhin
b7ea8e7979 Support a maxsplit argument for commands. 2014-12-11 20:32:52 +01:00
Florian Bruhin
4e6cedb1f7 Don't treat page load as failed with blocked hosts.
Fixes #315.
2014-12-11 18:05:01 +01:00
Florian Bruhin
5eeb89ec86 Add a :quickmark-del command. 2014-12-10 23:30:04 +01:00
Florian Bruhin
d0b5f2087a Fix un-hiding of hints. 2014-12-10 23:22:25 +01:00
Florian Bruhin
b00e00db37 Add a "retry" entry to the download menu.
Closes #38.
2014-12-10 21:56:57 +01:00
Florian Bruhin
9553bd44c1 Add an open menu entry to downloads.
See #39.
2014-12-10 20:48:19 +01:00
Florian Bruhin
ec07e4f8be Handle OSError exceptions where appropriate.
Fixes #25.
2014-12-10 18:00:49 +01:00
Florian Bruhin
ea76bdfb0f Replace all IOError by OSErrors.
Starting with Python 3.3, IOError is just an alias for OSError.
2014-12-10 16:48:23 +01:00
Florian Bruhin
206b5f548e Fix checking for errors when a page is loaded.
Because of the error page, we got loadFinished with ok=True even with errors.

Fixes #84.
2014-12-10 16:38:24 +01:00
Florian Bruhin
76c5c8bf8e cookies/cache: Handle por^H^Hrivate browsing mode.
See #43.
2014-12-10 13:12:53 +01:00
Florian Bruhin
7e95401f02 Check if download reply is None when closing tab.
Fixes #311.
2014-12-09 17:37:57 +01:00
Florian Bruhin
4ab4ac3db6 downloads: Make sure read timer is stopped.
Hopefully fixes #307.
2014-12-08 16:16:03 +01:00
Florian Bruhin
07fed5a401 Don't nest function calls in on_read_timer_timeout.
This would have made it easier to diagnose #307.
2014-12-08 16:07:50 +01:00
Florian Bruhin
1fb24e45ff Newline fix in adblock.py 2014-12-04 21:35:32 +01:00
Florian Bruhin
3adb97e4d2 Merge branch 'master' of ssh://tonks/qutebrowser 2014-12-02 21:28:54 +01:00
Florian Bruhin
d94f848c82 Ignore isNullError while handling label elements.
Fixes #295 (hopefully for real this time!)
2014-12-02 21:27:06 +01:00
Florian Bruhin
99fb516aa3 Never disconnect signal from destroyed frames.
Fixes #152 - hopefully really this time!
2014-12-02 21:09:03 +01:00
Florian Bruhin
66a42512c6 adblock: Convert some methods to functions. 2014-12-02 12:26:13 +01:00
Florian Bruhin
9fa036ecce Remove logging for #152.
This reverts a1ba05ff08.
2014-12-01 22:29:32 +01:00
Florian Bruhin
e8a6238028 Clean up hint labels and frames before clicking link.
Fixes #152.
Hopefully fixes #295.
2014-12-01 19:15:17 +01:00
Florian Bruhin
cb67198f7d Fix download redirections and :adblock-update.
We called init_reply again which started read_timer even if the file object was
already set.

Fixes #294.
2014-12-01 07:40:36 +01:00
Florian Bruhin
316d5ff189 Check if replies are open in downloads. 2014-12-01 07:35:57 +01:00
Florian Bruhin
f22c00c64d Move MAX_REDIRECTS attribute back to DownloadItem.
Fixes #293.
2014-12-01 06:55:15 +01:00
Florian Bruhin
9d28c59a28 Fix downloading of qute:log. Closes #81. 2014-11-30 18:47:41 +01:00
Florian Bruhin
d54f06ea91 Reparent a page's QNAM if there are running downloads.
Fixes #289.
2014-11-30 18:47:40 +01:00
Florian Bruhin
6d419b8346 Avoid starting downloads before we know the filename.
Closes #278.
2014-11-30 18:47:40 +01:00
Florian Bruhin
25a665e601 Abort download question on errors. Fixes #266. 2014-11-30 15:34:15 +01:00
Florian Bruhin
a00dd7b679 Slowly download while the user is entering a filename.
Closes #79.
Closes #270.
2014-11-30 15:30:15 +01:00
Florian Bruhin
60ef39b4d0 fixup 2014-11-30 15:30:15 +01:00
Florian Bruhin
ee0cb00428 First download cleanup. 2014-11-30 15:30:14 +01:00
Florian Bruhin
d34aefcfee Another round of config breakage (sorry!).
- Rename colors->tab.* to colors->tabs.*
- Rename permission section to content.
2014-11-26 21:16:27 +01:00
Florian Bruhin
186f292586 Remove unused import 2014-11-24 21:07:03 +01:00
Florian Bruhin
0134646c67 Basic host blocker implementation.
Squashed commit of the following:

commit 8d38e9c2f13778fe21cc2c1d61c5d26907b469ef
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 21:04:30 2014 +0100

    Fix default adblock lists.

commit a734b87e753daec28fa0c6643af8de088041179a
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 21:04:14 2014 +0100

    Fix error output on adblock errors.

commit 15bc10f605ebb86c12523bb81b55d1440fcacdbf
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 07:38:47 2014 +0100

    Update adblock docks

commit 475d530ee50f52295c2171208c6a0278750cf4b4
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 07:38:39 2014 +0100

    Remove adblock ram calculation

commit 0e52cc3ec93912fd3fa3ecf6de833aef0c540a60
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 07:03:11 2014 +0100

    Adjust docs for hosts-file.

commit 941df242d38300d7e42a26f2e67cfd668c6f8590
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 06:55:40 2014 +0100

    Add logging for host blocking.

commit 4ca1561ccf32affb8439113f4f1c222d7dee1e14
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 24 00:11:59 2014 +0100

    Don't do adblock updates automatically after changing config.

commit 26d4e86ca393d4a1a5fd8fac7729ce9c2e7cd240
Author: Florian Bruhin <git@the-compiler.org>
Date:   Thu Nov 20 19:58:32 2014 +0100

    adblock: Don't delete blocked hosts between files.

commit c7af08c68adf3c135d5a2fc746eb6d3c715b0711
Author: Florian Bruhin <git@the-compiler.org>
Date:   Thu Nov 20 19:58:22 2014 +0100

    adblock: Add comments for rewinding.

commit 9af87313088cd79ab8c022bcee9308511d6328f0
Author: Florian Bruhin <git@the-compiler.org>
Date:   Thu Nov 20 19:56:39 2014 +0100

    adblock: Rewind files properly.

commit 7f3dadc04ba68c92d6789ecf5822f7b2dfc367a0
Author: Florian Bruhin <git@the-compiler.org>
Date:   Thu Nov 20 19:40:18 2014 +0100

    Add untested file support.

commit 334c01867d510b599d94c9397097a1d789c0c64c
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 22:33:25 2014 +0100

    adblock: Handle download errors correctly

commit 3a9af4cd4a903386dc323640f1d52e03383b3aa7
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 22:23:04 2014 +0100

    adblock: Add error handling for invalid input.

commit 5934c3c027ff9205adb512aab396ca913b31e50d
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 22:22:47 2014 +0100

    adblock: Handle done_count correctly.

commit 3ba5e83fda9b7d764bfcf1e4b1aa479daae39791
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 21:18:10 2014 +0100

    Read adblock files when they finished downloading.

commit 86a5ecf194445e2ebe0cf22b59e24223387880c5
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 20:51:25 2014 +0100

    Add hosts-file.net to host-block-lists.

commit 121f0bff953497449c32e45e671b71d954beed4c
Author: Florian Bruhin <git@the-compiler.org>
Date:   Wed Nov 19 20:51:13 2014 +0100

    Add zip-file support to adblock.py.

commit f1c0e67cb9d890a44a1d1f545ace997f0a453f91
Author: Florian Bruhin <git@the-compiler.org>
Date:   Mon Nov 17 07:41:14 2014 +0100

    print line counts for debugging

commit 75dbb8964fd44862abc378ef26fb47f8cda6061e
Author: Florian Bruhin <git@the-compiler.org>
Date:   Fri Nov 14 19:22:20 2014 +0100

    Use statusbar messages for adblock

commit 74d9142d831496e02c5baae72c2723e320af1778
Author: Florian Bruhin <git@the-compiler.org>
Date:   Fri Nov 14 08:34:46 2014 +0100

    Add basic adblock functionality.
2014-11-24 21:05:09 +01:00
Florian Bruhin
f7fbf98667 downloads: Rewind file objects correctly on redirects. 2014-11-24 21:04:48 +01:00