From 2a32e26846b34cf668d2d21d14189934f69316a5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 Jun 2017 12:39:19 +0200 Subject: [PATCH] Get rid of various rarely customized settings All those were customized by some <5 people in the past few years of crash reports. Closes #1751. See #2639. --- CHANGELOG.asciidoc | 8 ++++ doc/help/settings.asciidoc | 14 ------- qutebrowser/browser/webkit/webkitsettings.py | 24 ----------- qutebrowser/config/config.py | 8 +++- qutebrowser/config/configdata.py | 43 -------------------- 5 files changed, 14 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index ccb17816e..a31359046 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -89,6 +89,14 @@ Changed - The installer is now generated using NSIS instead of being a MSI - Texts in prompts are now selectable. - Renderer process crashes now show an error page. +- (QtWebKit) Various rarely customized settings were removed: + - `ui -> css-media-type` (defaults to desktop) + - `general -> site-specific-quirks` (now always turned on) + - `storage -> offline-storage-default-quota` (defaults to 5MB) + - `storage -> offline-web-application-cache-quota` (defaults to no quota) + - `storage -> object-cache-capacities` (default depends on disk space) + - `content -> css-regions` (now always turned off) + Fixed ~~~~~ diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 30fdb19cc..96d0d7abc 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -164,7 +164,6 @@ |<>|Enables or disables the running of JavaScript programs. |<>|Enables or disables plugins in Web pages. |<>|Enables or disables WebGL. -|<>|Enable or disable support for CSS regions. |<>|Enable or disable hyperlink auditing (). |<>|Allow websites to request geolocations. |<>|Allow websites to show notifications. @@ -1473,19 +1472,6 @@ Valid values: Default: +pass:[true]+ -[[content-css-regions]] -=== css-regions -Enable or disable support for CSS regions. - -Valid values: - - * +true+ - * +false+ - -Default: +pass:[true]+ - -This setting is only available with the QtWebKit backend. - [[content-hyperlink-auditing]] === hyperlink-auditing Enable or disable hyperlink auditing (). diff --git a/qutebrowser/browser/webkit/webkitsettings.py b/qutebrowser/browser/webkit/webkitsettings.py index e17681796..63bb86d0f 100644 --- a/qutebrowser/browser/webkit/webkitsettings.py +++ b/qutebrowser/browser/webkit/webkitsettings.py @@ -59,14 +59,6 @@ class Setter(Base, websettings.Setter): pass -class NullStringSetter(Base, websettings.Setter): - - """A setter for settings requiring a null QString as default.""" - - def set_default(self, settings=None): - self._set(None, settings=settings) - - class StaticSetter(Base, websettings.StaticSetter): """A setting set via a static QWebSettings setter method.""" @@ -177,8 +169,6 @@ MAPPINGS = { Attribute(QWebSettings.PluginsEnabled), 'webgl': Attribute(QWebSettings.WebGLEnabled), - 'css-regions': - Attribute(QWebSettings.CSSRegionsEnabled), 'hyperlink-auditing': Attribute(QWebSettings.HyperlinkAuditingEnabled), 'local-content-can-access-remote-urls': @@ -230,8 +220,6 @@ MAPPINGS = { 'frame-flattening': Attribute(QWebSettings.FrameFlatteningEnabled), # user-stylesheet is handled separately - 'css-media-type': - NullStringSetter(QWebSettings.setCSSMediaType), 'smooth-scrolling': Attribute(QWebSettings.ScrollAnimatorEnabled), #'accelerated-compositing': @@ -248,16 +236,6 @@ MAPPINGS = { Attribute(QWebSettings.LocalStorageEnabled), 'maximum-pages-in-cache': StaticSetter(QWebSettings.setMaximumPagesInCache), - 'object-cache-capacities': - StaticSetter(QWebSettings.setObjectCacheCapacities, - unpack=True), - 'offline-storage-default-quota': - StaticSetter(QWebSettings.setOfflineStorageDefaultQuota), - # Default from ApplicationCacheStorage::ApplicationCacheStorage in - # qtwebkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp - 'offline-web-application-cache-quota': - StaticSetter(QWebSettings.setOfflineWebApplicationCacheQuota, - default=qtutils.MAXVALS['int64']), # no quota }, 'general': { 'developer-extras': @@ -266,8 +244,6 @@ MAPPINGS = { Attribute(QWebSettings.PrintElementBackgrounds), 'xss-auditing': Attribute(QWebSettings.XSSAuditingEnabled), - 'site-specific-quirks': - Attribute(QWebSettings.SiteSpecificQuirksEnabled), 'default-encoding': Setter(QWebSettings.setDefaultTextEncoding), } diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 82fe9a501..ae8c2b171 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -403,9 +403,15 @@ class ConfigManager(QObject): ('tabs', 'hide-always'), ('ui', 'display-statusbar-messages'), ('ui', 'hide-mouse-cursor'), + ('ui', 'css-media-type'), ('general', 'wrap-search'), + ('general', 'site-specific-quirks'), ('hints', 'opacity'), ('completion', 'auto-open'), + ('storage', 'object-cache-capacities'), + ('storage', 'offline-storage-default-quota'), + ('storage', 'offline-web-application-cache-quota'), + ('content', 'css-regions'), ] CHANGED_OPTIONS = { ('content', 'cookies-accept'): @@ -450,8 +456,6 @@ class ConfigManager(QObject): _get_value_transformer({'52428800': ''}), ('storage', 'maximum-pages-in-cache'): _get_value_transformer({'': '0'}), - ('storage', 'offline-storage-default-quota'): - _get_value_transformer({'': str(5 * 1024 * 1024)}), ('fonts', 'web-size-minimum'): _get_value_transformer({'': '0'}), ('fonts', 'web-size-minimum-logical'): diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 056aa7edc..321eafcbc 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -215,11 +215,6 @@ def data(readonly=False): "inspector's JavaScript console. Enabling this feature might " "have an impact on performance."), - ('site-specific-quirks', - SettingValue(typ.Bool(), 'true', - backends=[usertypes.Backend.QtWebKit]), - "Enable QtWebKit workarounds for broken sites."), - ('default-encoding', SettingValue(typ.String(), 'iso-8859-1'), "Default encoding to use for websites.\n\n" @@ -349,11 +344,6 @@ def data(readonly=False): SettingValue(typ.Bool(), 'true'), "Hide the main scrollbar."), - ('css-media-type', - SettingValue(typ.String(none_ok=True), '', - backends=[usertypes.Backend.QtWebKit]), - "Set the CSS media type."), - ('smooth-scrolling', SettingValue(typ.Bool(), 'false'), "Whether to enable smooth scrolling for web pages. Note smooth " @@ -777,34 +767,6 @@ def data(readonly=False): "For more information about the feature, please refer to: " "http://webkit.org/blog/427/webkit-page-cache-i-the-basics/"), - ('object-cache-capacities', - SettingValue( - typ.List(typ.WebKitBytes(maxsize=MAXVALS['int'], - none_ok=True), none_ok=True, length=3), '', - backends=[usertypes.Backend.QtWebKit]), - "The capacities for the global memory cache for dead objects " - "such as stylesheets or scripts. Syntax: cacheMinDeadCapacity, " - "cacheMaxDead, totalCapacity.\n\n" - "The _cacheMinDeadCapacity_ specifies the minimum number of " - "bytes that dead objects should consume when the cache is under " - "pressure.\n\n" - "_cacheMaxDead_ is the maximum number of bytes that dead objects " - "should consume when the cache is *not* under pressure.\n\n" - "_totalCapacity_ specifies the maximum number of bytes " - "that the cache should consume *overall*."), - - ('offline-storage-default-quota', - SettingValue(typ.WebKitBytes(maxsize=MAXVALS['int64']), - str(5 * 1024 * 1024), - backends=[usertypes.Backend.QtWebKit]), - "Default quota for new offline storage databases."), - - ('offline-web-application-cache-quota', - SettingValue(typ.WebKitBytes(maxsize=MAXVALS['int64'], - none_ok=True), '', - backends=[usertypes.Backend.QtWebKit]), - "Quota for the offline web application cache."), - ('offline-storage-database', SettingValue(typ.Bool(), 'true', backends=[usertypes.Backend.QtWebKit]), @@ -856,11 +818,6 @@ def data(readonly=False): SettingValue(typ.Bool(), 'true'), "Enables or disables WebGL."), - ('css-regions', - SettingValue(typ.Bool(), 'true', - backends=[usertypes.Backend.QtWebKit]), - "Enable or disable support for CSS regions."), - ('hyperlink-auditing', SettingValue(typ.Bool(), 'false'), "Enable or disable hyperlink auditing ()."),