aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options.js9
-rw-r--r--ext/bg/js/util.js6
2 files changed, 14 insertions, 1 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 1b675da2..4eafd9ef 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -86,6 +86,15 @@ function updateVisibility(options) {
} else {
advanced.hide();
}
+
+ const debug = $('#debug');
+ if (options.general.debugInfo) {
+ const text = JSON.stringify(options, null, 4);
+ debug.html(handlebarsEscape(text));
+ debug.show();
+ } else {
+ debug.hide();
+ }
}
function onOptionsChanged(e) {
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 64c79ab5..593e7d03 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -504,9 +504,13 @@ function jsonLoadDb(indexUrl, indexLoaded, termsLoaded, kanjiLoaded) {
* Helpers
*/
+function handlebarsEscape(text) {
+ return Handlebars.Utils.escapeExpression(text);
+}
+
function handlebarsDumpObject(options) {
const dump = JSON.stringify(options.fn(this), null, 4);
- return Handlebars.Utils.escapeExpression(dump);
+ return handlebarsEscape(dump);
}
function handlebarsKanjiLinks(options) {