diff --git a/qutebrowser/browser/shared.py b/qutebrowser/browser/shared.py index 5aafb39f5..260e3d863 100644 --- a/qutebrowser/browser/shared.py +++ b/qutebrowser/browser/shared.py @@ -232,13 +232,12 @@ def get_tab(win_id, target): def get_user_stylesheet(): """Get the combined user-stylesheet.""" - filename = config.val.content.user_stylesheet + css = '' + stylesheets = config.val.content.user_stylesheets - if filename is None: - css = '' - else: + for filename in stylesheets: with open(filename, 'r', encoding='utf-8') as f: - css = f.read() + css += f.read() if not config.val.scrolling.bar: css += '\nhtml > ::-webkit-scrollbar { width: 0px; height: 0px; }' diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index eadc4c540..fd0aa24e0 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -169,7 +169,7 @@ def _set_user_agent(profile): def _update_settings(option): """Update global settings when qwebsettings changed.""" websettings.update_mappings(MAPPINGS, option) - if option in ['scrollbar.hide', 'content.user_stylesheet']: + if option in ['scrollbar.hide', 'content.user_stylesheets']: _init_stylesheet(default_profile) _init_stylesheet(private_profile) elif option == 'content.headers.user_agent': diff --git a/qutebrowser/browser/webkit/webkitsettings.py b/qutebrowser/browser/webkit/webkitsettings.py index a5803cbd6..53b26431c 100644 --- a/qutebrowser/browser/webkit/webkitsettings.py +++ b/qutebrowser/browser/webkit/webkitsettings.py @@ -113,7 +113,7 @@ def _set_user_stylesheet(): def _update_settings(option): """Update global settings when qwebsettings changed.""" - if option in ['scrollbar.hide', 'content.user_stylesheet']: + if option in ['scrollbar.hide', 'content.user_stylesheets']: _set_user_stylesheet() websettings.update_mappings(MAPPINGS, option) @@ -192,7 +192,7 @@ MAPPINGS = { Attribute(QWebSettings.XSSAuditingEnabled), 'content.default_encoding': Setter(QWebSettings.setDefaultTextEncoding), - # content.user_stylesheet is handled separately + # content.user_stylesheets is handled separately 'input.spatial_navigation': Attribute(QWebSettings.SpatialNavigationEnabled), diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 7639a6f8e..66be6b7a9 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -491,12 +491,13 @@ content.ssl_strict: type: BoolAsk desc: Validate SSL handshakes. -content.user_stylesheet: +content.user_stylesheets: type: - name: File + name: List + valtype: File none_ok: True default: null - desc: User stylesheet to use. + desc: A list of user stylesheets filenames to use. content.webgl: default: true