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

Unified Diff: background.js

Issue 4840054052618240: Issue 1428 - Disable "Block Element" on non-HTML pages (Closed)
Patch Set: Removed outdated comment Created Sept. 26, 2014, 10:21 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.postload.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
@@ -92,6 +92,8 @@
// See http://crbug.com/68705.
var noStyleRulesHosts = ["mail.google.com", "mail.yahoo.com", "www.google.com"];
+var htmlPages = new ext.PageMap();
+
function removeDeprecatedOptions()
{
var deprecatedOptions = ["specialCaseYouTube", "experimental", "disableInlineTextAds"];
@@ -138,7 +140,7 @@
// adblocking is active on that page
page.contextMenus.removeAll();
- if (Prefs.shouldShowBlockElementMenu && !whitelisted && /^https?:/.test(page.url))
+ if (Prefs.shouldShowBlockElementMenu && !whitelisted && htmlPages.has(page))
page.contextMenus.create(contextMenuItem);
}
@@ -560,6 +562,10 @@
case "add-sitekey":
processKey(msg.token, sender.page, sender.frame);
break;
+ case "report-html-page":
+ htmlPages.set(sender.page, null);
+ refreshIconAndContextMenu(sender.page);
+ break;
case "forward":
if (sender.page)
{
« no previous file with comments | « no previous file | include.postload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld