From 0e5ab44f67ed89128588bdc64f83f7916032fe8b Mon Sep 17 00:00:00 2001 From: eight Date: Fri, 1 Sep 2017 18:21:01 +0800 Subject: [PATCH] Fix: remove message.js dependency from localization.js --- js/localization.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/localization.js b/js/localization.js index 0065d22c..0176f949 100644 --- a/js/localization.js +++ b/js/localization.js @@ -103,7 +103,11 @@ function tNodeList(nodes) { function tDocLoader() { t.DOMParser = new DOMParser(); - t.cache = tryJSONparse(localStorage.L10N) || {}; + try { + t.cache = JSON.parse(localStorage.L10N); + } catch (err) { + t.cache = {}; + } // reset L10N cache on UI language change const UIlang = chrome.i18n.getUILanguage();