Fix: remove message.js dependency from localization.js

This commit is contained in:
eight 2017-09-01 18:21:01 +08:00
parent acd9befc9e
commit 0e5ab44f67

View File

@ -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();