diff --git a/storage.js b/storage.js index f2f2d8e4..e7b7babd 100644 --- a/storage.js +++ b/storage.js @@ -79,14 +79,15 @@ function getStyles(options, callback) { function filterStyles({ - enabled, + enabled = null, url = null, id = null, matchUrl = null, asHash = null, strictRegexp = true, // used by the popup to detect bad regexps } = {}) { - enabled = fixBoolean(enabled); + enabled = enabled === null || typeof enabled == 'boolean' ? enabled : + typeof enabled == 'string' ? enabled == 'true' : null; id = id === null ? null : Number(id); if (enabled === null @@ -504,14 +505,6 @@ function reportError(...args) { } -function fixBoolean(b) { - if (typeof b != 'undefined') { - return b != 'false'; - } - return null; -} - - function getDomains(url) { if (url.indexOf('file:') == 0) { return [];