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

Side by Side Diff: lib/filterClasses.js

Issue 5840485868371968: Issue 616 - Add $generichide + $genericblock filter options and enforce them. (Closed)
Patch Set: Use camelCase for genericblockMatch variable name Created July 15, 2015, 3:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« lib/contentPolicy.js ('K') | « lib/contentPolicy.js ('k') | 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 PING: 1, 747 PING: 1,
748 XMLHTTPREQUEST: 2048, 748 XMLHTTPREQUEST: 2048,
749 OBJECT_SUBREQUEST: 4096, 749 OBJECT_SUBREQUEST: 4096,
750 DTD: 1, 750 DTD: 1,
751 MEDIA: 16384, 751 MEDIA: 16384,
752 FONT: 32768, 752 FONT: 32768,
753 753
754 BACKGROUND: 4, // Backwards compat, same as IMAGE 754 BACKGROUND: 4, // Backwards compat, same as IMAGE
755 755
756 POPUP: 0x10000000, 756 POPUP: 0x10000000,
757 ELEMHIDE: 0x40000000 757 GENERICBLOCK: 0x20000000,
758 ELEMHIDE: 0x40000000,
759 GENERICHIDE: 0x80000000
758 }; 760 };
759 761
760 // DOCUMENT, ELEMHIDE, POPUP options shouldn't be there by default 762 // DOCUMENT, ELEMHIDE, POPUP, GENERICHIDE and GENERICBLOCK options shouldn't be there by default
Thomas Greiner 2015/08/20 11:36:07 Detail: Mind the 80 character line limitation (als
kzar 2015/08/25 17:42:08 Done.
761 RegExpFilter.prototype.contentType &= ~(RegExpFilter.typeMap.DOCUMENT | RegExpFi lter.typeMap.ELEMHIDE | RegExpFilter.typeMap.POPUP); 763 RegExpFilter.prototype.contentType &= ~(RegExpFilter.typeMap.DOCUMENT |
764 RegExpFilter.typeMap.ELEMHIDE |
765 RegExpFilter.typeMap.POPUP |
766 RegExpFilter.typeMap.GENERICHIDE |
767 RegExpFilter.typeMap.GENERICBLOCK);
762 768
763 /** 769 /**
764 * Class for blocking filters 770 * Class for blocking filters
765 * @param {String} text see Filter() 771 * @param {String} text see Filter()
766 * @param {String} regexpSource see RegExpFilter() 772 * @param {String} regexpSource see RegExpFilter()
767 * @param {Number} contentType see RegExpFilter() 773 * @param {Number} contentType see RegExpFilter()
768 * @param {Boolean} matchCase see RegExpFilter() 774 * @param {Boolean} matchCase see RegExpFilter()
769 * @param {String} domains see RegExpFilter() 775 * @param {String} domains see RegExpFilter()
770 * @param {Boolean} thirdParty see RegExpFilter() 776 * @param {Boolean} thirdParty see RegExpFilter()
771 * @param {String} sitekeys see RegExpFilter() 777 * @param {String} sitekeys see RegExpFilter()
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 // several times on Safari, due to WebKit bug 132872 1027 // several times on Safari, due to WebKit bug 132872
1022 let prop = Object.getOwnPropertyDescriptor(this, "regexpString"); 1028 let prop = Object.getOwnPropertyDescriptor(this, "regexpString");
1023 if (prop) 1029 if (prop)
1024 return prop.value; 1030 return prop.value;
1025 1031
1026 let regexp = Filter.toRegExp(this.regexpSource); 1032 let regexp = Filter.toRegExp(this.regexpSource);
1027 Object.defineProperty(this, "regexpString", {value: regexp}); 1033 Object.defineProperty(this, "regexpString", {value: regexp});
1028 return regexp; 1034 return regexp;
1029 } 1035 }
1030 }; 1036 };
OLDNEW
« lib/contentPolicy.js ('K') | « lib/contentPolicy.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld