| Index: background.js |
| =================================================================== |
| --- a/background.js |
| +++ b/background.js |
| @@ -73,31 +73,34 @@ |
| { |
| if (action == "load") |
| { |
| - var addonVersion = require("info").addonVersion; |
| - var prevVersion = ext.storage.currentVersion; |
| + ext.storage.get(["currentVersion"], function(items) |
| + { |
| + var addonVersion = require("info").addonVersion; |
| + var prevVersion = items.currentVersion; |
| - // There are no filters stored so we need to reinitialize all filterlists |
| - if (!FilterStorage.firstRun && FilterStorage.subscriptions.length === 0) |
| - { |
| - filterlistsReinitialized = true; |
| - prevVersion = null; |
| - } |
| + // There are no filters stored so we need to reinitialize all filterlists |
| + if (!FilterStorage.firstRun && FilterStorage.subscriptions.length === 0) |
| + { |
| + filterlistsReinitialized = true; |
| + prevVersion = null; |
| + } |
| - if (prevVersion != addonVersion || FilterStorage.firstRun) |
| - { |
| - seenDataCorruption = prevVersion && FilterStorage.firstRun; |
| - ext.storage.currentVersion = addonVersion; |
| - addSubscription(prevVersion); |
| - } |
| + if (prevVersion != addonVersion || FilterStorage.firstRun) |
| + { |
| + seenDataCorruption = prevVersion && FilterStorage.firstRun; |
| + ext.storage.set("currentVersion", addonVersion); |
| + addSubscription(prevVersion); |
| + } |
| + |
| + // The "Hide placeholders" option has been removed from the UI in 1.8.8.1285 |
| + // So we reset the option for users updating from older versions. |
| + if (prevVersion && Services.vc.compare(prevVersion, "1.8.8.1285") < 0) |
| + Prefs.hidePlaceholders = true; |
| + }); |
| if (canUseChromeNotifications) |
| initChromeNotifications(); |
| initAntiAdblockNotification(); |
| - |
| - // The "Hide placeholders" option has been removed from the UI in 1.8.8.1285 |
| - // So we reset the option for users updating from older versions. |
| - if (prevVersion && Services.vc.compare(prevVersion, "1.8.8.1285") < 0) |
| - Prefs.hidePlaceholders = true; |
| } |
| // update browser actions when whitelisting might have changed, |
| @@ -111,20 +114,6 @@ |
| var noStyleRulesHosts = ["mail.google.com", "mail.yahoo.com", "www.google.com"]; |
| var htmlPages = new ext.PageMap(); |
| - |
| -function removeDeprecatedOptions() |
| -{ |
| - var deprecatedOptions = ["specialCaseYouTube", "experimental", "disableInlineTextAds"]; |
| - deprecatedOptions.forEach(function(option) |
| - { |
| - if (option in ext.storage) |
| - delete ext.storage[option]; |
| - }); |
| -} |
| - |
| -// Remove deprecated options before we do anything else. |
| -removeDeprecatedOptions(); |
| - |
| var activeNotification = null; |
| var contextMenuItem = { |