Permalink
Browse files

Allow a list for content.user_stylesheets

  • Loading branch information...
The-Compiler committed Jul 3, 2017
1 parent afb3b49 commit 4562a3574b7f887b811a93e76e0f15ac476c6359
@@ -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; }'
@@ -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':
@@ -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 @@ def shutdown():
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),
@@ -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

0 comments on commit 4562a35

Please sign in to comment.