Commit Graph

8950 Commits

Author SHA1 Message Date
Florian Bruhin
7d695d40b9 Add a QUTE_FAKE_OPENGL_VENDOR envvar 2018-07-19 00:31:23 +02:00
Florian Bruhin
8a748741ba Fix checks for Nouveau workaround 2018-07-19 00:28:12 +02:00
Florian Bruhin
a72eee8e39 Enable XSS auditing by default
Qt disables this by default, but Chromium does have it enabled.

I also submitted a change to Qt to hopefully enable it by default there
starting with Qt 5.12: https://codereview.qt-project.org/#/c/198354/15

This also removes the claim of having a (big) performance impact, as Chromium's
XSS design doc says the opposite:
https://www.chromium.org/developers/design-documents/xss-auditor
2018-07-17 12:01:17 +02:00
Florian Bruhin
b8c70e5986 Rewrite type comments again 2018-07-16 22:35:40 +02:00
Florian Bruhin
2d65f25a04 Remove unnecessary object inheritance 2018-07-16 14:44:31 +02:00
Florian Bruhin
e4a772c61c Fix try-except-raise for pylint 2.0
See https://github.com/PyCQA/pylint/issues/2302
2018-07-16 14:44:07 +02:00
Florian Bruhin
e0f3285f05 Fix bad-indentation issues for pylint 2.0
See https://github.com/PyCQA/pylint/issues/2301
2018-07-16 14:41:18 +02:00
Florian Bruhin
e50b6912a7 Fix pylint 2.0 useless-return cases
See https://github.com/PyCQA/pylint/issues/2300
2018-07-16 14:33:11 +02:00
Florian Bruhin
b1d508a3af Rewrite pseudo "type:" comments for pylint 2.0
See https://github.com/PyCQA/pylint/issues/2299
2018-07-16 14:15:00 +02:00
Florian Bruhin
9298f3d055 Refactor print handling and fix window.print
On Qt 5.7.1, window.print() caused a CommandError which wasn't handled as the
command was called from accept_navigation_request.

Instead, we now show the dialog in AbstractPrinting and use that directly.
2018-07-16 08:16:18 +02:00
Hendrik R
b1a060fb71 Process all events before issuing an alert
Fixes #2603

The call to processEvents fixes an apparent race condition with some window
managers, e.g. i3. QT seems to be thinking, that the window is not marked as
urgent and toggles it twice, so synchronizing before issuing the alert makes QT
behave correctly.

This change should not change the behaviour on other systems only correct the
fault reported in #2603.
2018-07-15 14:31:03 +02:00
Florian Bruhin
d1a25b6c3f Release v1.4.1 2018-07-11 17:17:51 +02:00
Florian Bruhin
43e58ac865 CVE-2018-10895: Fix CSRF issues with qute://settings/set URL
In ffc29ee043 (part of v1.0.0), a
qute://settings/set URL was added to change settings.

Contrary to what I apparently believed at the time, it *is* possible for
websites to access `qute://*` URLs (i.e., neither QtWebKit nor QtWebEngine
prohibit such requests, other than the usual cross-origin rules).

In other words, this means a website can e.g. have an `<img>` tag which loads a
`qute://settings/set` URL, which then sets `editor.command` to a bash script.
The result of that is arbitrary code execution.

Fixes #4060
See #2332
2018-07-11 17:05:23 +02:00
Florian Bruhin
b9e3d3cab9 Add workaround for chrome-extension:// URLs
Fixes #4049
2018-07-09 12:29:35 +02:00
Florian Bruhin
274b66ec46 Strip trailing newlines from pastebin URL 2018-07-08 22:09:56 +02:00
Florian Bruhin
0a31e19eda Handle download errors when the reply is already gone
Fixes #1270
2018-07-03 17:16:02 +02:00
Florian Bruhin
0f037fb415 Release v1.4.0 2018-07-03 15:44:44 +02:00
Florian Bruhin
8cf22c85e0 Merge remote-tracking branch 'origin/pr/4019' 2018-07-03 13:52:24 +02:00
Florian Bruhin
d861c097b1 Support new dead keys added in Qt 5.11 properly
See https://codereview.qt-project.org/#/c/207231/
2018-07-02 22:32:59 +02:00
Florian Bruhin
ad19833e34 Revert "Add workaround for PyQt 5.11 headerDataChanged bug"
PyQt 5.11.1 has already been released, with the bug fixed.

This reverts commit 291763a55643342a6f977ce2a12dcc6f4badbe8a.
2018-07-02 22:32:59 +02:00
Florian Bruhin
eca08f064b Add workaround for PyQt 5.11 headerDataChanged bug
https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html
2018-07-02 22:32:59 +02:00
Florian Bruhin
c3455d9082 Add a wrapper around sip
Starting with PyQt 5.11, the sip module now is bundled with PyQt as PyQt.sip.
Having a qutebrowser.qt also helps with #3625, see #995
2018-07-02 22:32:59 +02:00
Florian Bruhin
a7af5195d1 Set title when showing PDF.js error page
Fixes #3894
2018-06-28 11:22:44 +02:00
Florian Bruhin
e9c78b29ed Ignore Python 3.7 collections.abc warning
Related issues/PRs:
https://github.com/yaml/pyyaml/pull/181
https://github.com/pypa/setuptools/issues/1401
https://github.com/pallets/markupsafe/pull/98
https://github.com/yaml/pyyaml/pull/181
https://github.com/pallets/jinja/pull/867
2018-06-27 16:01:21 +02:00
Florian Bruhin
2f612aa6df Update comment 2018-06-26 15:54:56 +02:00
Florian Bruhin
8519aa940f Decorate slots properly 2018-06-26 10:40:13 +02:00
Florian Bruhin
ea4ee6f00b Use the url_changed signal in the tab API 2018-06-26 10:39:33 +02:00
Florian Bruhin
1536843f33 Only get greasemonkey object once 2018-06-26 10:39:04 +02:00
Florian Bruhin
61da5d0c7c Merge remote-tracking branch 'origin/pr/4017' 2018-06-26 10:37:17 +02:00
Florian Bruhin
85a9f6a08a Fix lint 2018-06-26 10:23:48 +02:00
Jimmy
c43d173197 greasemonkey: s/userscripts/greasemonkey_scripts/
No need to confuse developers as well as users.
2018-06-26 16:42:31 +12:00
Jimmy
ee2c765859 greasemonkey: check _widget is not deleted
Just for good luck.

No crash has been reported here but it is a common pattern for functions
called from signals.
2018-06-26 16:42:31 +12:00
Jimmy
6f1232e621 greasemonkey: move 5.7.1 injection method into _WebEngineScripts
Moves the 5.8 check to `_WebEngineScripts.init()`.

Changes `_inject_userscripts` to allow for the two code paths. With
5.7.1 we need to specify the injection point and not clear all scripts
for each call, since we have to call it three times.

Change the 5.8+ hook to call a new method which passes all the scripts
into `_inject_userscripts` so that doesn't have to have a fallback
conditional inside it because thats an inversion of responsibility!

Pulling the remove scripts part into a seperate function and making it
the callers responsibilty to call that first would tidy it up a little
more but meh.

I was worried about just doing `_widget.page().urlChanged.connect()`
once at tab init, where before it was connected at page init, because I
was under the impression that the child page can be replaced at any
time, eg when navigating to a new origin. But under manual testing I
didn't see that at all. Maybe I was mistaken or maybe that only started
in a later Qt version.
2018-06-26 16:42:31 +12:00
Jimmy
324966cfe7 greasemonkey: also support qute-js-world on 5.7.1
A straight copy from webengintab.

Yes I know I shouldn't be importing a private thing from webenginetab,
I'm working on refactoring now.
2018-06-26 15:00:35 +12:00
Jimmy
521268a1f7 Update comment. 2018-06-26 15:00:35 +12:00
Jimmy
54ca9b34e5 greasemonkey: enable running in isolated js worlds
QtWebEngine (via chromium) has the ability to run injected scripts in
isolated "worlds". What is isolated is just the javascript environment,
so variables and functions defined by the page and the script won't
clobber each other, or be able to interact (including variables saved to
the global `window` object). The DOM is still accessible from "isolated"
scripts.

This is NOT a security measure. You cannot put untrusted scripts in one
of these isolated worlds and expect it to not be able to do whatever
page js can do, it is just for namespacing convenience. See
https://stackoverflow.com/questions/9515704/insert-code-into-the-page-context-using-a-content-script
for some examples of how to inject scripts into the page scope using DOM
elements.

Now you can specify the world ID in a `@qute-js-world` directive like:

```
// ==UserScript==
// @name         Do thing
// @match        *://some.site/*
// @qute-js-world 1234
// ==/UserScript==
document.body.innerHTML = "<strong>overwritten</strong>"
```

The QtWebEngine docs say worldid is a `quint32` so you can put whatever
number (positive, whole, real) you want there. I have chosen to allow
the `qutebrowser.utils.usertypes` enum as aliases for IDs that are
predefined in
`qutebrowser.browser.webengine.webenginetab._JS_WORLD_MAP`. So you can
pass `main`, `application`, `user` or `jseval` in there too. `main` (0)
is the default one and is the only one in which JS disabled when
`content.javascript.enabled` is set to `false`. All others are still
enabled.

I'm not sure whether using any of those already-named worlds makes
sense, apart from `main`. We could stop people from using them I
suppose. Another option is to allow people to pass in `*` as a value to
have scripts put into their own little worlds, probably backed by a
counter in the GreaseMonkeyManager class.

Chrome docs: https://developer.chrome.com/extensions/content_scripts#execution-environment
Webengine docs: https://doc.qt.io/qt-5/qwebenginescript.html#details
2018-06-26 15:00:35 +12:00
Florian Bruhin
876aa5a9b1 Fix lint 2018-06-25 22:51:55 +02:00
Florian Bruhin
81b3ef937e Move handling of certificate errors to webenginetab 2018-06-25 21:04:32 +02:00
Florian Bruhin
8a4bba11ed Disable certificate workaround on Qt >= 5.9
Fixes #4020
2018-06-25 20:35:48 +02:00
Jay Kamat
da0a6305df
Fix crash when tab is closed after a per-domain forced reload 2018-06-25 12:45:17 -04:00
Florian Bruhin
6c9e23af4a eslint: Turn off max-lines-per-function 2018-06-25 08:14:02 +02:00
Florian Bruhin
f2f481d991 Support URL patterns for permissions and ssl_strict
See #3636
2018-06-24 21:38:37 +02:00
Florian Bruhin
f5e69b2174 Show inspector after creating it 2018-06-24 19:57:52 +02:00
Florian Bruhin
e6e844b039 Support URL patterns for content.headers settings
See #3636
2018-06-24 19:54:24 +02:00
Florian Bruhin
a02c25dfb1 Don't escape URLs for qute://history
We only use the URL to set a 'href' attribute, which does not need escaping.

See #4011
Fixes #4012
2018-06-23 14:27:07 +02:00
Florian Bruhin
d2254ca48b Release v1.3.3
(cherry picked from commit ad9b50601c82f66646088e9ebdd66613eb2e93e2)
2018-06-21 23:32:56 +02:00
Florian Bruhin
0864ad4069 Fix shadowing of 'html' name 2018-06-21 22:28:27 +02:00
Florian Bruhin
5a7869f2fe Fix XSS issue on qute://history
Fixes #4011
2018-06-21 21:20:19 +02:00
Florian Bruhin
62d8b5b574 Don't depend on PyQt5.QtQuickWidgets to get RWHV
Some distributions (at least FreeBSD) don't package that module, so let's not
rely on it.
2018-06-21 17:14:29 +02:00
Florian Bruhin
c87757a913 Revert "Properly add QtQuickWidgets dependency"
Looks like FreeBSD doesn't have QtQuickWidgets packaged at all, so let's do the
same without requiring it...

This reverts commit e5405f0ae9.
2018-06-21 16:35:29 +02:00
Florian Bruhin
9f5ca475c9 Don't try to set focus if prev_focus is None 2018-06-21 01:44:15 +02:00
Florian Bruhin
e7a300865c Fix lint 2018-06-21 01:43:09 +02:00
Florian Bruhin
e5405f0ae9 Properly add QtQuickWidgets dependency 2018-06-21 00:21:52 +02:00
Florian Bruhin
3399f2df96 Always clear searches between page loads
Looks like this wasn't properly fixed in Qt for some reason.
Fixes #3693
See #2728 and bef372e5f5
2018-06-17 21:03:44 +02:00
Florian Bruhin
2029f52fdc Show cause when ~/.netrc can't be read 2018-06-17 20:53:29 +02:00
Florian Bruhin
663d1a4d2f Read dictionaries from /usr/share/qt on Qt >= 5.10
Fixes #3759
Supersedes #3762
See #2939, #4003
2018-06-17 20:27:52 +02:00
Florian Bruhin
7654467f36 Remove unused import 2018-06-14 17:43:20 +02:00
Florian Bruhin
07cf2f5b60 Unconditionally restore mode after prompt 2018-06-14 16:09:30 +02:00
Florian Bruhin
4dddc07753 Make sure modeman.enter(KeyMode.normal) does something sensible 2018-06-14 16:09:26 +02:00
Florian Bruhin
1335fccba1 Merge remote-tracking branch 'origin/pr/3590' into tab-mode 2018-06-14 15:40:58 +02:00
Florian Bruhin
e4e982c0a7 Remove unused variable 2018-06-14 14:58:07 +02:00
Florian Bruhin
868cd115be Remove old focus handling code 2018-06-14 14:58:07 +02:00
Florian Bruhin
cec63ea449 Merge remote-tracking branch 'origin/pr/3906' 2018-06-14 14:49:30 +02:00
Jay Kamat
e5b6552568
Clean up and simplify some logic 2018-06-13 15:37:32 -07:00
Florian Bruhin
a0adee55c9 Quit hard on ignored exceptions
We can't realistically shut down cleanly because we most likely haven't init'ed
properly yet.

Fixes #3993
2018-06-13 21:13:39 +02:00
Florian Bruhin
cb2881e0d7 Use info loglevel for :debug-cache-stats
Closes #3994
2018-06-13 19:10:01 +02:00
Florian Bruhin
1541088e76 Use -webkit-filter on old Qt 2018-06-12 17:01:34 +02:00
Florian Bruhin
c37134861e Use ES6 template strings 2018-06-12 16:49:54 +02:00
Florian Bruhin
772654bcae Use calculated background color for newer Qt versions 2018-06-12 16:46:03 +02:00
Florian Bruhin
68a7387b6b Merge remote-tracking branch 'origin/pr/3940' 2018-06-12 16:32:05 +02:00
Florian Bruhin
a1a5885367 Set parents for tab sub-objects 2018-06-12 14:09:06 +02:00
Florian Bruhin
a6db700886 Fix HTML5 fullscreen 2018-06-12 13:44:47 +02:00
Slackhead
088c7b235d fix for qt 5.7.1 2018-06-12 11:22:41 +01:00
Florian Bruhin
6faff11243 Improve error messages with backend conditionals 2018-06-12 11:10:03 +02:00
Florian Bruhin
3b0c8e46a3 Add an initial cookie filter for Qt 5.11
See #3010
2018-06-12 09:36:05 +02:00
Slackhead
35a1e118f8 combine style nodes 2018-06-12 04:25:13 +01:00
Florian Bruhin
093f07f552 Add content.canvas_reading setting
See #2377
Closes #2235
2018-06-11 23:28:04 +02:00
Florian Bruhin
ad7e080827 Fix lint 2018-06-11 21:47:38 +02:00
Florian Bruhin
67c67db230 Handle multiple visible children when finding lost focusProxy
When we click a QTBUG link (to open in a new tab) from Qt's codereview, we get
two RWHV objects which both are visible.

Experimenting with .setEnabled(False) it looks like it's (hopefully always...)
the last one which is the one to use.
2018-06-11 21:43:27 +02:00
Florian Bruhin
c328d54ebe Add a lost-focusproxy debug flag 2018-06-11 21:27:08 +02:00
Florian Bruhin
a6b314ae91 Don't connect Qt 5.11 signals on PyQt 5.10
Apparently the signal attributes already exist with PyQt 5.10 (*sigh*) but PyQt
doesn't know what to do with the arguments, causing this to happen:

TypeError: unable to convert a C++ 'QWebEngineRegisterProtocolHandlerRequest'
instance to a Python object
2018-06-11 21:21:41 +02:00
Florian Bruhin
d42934af08 Turn off FocusOnNavigationEnabled on Qt 5.9
This way we get the same behavior with Qt 5.9 and 5.10 at least, leaving only
5.7 if we pretend that 5.8 never existed.
2018-06-11 20:28:00 +02:00
Florian Bruhin
141afff0c6 Add a content.desktop_capture setting
See #2939
2018-06-11 20:18:57 +02:00
Florian Bruhin
69abc9a1a1 Add a content.webrtc_public_interfaces_only option
See #3010
Fixes #2163
2018-06-11 19:44:45 +02:00
Florian Bruhin
3bf89bcea4 Add content.autoplay option
See #3010
Closes #1643
2018-06-11 19:32:34 +02:00
Florian Bruhin
c5b7ed350e Make it possible to provide a converter for websettings 2018-06-11 19:14:31 +02:00
Florian Bruhin
263d298449 Remove the content.developer_extras setting 2018-06-11 18:09:24 +02:00
Florian Bruhin
e5fbb9f68a Remove pyqtSlot annotations for new types 2018-06-11 18:09:24 +02:00
Florian Bruhin
54011782c8 webenginetab: Move scripts to separate object 2018-06-11 18:09:24 +02:00
Florian Bruhin
b3749df009 webenginetab: Move permissions to separate object 2018-06-11 18:09:18 +02:00
Florian Bruhin
4186577928 Add support for navigator.registerProtocolHandler
See #3010
2018-06-11 18:09:18 +02:00
Florian Bruhin
c020160f75 Add support for navigator.webkitPersistentStorage.requestQuota
See #3010
2018-06-11 18:09:18 +02:00
Florian Bruhin
4ea957b68b Allow Qt 5.11 for backends in configdata.yml 2018-06-11 18:09:18 +02:00
Florian Bruhin
05e73872b6 Add blocking=True to shared.feature_permission 2018-06-11 16:37:53 +02:00
Florian Bruhin
be95d6f505 Remove moved audio API 2018-06-11 16:07:32 +02:00
Florian Bruhin
b954fd4b15 Move _on_feature_permission_requested to WebEngineTab 2018-06-11 16:06:58 +02:00
Florian Bruhin
8964845c18 Remove unused import 2018-06-11 15:30:01 +02:00
Florian Bruhin
c7f57bc111 Tell pylint to shut up about a shadowed argument 2018-06-11 15:29:35 +02:00
Florian Bruhin
f052eff038 Stop using view-source: scheme for Pygments-highlighted URLs
Doing so causes QtWebEngine to load its own view-source: page even if we supply
custom data.

Instead we pass the original page's URL (to not regress #2948).

This partially reverts #3521 and reintroduces TabData.viewing_source.

However, on QtWebEngine we can still ":view-source --pygments" and then
":view-source" (with or without "--pygments") again, because the bit gets
cleaned in _on_load_started.

See #3654.
2018-06-11 15:18:00 +02:00
Florian Bruhin
6e23a6b958 Merge remote-tracking branch 'origin/pr/3654' 2018-06-11 14:56:32 +02:00
Florian Bruhin
cbd9e36e0f Fix typo 2018-06-11 14:13:11 +02:00
Florian Bruhin
b63e06561d Only consider visible render widgets for lost focusProxy
Otherwise, when commenting out the focusProxy way above, and using "foo !npm"
with DuckDuckGo, we get two children (one visible, one invisible).
2018-06-11 14:00:02 +02:00
Florian Bruhin
49b6a512c2 Add missing docstring 2018-06-11 13:17:14 +02:00
Florian Bruhin
2934f4a1ca Merge remote-tracking branch 'origin/pr/3973' 2018-06-11 12:34:18 +02:00
Florian Bruhin
8376278961 Update docs 2018-06-11 12:14:24 +02:00
Florian Bruhin
a1fcdbcfd1 Move muted/audible API to own ".audio" object 2018-06-11 12:12:37 +02:00
Florian Bruhin
1c8d470bd7 Merge remote-tracking branch 'origin/pr/3908' 2018-06-11 12:06:09 +02:00
Florian Bruhin
3999802c71 Add missing 'return' 2018-06-11 11:35:35 +02:00
Florian Bruhin
cf8dbd8bfd Move pressing Enter into a method 2018-06-11 11:35:16 +02:00
Florian Bruhin
7f69920158 Merge remote-tracking branch 'origin/pr/3947' 2018-06-11 11:29:14 +02:00
Jimmy
addd2e74ce Allow negating categories in --logfilter
Sometimes I want to see all the logs _except_ for the sql stuff and
"marked cookies as dirty". with this you should be able to pass
`--logfilter \!sql,save`.
2018-06-11 21:26:54 +12:00
Florian Bruhin
f034abe6a1 Handle showing/hiding of the inspector properly 2018-06-11 11:07:14 +02:00
Florian Bruhin
1ba2e3e24b Implement Qt 5.11 devtools support
See #3010
2018-06-11 11:07:14 +02:00
Jay Kamat
315ed519ee
Use ctrl-enter in all cases 2018-06-10 16:27:56 -07:00
Florian Bruhin
c4add62301 Merge remote-tracking branch 'origin/pr/3825' 2018-06-10 17:30:44 +02:00
Florian Bruhin
3bffe1ccf8 Release v1.3.2 2018-06-10 15:59:50 +02:00
Jay Kamat
11d8df0e3e
Simplify logic and resolve style issues 2018-06-09 16:45:42 -07:00
Jay Kamat
de127497a2
Press enter to follow links instead of using js
This codepath may trigger a crash which was fixed by
0e75f3272d.
However, this commit does not make it more likely to happen, and this
patch was backported into arch (at least).

In the future, we may be able to use <enter> on qtwebkit with js,
without triggering this crash
2018-06-09 15:42:44 -07:00
Florian Bruhin
7fdeeb25b7 Merge remote-tracking branch 'origin/pr/3793' 2018-06-09 22:59:52 +02:00
Florian Bruhin
96739d0013 Merge remote-tracking branch 'origin/pr/3864' 2018-06-09 21:29:15 +02:00
Florian Bruhin
dcb1191f93 Remove the deprecated :tab-detach 2018-06-09 21:25:09 +02:00
Slackhead
c3771ca2b2 double quoted and className corrected 2018-06-09 19:45:48 +01:00
Florian Bruhin
313cc42d8a Link to code.qt.io instead of GitHub for _chromium_version 2018-06-09 20:26:12 +02:00
Florian Bruhin
7ce7176475 Fix lint 2018-06-09 20:20:08 +02:00
Florian Bruhin
1b48b67443 Rename reporter.escape_quits to input.escape_quits_reporter 2018-06-09 20:19:32 +02:00
Florian Bruhin
486a92a710 Merge remote-tracking branch 'origin/pr/3944' 2018-06-09 20:18:25 +02:00
Florian Bruhin
b0325e17b7 Add a YamlConfig._migrate_bool helper 2018-06-09 19:57:11 +02:00
Florian Bruhin
7949335a2b Remove unused import 2018-06-09 19:51:05 +02:00
Florian Bruhin
6e954a1596 Allow to force software rendering with wayland on Qt 5.11
Closes #2932 (hopefully for the last time)
2018-06-09 16:50:48 +02:00
Florian Bruhin
88f2873a79 Allow more values for the qt.force_software_rendering setting 2018-06-09 16:21:10 +02:00
Jay Kamat
5d38d28fee
Fix incorrect usage of tab_id 2018-06-08 20:59:25 -07:00
Florian Bruhin
d32d541ac0 Further simplify getting focusProxy children 2018-06-08 17:10:47 +02:00
Florian Bruhin
cc497bf2ea Improve RWHV typecheck for focusProxy 2018-06-08 15:13:48 +02:00
Florian Bruhin
9725d9ce33 Exclude QMenu when trying to find the missing focusProxy 2018-06-08 14:55:34 +02:00
Florian Bruhin
1531961aeb Show children in focusProxy workaround 2018-06-08 14:40:59 +02:00
Florian Bruhin
91b4106dcf Fix check for reloads on Qt < 5.11
This was broken in 6ccd69dad2
2018-06-08 08:53:10 +02:00
Florian Bruhin
4614ad5063 Remove unused import 2018-06-07 18:01:29 +02:00
Florian Bruhin
d541634a7c Avoid hacks for changing per-domain settings on Qt 5.11.1 2018-06-07 17:51:21 +02:00
Florian Bruhin
b1506274c5 Implement a better workaround for chrome-error:// URLs
It looks like chrome-error://chromewebdata/ triggers another invalid scheme
load which is why the endless loop happens. When we install a custom scheme
handler for chrome-error:// we can at least show an error page.
2018-06-07 16:03:25 +02:00
Florian Bruhin
89f4333df1 Make sure external schemes are clickable via hints
This issue was probably introduced in 545539f28d
- with JavaScript, we can't "click" on an external link.

There might be a better solution using
QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::AllowAllUnknownUrlSchemes)
temporarily when using hints with PyQt 5.11.

Fixes #2833
2018-06-07 14:33:49 +02:00
Florian Bruhin
0c0d204fd4 Add a workaround for chrome-error:// loops on Qt 5.11
See #3661
2018-06-07 13:49:33 +02:00
Florian Bruhin
0e9159e8e8 Revert "Fix Qt 5.11 issues with clicking invalid links"
This reverts commit 1956590df84a72c7f9a516e805d01529291fccf8.

Turns out the actual issue wasn't due to *invalid* links - it's with links
which have an unknown scheme.

There's still a change in behavior between Qt 5.10 and 5.11 though: Invalid
links are apparently not passed to acceptNavigationRequest (sometimes?) so we
don't show an error message. Instead, we just load about:blank. However,
Chromium does that too and we can't handle a real click easily, so let's just
ignore that one.

See #3661
2018-06-07 13:49:13 +02:00
Florian Bruhin
3d53d0d2c5 Fix Qt 5.11 issues with clicking invalid links
See #3661
2018-06-07 13:48:04 +02:00
Florian Bruhin
456fdc55cc Only set PseudoLayout with Qt 5.11 2018-06-06 20:26:12 +02:00
Florian Bruhin
7e31897dcc Fix lint 2018-06-06 20:26:12 +02:00
Florian Bruhin
5147fc832c Handle resizing via PseudoLayout
This fixes the scenario where we just get a grey view when opening a link in a
tab from DuckDuckGo.
2018-06-06 20:26:12 +02:00
Florian Bruhin
ec6c5ebb69 Try harder to get the RenderWidgetHostViewQt 2018-06-06 20:26:12 +02:00
Florian Bruhin
34d054e8a5 Revert "Use WrapperLayout instead of PseudoLayout"
This reverts commit 6cc920472ee4170b257a0b588687b175162e83df.

Since self._widget can go stale in the layout, we need to somehow solve this differently...
2018-06-06 20:26:12 +02:00
Florian Bruhin
e0213e7447 Use WrapperLayout instead of PseudoLayout 2018-06-06 20:26:12 +02:00
Florian Bruhin
cee88cd7ca Initial proof of concept for pseudo layout
Fixes #3920 - hopefully properly this time...
2018-06-06 20:26:12 +02:00