From 2867df4c21b972b95405ef4b9e37b4c48a09b2b2 Mon Sep 17 00:00:00 2001 From: Patric Schmitz Date: Wed, 25 Nov 2015 12:07:39 +0100 Subject: [PATCH] revert log-javascript-console changes --- qutebrowser/browser/webpage.py | 12 ++---------- qutebrowser/config/configdata.py | 9 ++------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/qutebrowser/browser/webpage.py b/qutebrowser/browser/webpage.py index 32e56d798..16460eaad 100644 --- a/qutebrowser/browser/webpage.py +++ b/qutebrowser/browser/webpage.py @@ -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. diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index a010e9e05..41362d1a7 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -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'),