Commit Graph

2018 Commits

Author SHA1 Message Date
Florian Bruhin
23e7b3f551 Elide js element debug string 2016-11-08 12:17:44 +01:00
Florian Bruhin
19c7d747dd Fix downloads with unknown size with WebEngine 2016-11-08 09:18:10 +01:00
Florian Bruhin
ed3347365f Fix lint 2016-11-08 09:18:10 +01:00
Florian Bruhin
54db4255b1 Fix handling of temporary files
When we use self._set_filename in self._set_fileobj, the file already
exists, so we need to force "overwriting" it.

Also, move temporary file handling to a dedicated _set_tempfile method,
so we can officially claim not supporting _set_fileobj with QtWebEngine
instead of supporting it with a hack.
2016-11-08 09:18:10 +01:00
Florian Bruhin
53e360ec4b Always use a global QNAM for downloads
This makes a lot of code eaiser, and we don't have per-tab settings yet
anyways. Also, with QtWebEngine, we can't honour any per-tab settings
for downloads...
2016-11-08 09:18:09 +01:00
Florian Bruhin
bc1e4385e0 Fix first bunch of download tests 2016-11-08 09:18:09 +01:00
Florian Bruhin
ce1b675a1e Implement :download/hints via QtNetwork 2016-11-08 09:18:09 +01:00
Florian Bruhin
5bc3914f24 Pass basename only as suggested filename 2016-11-08 09:18:09 +01:00
Florian Bruhin
fc6c6d4998 Fix lint 2016-11-08 09:16:47 +01:00
Florian Bruhin
a5afdf6fb6 Handle QtWebEngine downloads in DownloadModel 2016-11-04 18:49:25 +01:00
Florian Bruhin
ea9796403f Fix _ask_confirm_question 2016-11-04 18:49:25 +01:00
Florian Bruhin
bf994cd8da Initial QtWebEngine download support 2016-11-04 18:49:24 +01:00
Florian Bruhin
c876c3d244 Fix lint 2016-11-04 18:49:24 +01:00
Florian Bruhin
a3a167e683 Split _die in two methods
We need to do some stuff before AbstractDownloadItem._die runs.
2016-11-04 18:49:24 +01:00
Florian Bruhin
6eef79e180 Adjust imports/objreg 2016-11-04 18:49:24 +01:00
Florian Bruhin
990985e60f Rename browser.webkit.downloads to browser.qtnetworkdownloads 2016-11-04 18:49:24 +01:00
Florian Bruhin
e985730cbf Simplify TempDownloadManager initialization 2016-11-04 18:49:24 +01:00
Florian Bruhin
7ca6996f39 Adjust imports 2016-11-04 18:49:24 +01:00
Florian Bruhin
0ac2b71304 Simplify how filename questions are handled 2016-11-04 18:49:24 +01:00
Florian Bruhin
3b51548d3a More download splitting 2016-11-04 18:49:24 +01:00
Florian Bruhin
92b1bf2227 Get rid of win_id for DownloadItem 2016-11-04 18:49:24 +01:00
Florian Bruhin
12d798d54d Continue download splitting 2016-11-04 18:49:24 +01:00
Florian Bruhin
5b04f1052f Add DownloadItem.set_target
This allows us to make _set_fileobj private, and also makes some code
simpler.
2016-11-04 18:49:24 +01:00
Florian Bruhin
2c94efbf8a First big download refactoring chunk 2016-11-04 18:49:24 +01:00
Florian Bruhin
352f83b95e Rename DownloadItem.do_retry 2016-11-04 18:49:24 +01:00
Florian Bruhin
34b4dcf0d5 Make DownloadItem._retry_info private 2016-11-04 18:49:24 +01:00
Florian Bruhin
70e390a2e8 downloads: Simplify redirect handling 2016-11-04 18:49:24 +01:00
Florian Bruhin
14ecbc0cec Use jinja for SSL error message 2016-11-03 08:40:42 +01:00
Florian Bruhin
3b7f65d956 Show URL in most questions 2016-11-03 08:40:42 +01:00
Florian Bruhin
d85cfcbc07 Fix ask_for_filename call 2016-11-03 08:40:42 +01:00
Florian Bruhin
a87e46101c Fix lint 2016-11-03 08:40:42 +01:00
Florian Bruhin
dba29e518a First working prototype of global prompts 2016-11-03 08:40:42 +01:00
Florian Bruhin
9ce1180b31 First attempt at showing prompts in all windows 2016-11-03 08:40:42 +01:00
Florian Bruhin
fefc8c4eb2 Add more tests for prompts 2016-11-03 08:40:42 +01:00
Florian Bruhin
653ca9799d Add a default for SSL questions 2016-11-03 08:40:41 +01:00
Florian Bruhin
dff20ffe35 Fix message.confirm_async calls 2016-11-03 08:40:41 +01:00
Florian Bruhin
fe230219a9 Fix lint 2016-11-03 08:40:41 +01:00
Florian Bruhin
04d24e3d94 Fix permission question 2016-11-03 08:40:41 +01:00
Florian Bruhin
75bb2265be Take text as pos. argument for _build_question 2016-11-03 08:40:41 +01:00
Florian Bruhin
f0ed43ec20 Use message module as API for most questions 2016-11-03 08:40:41 +01:00
Florian Bruhin
756564ebff Get rid of message_bridge.set_cmd_text 2016-11-03 08:40:41 +01:00
Florian Bruhin
523369882a Add title/text to questions 2016-11-03 08:40:41 +01:00
Florian Bruhin
51a0c2a32c Remove unused imports 2016-10-31 07:27:30 +01:00
Florian Bruhin
f6aefabf40 Initialize QtWebKit-specific stuff with QtWebKit only
Maybe this fixes issues we had with QtWebEngine segfaults in proxy.py on
Travis?

Note we can't move cookies/cache/network stuff yet as we still need that
for e.g. adblock downloads with QtWebEngine.
2016-10-30 23:07:19 +01:00
Florian Bruhin
428637746a Merge branch 'insert-text-js' of https://github.com/paretje/qutebrowser into paretje-insert-text-js 2016-10-30 19:51:25 +01:00
Kevin Velghe
0caee94994 Remove has_js 2016-10-30 18:54:34 +01:00
Florian Bruhin
f4022a86fd Improve line breaking 2016-10-30 18:49:41 +01:00
Kevin Velghe
e83b99b0e1 Run javascript on document element
This enables `:jseval` for users who disable javascript on webpages.
2016-10-30 11:39:10 +01:00
Kevin Velghe
efadbe64b5 insert_text doesn't need javascript to be enabled
It runs in the context of an element, which seems possible, even without
javascript enabled (in qtwebkit?).
2016-10-20 15:54:06 +02:00
Daniel Karbach
7eafa30084 :tab-close option names
--left -> --prev
--right -> --next
2016-10-18 15:03:08 +02:00
Daniel Karbach
845298ae41 :tab-close option names
--left -> --prev
--right -> --next
2016-10-18 15:03:08 +02:00
Florian Bruhin
2ae9f14d22 Add pylint disable 2016-10-18 06:22:45 +02:00
Kevin Velghe
59536828a1 Implement hint target "current" for webengine 2016-10-17 23:33:44 +02:00
Florian Bruhin
ab43ba71d2 Merge branch 'webkitelemparent' of https://github.com/paretje/qutebrowser into paretje-webkitelemparent 2016-10-17 22:26:58 +02:00
Kevin Velghe
ed91e1d4c8 Implement __setitem__ in WebEngineElement 2016-10-17 14:14:45 +02:00
Kevin Velghe
7bb4700352 Return None when parent is a null webelement 2016-10-14 14:54:43 +02:00
Florian Bruhin
26b6688b61 Merge branch 'netrc' of https://github.com/paretje/qutebrowser into paretje-netrc 2016-10-14 06:39:03 +02:00
Kevin Velghe
087342894e Add setting for location of netrc file
There is no reason I guess to do this with an environment variable. On
top of that, introducing a settings also documents the netrc feature
itself (Closes #1975?).
2016-10-09 00:15:46 +02:00
Daniel Schadt
ffa276a182 pdfjs: compatibility for v1.6.210
They renamed PDFView to PDFViewerApplication, which we need to account
for in our pdfjs scripts.

Also, it seems like the actual viewer is now only created when the DOM
has been loaded. This means that at the time when our script is
executed, the viewer does not yet exist. Thus we need to delay the open
request too by registering a DOMContentLoaded handler.
2016-10-06 14:43:16 +02:00
Kevin Velghe
e3c92a9bae Set netrc location with QUTE_NETRC 2016-10-05 12:03:52 +02:00
Florian Bruhin
2f0db878e6 Break long lines 2016-10-05 09:07:35 +02:00
Florian Bruhin
b107522d8c Make cssutils a lazy import
Importing cssutils takes more than a second on the 2009 Thinkpad with a
Core2 I'm on right now, so let's only import it when actually necessary.
2016-10-04 08:51:10 +02:00
Florian Bruhin
bd831939bc Adjust for scrolling off-by-one errors
On some pages with particular zoom levels, elem.offsetHeight is exactly
one pixel more than elem.scrollHeight when fully scrolled down.

This is probably due to rounding/floats/off-by-one errors somewhere
inside Chromium?

We now instead always clip the displayed percentage at 100% (so we don't
display 101%), and consider the page fully scrolled even if we're
scrolled more than the page.
2016-10-03 06:52:54 +02:00
Florian Bruhin
5b11eaad85 Merge branch 'issue1987' of https://github.com/HolySmoke86/qutebrowser into HolySmoke86-issue1987 2016-10-03 06:45:01 +02:00
Florian Bruhin
c7b74edfbe Merge branch 'issue1940' of https://github.com/HolySmoke86/qutebrowser into HolySmoke86-issue1940 2016-10-03 06:41:19 +02:00
Florian Bruhin
6b76d5defa Whitespace changes 2016-09-30 17:54:23 +02:00
Daniel Karbach
eaa754648d common base for userscript exceptions 2016-09-30 09:26:43 +02:00
Florian Bruhin
822c100f52 Make 0 a usable count for :tab-focus
Fixes #1768
2016-09-30 08:33:16 +02:00
Daniel Karbach
46ca91cfc0 only use ';' as query delim if there's no '&' 2016-09-29 17:45:12 +02:00
Daniel Karbach
8eb12c6cb9 improved error messages for inexistent userscripts
fixes #1940
2016-09-29 13:29:39 +02:00
Daniel Karbach
b195b5b40d detect ';' delimiters when yanking URL
fixes #1987
2016-09-29 11:02:30 +02:00
Jakub Klinkovský
268db48f19 prettify yank pretty-url 2016-09-22 14:25:48 +02:00
Florian Bruhin
57d896e989 Fix hints when zoomed with QtWebEngine
We mutated rect (coming from self._js_dict), which means we used the
already adjusted values the second time we called rect_on_view.

Fixes #1863.
2016-09-21 20:09:31 +02:00
Florian Bruhin
0d64257049 Add missing docstring 2016-09-15 17:16:30 +02:00
Florian Bruhin
37fa7431b0 Serve broken qutebrowser logo via qute:resources
This is needed when we want to display an error page after the user
requested a qute:// URL, as qute:// URLs can't access file:// content
with QtWebEngine.
2016-09-15 16:06:25 +02:00
Florian Bruhin
7e30792bfe Fix lint 2016-09-15 14:51:22 +02:00
Florian Bruhin
e5293d34de Add missing str() calls 2016-09-15 14:51:21 +02:00
Florian Bruhin
ed4f476ab4 Get rid of queued messages and unused code 2016-09-15 14:51:21 +02:00
Florian Bruhin
f16b96aa28 Initial implementation of new messages 2016-09-15 14:51:21 +02:00
Florian Bruhin
c071964091 Fix lint 2016-09-14 15:21:30 +02:00
Florian Bruhin
982d00ff84 Let qute:* handlers decide their mimetype
This means we have to guess less, and handlers can give us HTML as text
which we then encode for them.
2016-09-14 12:33:20 +02:00
Florian Bruhin
5501d90268 Fix lint 2016-09-14 12:00:29 +02:00
Florian Bruhin
a1527f35d4 Allow to restrict qute:* pages to a backend 2016-09-14 11:04:47 +02:00
Florian Bruhin
71bc5bb943 Move QuteSchemeError to qutescheme 2016-09-14 11:04:37 +02:00
Florian Bruhin
aa71c9ae58 Initial qute:* support for QtWebEngine 2016-09-14 10:18:25 +02:00
Florian Bruhin
0b310d6910 Fix removing of a clicked download 2016-09-12 21:47:01 +02:00
Florian Bruhin
5b0fc41367 Log scroll data we got via JS 2016-09-12 21:46:51 +02:00
Florian Bruhin
4b4582c452 Adjust comment in _rect_on_view_js 2016-09-12 20:00:59 +02:00
Florian Bruhin
14de9f58b8 Fix docstring 2016-09-12 18:33:57 +02:00
Florian Bruhin
8a35ebac7b Use a separate JS world for :jseval 2016-09-12 18:27:51 +02:00
Florian Bruhin
c9e3cc04cf Accept a name for --world with :jseval 2016-09-12 18:23:23 +02:00
Florian Bruhin
b2608d7697 Add --world to :jseval 2016-09-12 15:59:17 +02:00
Florian Bruhin
a16c5a6a25 Add a world argument to tab.run_js_async 2016-09-12 15:59:03 +02:00
Florian Bruhin
2388489038 downloads: Be okay with the tmpdir being gone 2016-09-12 11:30:44 +02:00
Florian Bruhin
0fef141db5 Handle QBuffer in on_feature_permission_requested 2016-09-12 09:43:08 +02:00
Florian Bruhin
43b563f600 Add missing docstring 2016-09-11 21:27:16 +02:00
Florian Bruhin
7ec62c4523 Make some more things in download.py private 2016-09-11 20:58:34 +02:00
Florian Bruhin
3550d59e3a Make DownloadItem.reply private
This adds a new uses_nam method to DownloadItem though.
2016-09-11 20:58:34 +02:00
Florian Bruhin
36b7485262 Make some things in downloads.py private 2016-09-11 20:48:19 +02:00
Florian Bruhin
1b5cd98d38 Fix lint 2016-09-11 20:16:03 +02:00