qutebrowser/qutebrowser

Add settings to block various types of requests

Open

#2,626 opened on May 12, 2017

View on GitHub
 (12 comments) (11 reactions) (0 assignees)Python (9,161 stars) (1,014 forks)batch import
component: configgood first issuepriority: 2 - low

Description

Note: If you're looking at this as a first contribution, please read https://github.com/qutebrowser/qutebrowser/issues/2626#issuecomment-754531629 - some information in this comment is likely outdated (or makes this more complicated that it needs to be in a first step).


This is sort of the first step torwards uMatrix-like functionality: Having a way to block various requests based from data in QWebEngineUrlRequestInfo (per-domain after #27 of course, which is pretty much uMatrix minus the UI).

The main interesting thing there is ResourceType, with the following types:

  • MainFrame (Top level page)
    • Probably no point in allowing to block this
  • SubFrame (Frame or iframe)
  • Stylesheet (A CSS stylesheet)
    • Should be blockable
    • Blockable in uMatrix
    • Probably not blockable in QtWebKit (maybe via mimetype?)
  • Script (An external script)
    • Already handled via content -> allow-javascript.
    • If they still occur with the setting off, might be good to block them
    • Blockable in uMatrix
  • Image (An image (JPG, GIF, PNG, and so on))
    • Already handled via content -> allow-images.
    • If they still occur with the setting off, might be good to block them
    • Blockable in uMatrix
  • FontResource (A font)
    • Should be blockable if those are web fonts
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit (maybe via mimetype?)
  • SubResource (An "other" subresource)
    • Unclear when it happens... Probably fine to leave it right now.
  • Object (An object (or embed) tag for a plugin or a resource that a plugin requested)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit (maybe via mimetype?)
  • Media (A media resource)
    • Should be blockable
    • Blockable in uMatrix
    • Maybe blockable in QtWebKit via mimetype?
    • QtWebKit-NG has QWebSettings::MediaEnabled - we should be able to use the int value without PyQt support
    • Doesn't seem to block YouTube though, as that uses XHR requests...
    • Issue for click-to-play in QtWebEngine: QTBUG-60799
    • See https://github.com/annulen/webkit/issues/357 for click-to-play on QtWebKit; QtWebEngine still needs an issue for this
  • Worker (The main resource of a dedicated worker)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit
  • SharedWorker (The main resource of a shared worker)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit
  • Prefetch (An explicitly requested prefetch)
    • Unclear when it happens...
    • Maybe this would allow to implement network -> dns-prefetch for QtWebEngine?
    • Not blockable in uMatrix
  • Favicon
    • Already handled via content -> allow-images.
    • If they still occur with the setting off, might be good to block them
    • Not blockable in uMatrix
  • Xhr (An XMLHttpRequest)
    • Should be blockable
    • Blockable in uMatrix
    • Probably not blockable in QtWebKit
  • Ping (A ping request for )
    • Already handled via content -> hyperlink-auditing.
    • If they still occur with the setting off, might be good to block them
    • Blockable in uMatrix
  • ServiceWorker (The main resource of a service worker)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit
  • CspReport (A report of Content Security Policy (CSP) violations)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit
  • PluginResource (A resource requested by a plugin)
    • Should maybe be blockable?
    • Not blockable in uMatrix
    • Probably not blockable in QtWebKit
  • Unknown / Other
    • Should be blockable
    • Blockable in uMatrix
    • Probably not blockable in QtWebKit

Contributor guide