Prevent mixed content downloading by default
https://blog.chromium.org/2020/02/protecting-users-from-insecure.html https://therecord.media/firefox-follows-chrome-and-prepares-to-block-insecure-downloads/
This commit is contained in:
parent
65af6b2125
commit
c022893a76
|
|
@ -25,6 +25,8 @@ Added
|
|||
- New `content.blocking.hosts.block_subdomains` setting which can be used to
|
||||
disable the subdomain blocking for the hosts-based adblocker introduced in
|
||||
v2.3.0.
|
||||
- New `downloads.prevent_mixed_content` setting to prevent insecure
|
||||
mixed-content downloads (true by default).
|
||||
|
||||
Fixed
|
||||
~~~~~
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@
|
|||
|<<downloads.location.suggestion,downloads.location.suggestion>>|What to display in the download filename input.
|
||||
|<<downloads.open_dispatcher,downloads.open_dispatcher>>|Default program used to open downloads.
|
||||
|<<downloads.position,downloads.position>>|Where to show the downloaded files.
|
||||
|<<downloads.prevent_mixed_content,downloads.prevent_mixed_content>>|Automatically abort insecure (HTTP) downloads originating from secure (HTTPS) pages.
|
||||
|<<downloads.remove_finished,downloads.remove_finished>>|Duration (in milliseconds) to wait before removing finished downloads.
|
||||
|<<editor.command,editor.command>>|Editor (and arguments) to use for the `edit-*` commands.
|
||||
|<<editor.encoding,editor.encoding>>|Encoding to use for the editor.
|
||||
|
|
@ -2888,6 +2889,19 @@ Valid values:
|
|||
|
||||
Default: +pass:[top]+
|
||||
|
||||
[[downloads.prevent_mixed_content]]
|
||||
=== downloads.prevent_mixed_content
|
||||
Automatically abort insecure (HTTP) downloads originating from secure (HTTPS) pages.
|
||||
For per-domain settings, the relevant URL is the URL initiating the download, not the URL the download itself is coming from. It's not recommended to set this setting to false globally.
|
||||
|
||||
This setting supports URL patterns.
|
||||
|
||||
This setting is only available with the QtWebEngine backend.
|
||||
|
||||
Type: <<types,Bool>>
|
||||
|
||||
Default: +pass:[true]+
|
||||
|
||||
[[downloads.remove_finished]]
|
||||
=== downloads.remove_finished
|
||||
Duration (in milliseconds) to wait before removing finished downloads.
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ from PyQt5.QtWebEngineWidgets import QWebEngineDownloadItem
|
|||
from qutebrowser.browser import downloads, pdfjs
|
||||
from qutebrowser.utils import (debug, usertypes, message, log, objreg, urlutils,
|
||||
utils, version)
|
||||
from qutebrowser.config import config
|
||||
|
||||
|
||||
class DownloadItem(downloads.AbstractDownloadItem):
|
||||
|
|
@ -298,6 +299,15 @@ class DownloadManager(downloads.AbstractDownloadManager):
|
|||
qt_item.cancel()
|
||||
return
|
||||
|
||||
if (url.scheme() == "http" and
|
||||
origin.isValid() and origin.scheme() == "https" and
|
||||
config.instance.get("downloads.prevent_mixed_content", url=origin)):
|
||||
# FIXME show failed download instead
|
||||
message.error("Aborting insecure download from secure page "
|
||||
"(see downloads.prevent_mixed_content).")
|
||||
qt_item.cancel()
|
||||
return
|
||||
|
||||
# Ask the user for a filename - needs to be blocking!
|
||||
question = downloads.get_filename_question(
|
||||
suggested_filename=suggested_filename, url=qt_item.url(),
|
||||
|
|
|
|||
|
|
@ -1355,6 +1355,19 @@ downloads.position:
|
|||
default: top
|
||||
desc: Where to show the downloaded files.
|
||||
|
||||
downloads.prevent_mixed_content:
|
||||
type: Bool
|
||||
default: true
|
||||
supports_pattern: true
|
||||
backend: QtWebEngine
|
||||
desc:
|
||||
Automatically abort insecure (HTTP) downloads originating from secure
|
||||
(HTTPS) pages.
|
||||
|
||||
For per-domain settings, the relevant URL is the URL initiating the
|
||||
download, not the URL the download itself is coming from. It's not
|
||||
recommended to set this setting to false globally.
|
||||
|
||||
downloads.remove_finished:
|
||||
default: -1
|
||||
type:
|
||||
|
|
|
|||
Loading…
Reference in New Issue