Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: background.js

Issue 8787016: Remove "disable inline text-ads" feature (Closed)
Patch Set: Created Nov. 6, 2012, 8:16 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include.textads.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | include.textads.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld