revert log-javascript-console changes

This commit is contained in:
Patric Schmitz 2015-11-25 12:07:39 +01:00
parent 6431542eba
commit 2867df4c21
2 changed files with 4 additions and 17 deletions

View File

@ -503,16 +503,8 @@ class BrowserPage(QWebPage):
def javaScriptConsoleMessage(self, msg, line, source):
"""Override javaScriptConsoleMessage to use debug log."""
log_javascript_console = config.get('general',
'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)
if config.get('general', 'log-javascript-console'):
log.js.debug("[{}:{}] {}".format(source, line, msg))
def chooseFile(self, _frame, suggested_file):
"""Override QWebPage's chooseFile to be able to chose a file to upload.

View File

@ -229,13 +229,8 @@ def data(readonly=False):
"launched."),
('log-javascript-console',
SettingValue(typ.String(
valid_values=typ.ValidValues(
('none', 'Not displayed'),
('debug', 'Display in debug mode'),
('info', 'Display always')
)), 'debug'),
"How to log javascript console messages."),
SettingValue(typ.Bool(), 'false'),
"Whether to log javascript console messages."),
('save-session',
SettingValue(typ.Bool(), 'false'),