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: Created Sept. 25, 2014, 4:15 p.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') | include.postload.js » ('J')
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))
Thomas Greiner 2014/09/26 10:03:55 Checking for HTML pages should be done in addition
Sebastian Noack 2014/09/26 10:23:43 What's the point? When our content script, setting
+ 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') | include.postload.js » ('J')

Powered by Google App Engine
This is Rietveld