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

Side by Side Diff: lib/elemHideFF.js

Issue 29362064: #4624 - Element hiding rules should not apply on whitelisted schemes (chrome://, file:/// etc.) (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Nov. 9, 2016, 9 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 }); 50 });
51 51
52 port.on("getSelectorsForDomain", ([domain, specificOnly]) => 52 port.on("getSelectorsForDomain", ([domain, specificOnly]) =>
53 { 53 {
54 let type = specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.NO_UNCONDITIONAL; 54 let type = specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.NO_UNCONDITIONAL;
55 return ElemHide.getSelectorsForDomain(domain, type, true); 55 return ElemHide.getSelectorsForDomain(domain, type, true);
56 }); 56 });
57 57
58 port.on("elemhideEnabled", ({frames, isPrivate}) => 58 port.on("elemhideEnabled", ({frames, isPrivate}) =>
59 { 59 {
60 if (!Prefs.enabled) 60 if (!Prefs.enabled || !Policy.isBlockableScheme(frames[0].location))
61 return {enabled: false}; 61 return {enabled: false};
62 62
63 let hit = Policy.isFrameWhitelisted(frames, true); 63 let hit = Policy.isFrameWhitelisted(frames, true);
64 if (hit) 64 if (hit)
65 { 65 {
66 let [frameIndex, contentType, docDomain, thirdParty, location, filter] = hit ; 66 let [frameIndex, contentType, docDomain, thirdParty, location, filter] = hit ;
67 if (!isPrivate) 67 if (!isPrivate)
68 FilterStorage.increaseHitCount(filter); 68 FilterStorage.increaseHitCount(filter);
69 return { 69 return {
70 enabled: contentType == "GENERICHIDE", 70 enabled: contentType == "GENERICHIDE",
(...skipping 26 matching lines...) Expand all
97 97
98 return { 98 return {
99 contentType: "ELEMHIDE", 99 contentType: "ELEMHIDE",
100 docDomain, 100 docDomain,
101 thirdParty: false, 101 thirdParty: false,
102 location: filter.text.replace(/^.*?#/, '#'), 102 location: filter.text.replace(/^.*?#/, '#'),
103 filter: filter.text, 103 filter: filter.text,
104 filterType: filter.type 104 filterType: filter.type
105 }; 105 };
106 }); 106 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld