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

Unified Diff: lib/filterComposer.js

Issue 4734012065054720: Issue 2634 - Consider alternative URLs for element collapsing (Closed)
Patch Set: Exclude non-HTTP(s) URLs in content script Created June 7, 2015, 3:10 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
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterComposer.js
===================================================================
--- a/lib/filterComposer.js
+++ b/lib/filterComposer.js
@@ -95,24 +95,20 @@
for (let url of details.urls)
{
let urlObj = new URL(url, details.baseURL);
+ url = stringifyURL(urlObj);
- if (urlObj.protocol == "http:" || urlObj.protocol == "https:")
Sebastian Noack 2015/06/07 15:30:06 Since non-HTTP(s) URLs are excluded in the content
+ let filter = defaultMatcher.whitelist.matchesAny(
+ url, details.type, docDomain,
+ isThirdParty(urlObj, docDomain),
+ getKey(page, frame)
+ );
+
+ if (!filter)
{
- url = stringifyURL(urlObj);
+ let filterText = url.replace(/^[\w\-]+:\/+(?:www\.)?/, "||");
- let filter = defaultMatcher.whitelist.matchesAny(
- url, details.type, docDomain,
- isThirdParty(urlObj, docDomain),
- getKey(page, frame)
- );
-
- if (!filter)
- {
- let filterText = url.replace(/^[\w\-]+:\/+(?:www\.)?/, "||");
-
- if (filters.indexOf(filterText) == -1)
- filters.push(filterText);
- }
+ if (filters.indexOf(filterText) == -1)
+ filters.push(filterText);
}
}
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld