revert log-javascript-console changes
This commit is contained in:
parent
6431542eba
commit
2867df4c21
@ -503,16 +503,8 @@ class BrowserPage(QWebPage):
|
|||||||
|
|
||||||
def javaScriptConsoleMessage(self, msg, line, source):
|
def javaScriptConsoleMessage(self, msg, line, source):
|
||||||
"""Override javaScriptConsoleMessage to use debug log."""
|
"""Override javaScriptConsoleMessage to use debug log."""
|
||||||
|
if config.get('general', 'log-javascript-console'):
|
||||||
log_javascript_console = config.get('general',
|
log.js.debug("[{}:{}] {}".format(source, line, msg))
|
||||||
'log-javascript-console' )
|
|
||||||
logstring = "[{}:{}] {}".format(source, line, msg)
|
|
||||||
logmap = {
|
|
||||||
'debug': log.js.debug,
|
|
||||||
'info': log.js.info,
|
|
||||||
'none': lambda arg: None
|
|
||||||
}
|
|
||||||
logmap[log_javascript_console](logstring)
|
|
||||||
|
|
||||||
def chooseFile(self, _frame, suggested_file):
|
def chooseFile(self, _frame, suggested_file):
|
||||||
"""Override QWebPage's chooseFile to be able to chose a file to upload.
|
"""Override QWebPage's chooseFile to be able to chose a file to upload.
|
||||||
|
@ -229,13 +229,8 @@ def data(readonly=False):
|
|||||||
"launched."),
|
"launched."),
|
||||||
|
|
||||||
('log-javascript-console',
|
('log-javascript-console',
|
||||||
SettingValue(typ.String(
|
SettingValue(typ.Bool(), 'false'),
|
||||||
valid_values=typ.ValidValues(
|
"Whether to log javascript console messages."),
|
||||||
('none', 'Not displayed'),
|
|
||||||
('debug', 'Display in debug mode'),
|
|
||||||
('info', 'Display always')
|
|
||||||
)), 'debug'),
|
|
||||||
"How to log javascript console messages."),
|
|
||||||
|
|
||||||
('save-session',
|
('save-session',
|
||||||
SettingValue(typ.Bool(), 'false'),
|
SettingValue(typ.Bool(), 'false'),
|
||||||
|
Loading…
Reference in New Issue
Block a user