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

Unified Diff: background.js

Issue 5138680696012800: Issue 616 - Enforce $generichide and $genericblock in Chrome (Closed)
Patch Set: Created March 11, 2015, 5:09 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 | webrequest.js » ('j') | webrequest.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
diff --git a/background.js b/background.js
index 36158a2d5c129bcb5b81a9d375a72e7b24e2358f..2034beb32525e365a5bc09f6067288c093ead08d 100644
--- a/background.js
+++ b/background.js
@@ -471,7 +471,9 @@ ext.onMessage.addListener(function (msg, sender, sendResponse)
!isFrameWhitelisted(sender.page, sender.frame, "ELEMHIDE"))
{
var noStyleRules = false;
+ var specificOnly = isFrameWhitelisted(sender.page, sender.frame, "GENERICHIDE");
Sebastian Noack 2015/03/12 12:36:12 I'm concerned about the performance implications r
kzar 2015/03/12 19:22:45 That sound sensible to me but as you mentioned to
var host = extractHostFromFrame(sender.frame);
+
for (var i = 0; i < noStyleRulesHosts.length; i++)
{
var noStyleHost = noStyleRulesHosts[i];
@@ -481,7 +483,7 @@ ext.onMessage.addListener(function (msg, sender, sendResponse)
noStyleRules = true;
}
}
- selectors = ElemHide.getSelectorsForDomain(host, false);
+ selectors = ElemHide.getSelectorsForDomain(host, specificOnly);
if (noStyleRules)
{
selectors = selectors.filter(function(s)
« no previous file with comments | « no previous file | webrequest.js » ('j') | webrequest.js » ('J')

Powered by Google App Engine
This is Rietveld