diff options
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r-- | ext/bg/js/options.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index b9bf85f3..e53a8a13 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -336,7 +336,7 @@ function profileOptionsSetDefaults(options) { const combine = (target, source) => { for (const key in source) { - if (!target.hasOwnProperty(key)) { + if (!hasOwn(target, key)) { target[key] = source[key]; } } @@ -389,7 +389,7 @@ function optionsUpdateVersion(options, defaultProfileOptions) { // Remove invalid const profiles = options.profiles; for (let i = profiles.length - 1; i >= 0; --i) { - if (!utilIsObject(profiles[i])) { + if (!isObject(profiles[i])) { profiles.splice(i, 1); } } @@ -429,7 +429,7 @@ function optionsUpdateVersion(options, defaultProfileOptions) { function optionsLoad() { return new Promise((resolve, reject) => { - chrome.storage.local.get(['options'], store => { + chrome.storage.local.get(['options'], (store) => { const error = chrome.runtime.lastError; if (error) { reject(new Error(error)); @@ -437,17 +437,17 @@ function optionsLoad() { resolve(store.options); } }); - }).then(optionsStr => { + }).then((optionsStr) => { if (typeof optionsStr === 'string') { const options = JSON.parse(optionsStr); - if (utilIsObject(options)) { + if (isObject(options)) { return options; } } return {}; }).catch(() => { return {}; - }).then(options => { + }).then((options) => { return ( Array.isArray(options.profiles) ? optionsUpdateVersion(options, {}) : |