parent
17846ea386
commit
be26efddd3
@ -85,6 +85,8 @@ Fixed
|
||||
- The outdated header `X-Do-Not-Track` is no longer sent.
|
||||
- A javascript error on page load when using Qt 5.12 was fixed.
|
||||
- `window.print()` works with Qt 5.12 now.
|
||||
- PAC proxies were never correctly supported with QtWebEngine, but are now
|
||||
explicitly disallowed.
|
||||
|
||||
v1.5.2
|
||||
------
|
||||
|
@ -208,6 +208,8 @@ class PACResolver:
|
||||
Return:
|
||||
A list of QNetworkProxy objects in order of preference.
|
||||
"""
|
||||
qtutils.ensure_valid(query.url())
|
||||
|
||||
if from_file:
|
||||
string_flags = QUrl.PrettyDecoded
|
||||
else:
|
||||
|
@ -20,10 +20,12 @@
|
||||
"""Handling of proxies."""
|
||||
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtNetwork import QNetworkProxy, QNetworkProxyFactory
|
||||
|
||||
from qutebrowser.config import config, configtypes
|
||||
from qutebrowser.utils import objreg
|
||||
from qutebrowser.utils import objreg, message, usertypes, urlutils
|
||||
from qutebrowser.misc import objects
|
||||
from qutebrowser.browser.network import pac
|
||||
|
||||
|
||||
@ -33,6 +35,18 @@ def init():
|
||||
objreg.register('proxy-factory', proxy_factory)
|
||||
QNetworkProxyFactory.setApplicationProxyFactory(proxy_factory)
|
||||
|
||||
config.instance.changed.connect(_warn_for_pac)
|
||||
_warn_for_pac()
|
||||
|
||||
|
||||
@config.change_filter('content.proxy', function=True)
|
||||
def _warn_for_pac():
|
||||
"""Show a warning if PAC is used with QtWebEngine."""
|
||||
proxy = config.val.content.proxy
|
||||
if (isinstance(proxy, pac.PACFetcher) and
|
||||
objects.backend == usertypes.Backend.QtWebEngine):
|
||||
message.error("PAC support isn't implemented for QtWebEngine yet!")
|
||||
|
||||
|
||||
def shutdown():
|
||||
QNetworkProxyFactory.setApplicationProxyFactory(None)
|
||||
@ -70,7 +84,11 @@ class ProxyFactory(QNetworkProxyFactory):
|
||||
# ref. http://doc.qt.io/qt-5/qnetworkproxyfactory.html#systemProxyForQuery
|
||||
proxies = QNetworkProxyFactory.systemProxyForQuery(query)
|
||||
elif isinstance(proxy, pac.PACFetcher):
|
||||
proxies = proxy.resolve(query)
|
||||
if objects.backend == usertypes.Backend.QtWebEngine:
|
||||
# Looks like query.url() is always invalid on QtWebEngine...
|
||||
proxies = [urlutils.proxy_from_url(QUrl('direct://'))]
|
||||
else:
|
||||
proxies = proxy.resolve(query)
|
||||
else:
|
||||
proxies = [proxy]
|
||||
for p in proxies:
|
||||
|
Loading…
Reference in New Issue
Block a user