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

Side by Side Diff: include.postload.js

Issue 5132310882025472: Issue 704 - Generate protocol-agnostic request blocking filters with "Block element" (Closed)
Patch Set: Rebased and simplified changes Created Sept. 25, 2014, 8:28 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 var selector = elementClasses.map(function(elClass) 384 var selector = elementClasses.map(function(elClass)
385 { 385 {
386 return "." + elClass.replace(/([^\w-])/, "\\$1"); 386 return "." + elClass.replace(/([^\w-])/, "\\$1");
387 }).join(""); 387 }).join("");
388 388
389 clickHideFilters.push(document.domain + "##" + selector); 389 clickHideFilters.push(document.domain + "##" + selector);
390 selectorList.push(selector); 390 selectorList.push(selector);
391 } 391 }
392 if (url) 392 if (url)
393 { 393 {
394 clickHideFilters.push(url); 394 clickHideFilters.push(url.replace(/.*?:\/\//, '||'));
Thomas Greiner 2014/09/30 11:10:53 Nit: Use double instead of single quotation marks
Wladimir Palant 2014/10/01 18:00:45 It makes sense to use the same regular expression
Sebastian Noack 2014/10/01 18:10:55 Done.
Sebastian Noack 2014/10/01 18:10:55 Done.
395 selectorList.push(elt.localName + '[src="' + elt.getAttribute("src") + '"]') ; 395 selectorList.push(elt.localName + '[src="' + elt.getAttribute("src") + '"]') ;
Wladimir Palant 2014/10/01 18:00:45 Please remove this line, your previous patch did t
Sebastian Noack 2014/10/01 18:10:55 How do you mean? I didn't add this line, I just fi
Wladimir Palant 2014/10/01 18:26:51 As mentioned before, a hiding filter based on the
Sebastian Noack 2014/10/01 18:33:16 We don't generate a filer here. This list is only
396 } 396 }
397 397
398 // Show popup 398 // Show popup
399 clickHide_showDialog(e.clientX, e.clientY, clickHideFilters); 399 clickHide_showDialog(e.clientX, e.clientY, clickHideFilters);
400 400
401 // Highlight the unlucky elements 401 // Highlight the unlucky elements
402 // Restore currentElement's box-shadow and bgcolor so that highlightElements w on't save those 402 // Restore currentElement's box-shadow and bgcolor so that highlightElements w on't save those
403 unhighlightElement(currentElement); 403 unhighlightElement(currentElement);
404 // Highlight the elements specified by selector in yellow 404 // Highlight the elements specified by selector in yellow
405 highlightElements(selectorList.join(",")); 405 highlightElements(selectorList.join(","));
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 625
626 clickHide_deactivate(); 626 clickHide_deactivate();
627 } 627 }
628 break; 628 break;
629 default: 629 default:
630 sendResponse({}); 630 sendResponse({});
631 break; 631 break;
632 } 632 }
633 }); 633 });
634 } 634 }
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