Allow a list for content.user_stylesheets
This commit is contained in:
parent
afb3b496e8
commit
4562a3574b
@ -232,13 +232,12 @@ def get_tab(win_id, target):
|
|||||||
|
|
||||||
def get_user_stylesheet():
|
def get_user_stylesheet():
|
||||||
"""Get the combined user-stylesheet."""
|
"""Get the combined user-stylesheet."""
|
||||||
filename = config.val.content.user_stylesheet
|
css = ''
|
||||||
|
stylesheets = config.val.content.user_stylesheets
|
||||||
|
|
||||||
if filename is None:
|
for filename in stylesheets:
|
||||||
css = ''
|
|
||||||
else:
|
|
||||||
with open(filename, 'r', encoding='utf-8') as f:
|
with open(filename, 'r', encoding='utf-8') as f:
|
||||||
css = f.read()
|
css += f.read()
|
||||||
|
|
||||||
if not config.val.scrolling.bar:
|
if not config.val.scrolling.bar:
|
||||||
css += '\nhtml > ::-webkit-scrollbar { width: 0px; height: 0px; }'
|
css += '\nhtml > ::-webkit-scrollbar { width: 0px; height: 0px; }'
|
||||||
|
@ -169,7 +169,7 @@ def _set_user_agent(profile):
|
|||||||
def _update_settings(option):
|
def _update_settings(option):
|
||||||
"""Update global settings when qwebsettings changed."""
|
"""Update global settings when qwebsettings changed."""
|
||||||
websettings.update_mappings(MAPPINGS, option)
|
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(default_profile)
|
||||||
_init_stylesheet(private_profile)
|
_init_stylesheet(private_profile)
|
||||||
elif option == 'content.headers.user_agent':
|
elif option == 'content.headers.user_agent':
|
||||||
|
@ -113,7 +113,7 @@ def _set_user_stylesheet():
|
|||||||
|
|
||||||
def _update_settings(option):
|
def _update_settings(option):
|
||||||
"""Update global settings when qwebsettings changed."""
|
"""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()
|
_set_user_stylesheet()
|
||||||
websettings.update_mappings(MAPPINGS, option)
|
websettings.update_mappings(MAPPINGS, option)
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ MAPPINGS = {
|
|||||||
Attribute(QWebSettings.XSSAuditingEnabled),
|
Attribute(QWebSettings.XSSAuditingEnabled),
|
||||||
'content.default_encoding':
|
'content.default_encoding':
|
||||||
Setter(QWebSettings.setDefaultTextEncoding),
|
Setter(QWebSettings.setDefaultTextEncoding),
|
||||||
# content.user_stylesheet is handled separately
|
# content.user_stylesheets is handled separately
|
||||||
|
|
||||||
'input.spatial_navigation':
|
'input.spatial_navigation':
|
||||||
Attribute(QWebSettings.SpatialNavigationEnabled),
|
Attribute(QWebSettings.SpatialNavigationEnabled),
|
||||||
|
@ -491,12 +491,13 @@ content.ssl_strict:
|
|||||||
type: BoolAsk
|
type: BoolAsk
|
||||||
desc: Validate SSL handshakes.
|
desc: Validate SSL handshakes.
|
||||||
|
|
||||||
content.user_stylesheet:
|
content.user_stylesheets:
|
||||||
type:
|
type:
|
||||||
name: File
|
name: List
|
||||||
|
valtype: File
|
||||||
none_ok: True
|
none_ok: True
|
||||||
default: null
|
default: null
|
||||||
desc: User stylesheet to use.
|
desc: A list of user stylesheets filenames to use.
|
||||||
|
|
||||||
content.webgl:
|
content.webgl:
|
||||||
default: true
|
default: true
|
||||||
|
Loading…
Reference in New Issue
Block a user