Always enable JavaScript for file://, chrome:// and qute://

See #3622
This commit is contained in:
Florian Bruhin 2018-03-05 17:09:47 +01:00
parent 430d69f278
commit a796d1f33f
2 changed files with 6 additions and 3 deletions

View File

@ -263,8 +263,6 @@ def qute_history(url):
return 'text/html', json.dumps(history_data(start_time, offset))
else:
if not config.val.content.javascript.enabled:
return 'text/plain', b'JavaScript is required for qute://history'
return 'text/html', jinja.render(
'history.html',
title='History',

View File

@ -22,7 +22,7 @@
from PyQt5.QtGui import QFont
from qutebrowser.config import config, configutils
from qutebrowser.utils import log, usertypes
from qutebrowser.utils import log, usertypes, urlmatch
from qutebrowser.misc import objects
UNSET = object()
@ -172,6 +172,11 @@ def init(args):
from qutebrowser.browser.webkit import webkitsettings
webkitsettings.init(args)
# Make sure special URLs always get JS support
for pattern in ['file://*', 'chrome://*/*', 'qute://*/*']:
config.instance.set_obj('content.javascript.enabled', True,
pattern=urlmatch.UrlPattern(pattern))
def shutdown():
"""Shut down QWeb(Engine)Settings."""