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

Delta Between Two Patch Sets: composer.postload.js

Issue 29356630: Issue 4330 - Avoid suggesting huge URL filters (Closed)
Left Patch Set: Check src length in content script Created Oct. 14, 2016, 4:58 p.m.
Right Patch Set: Changed crazy logic Created Oct. 14, 2016, 5:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 30 matching lines...) Expand all
41 /* Utilities */ 41 /* Utilities */
42 42
43 function getFiltersForElement(element, callback) 43 function getFiltersForElement(element, callback)
44 { 44 {
45 let src = element.getAttribute("src"); 45 let src = element.getAttribute("src");
46 ext.backgroundPage.sendMessage( 46 ext.backgroundPage.sendMessage(
47 { 47 {
48 type: "composer.getFilters", 48 type: "composer.getFilters",
49 tagName: element.localName, 49 tagName: element.localName,
50 id: element.id, 50 id: element.id,
51 src: src && src.length < 1000 && src, 51 src: src && src.length <= 1000 ? src : null,
Sebastian Noack 2016/10/14 17:32:32 This expression is quite weird. Besides that it is
kzar 2016/10/14 17:48:58 Yea you're right, it was pretty weird to be fair :
52 style: element.getAttribute("style"), 52 style: element.getAttribute("style"),
53 classes: Array.prototype.slice.call(element.classList), 53 classes: Array.prototype.slice.call(element.classList),
54 urls: getURLsFromElement(element), 54 urls: getURLsFromElement(element),
55 mediatype: typeMap[element.localName], 55 mediatype: typeMap[element.localName],
56 baseURL: document.location.href 56 baseURL: document.location.href
57 }, 57 },
58 response => 58 response =>
59 { 59 {
60 callback(response.filters, response.selectors); 60 callback(response.filters, response.selectors);
61 }); 61 });
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 577 }
578 }); 578 });
579 } 579 }
580 break; 580 break;
581 } 581 }
582 }); 582 });
583 583
584 if (window == window.top) 584 if (window == window.top)
585 ext.backgroundPage.sendMessage({type: "composer.ready"}); 585 ext.backgroundPage.sendMessage({type: "composer.ready"});
586 } 586 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld