| Index: background.js |
| =================================================================== |
| --- a/background.js |
| +++ b/background.js |
| @@ -61,6 +61,16 @@ |
| // See http://crbug.com/68705. |
| var noStyleRulesHosts = ["mail.google.com", "mail.yahoo.com", "www.google.com"]; |
| +function removeDeprecatedOptions() |
| +{ |
| + var deprecatedOptions = ["specialCaseYouTube", "experimental", "disableInlineTextAds"]; |
| + deprecatedOptions.forEach(function(option) |
| + { |
| + if (option in localStorage) |
| + delete localStorage[option]; |
| + }); |
| +} |
| + |
| // Sets options to defaults, upgrading old options from previous versions as necessary |
| function setDefaultOptions() |
| { |
| @@ -72,13 +82,8 @@ |
| defaultOptionValue("shouldShowIcon", "true"); |
| defaultOptionValue("shouldShowBlockElementMenu", "true"); |
| - defaultOptionValue("disableInlineTextAds", "false"); |
| - // If user had older version installed, get rid of old option |
| - if ("specialCaseYouTube" in localStorage) |
| - delete localStorage.specialCaseYouTube; |
| - if ("experimental" in localStorage) |
| - delete localStorage.experimental; |
| + removeDeprecatedOptions(); |
| } |
| // Upgrade options before we do anything else. |
| @@ -562,7 +567,7 @@ |
| // The page action popup asks us this. |
| if(sender.tab) |
| { |
| - sendResponse({enabled: !isWhitelisted(sender.tab.url), specialCaseYouTube: localStorage["specialCaseYouTube"] == "true", disableInlineTextAds: localStorage["disableInlineTextAds"] == "true"}); |
| + sendResponse({enabled: !isWhitelisted(sender.tab.url)}); |
| return; |
| } |
| break; |