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

Delta Between Two Patch Sets: background.js

Issue 29321504: Issue 2738 - Pass bit masks to matching functions (Closed)
Left Patch Set: Updated to match adblockplus changes and addressed feedback Created July 12, 2015, 2:25 p.m.
Right Patch Set: Updated adblockplus dependency Created July 14, 2015, 2:45 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 | dependencies » ('j') | 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-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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 sendResponse(selectors); 328 sendResponse(selectors);
329 break; 329 break;
330 case "should-collapse": 330 case "should-collapse":
331 if (isFrameWhitelisted(sender.page, sender.frame, RegExpFilter.typeMap.DOC UMENT)) 331 if (isFrameWhitelisted(sender.page, sender.frame, RegExpFilter.typeMap.DOC UMENT))
332 { 332 {
333 sendResponse(false); 333 sendResponse(false);
334 break; 334 break;
335 } 335 }
336 336
337 var typeMask = RegExpFilter.typeMap[msg.mediatype];
337 var documentHost = extractHostFromFrame(sender.frame); 338 var documentHost = extractHostFromFrame(sender.frame);
338 var blocked = false; 339 var blocked = false;
339 var typeMask = RegExpFilter.typeMap[msg.mediatype];
Sebastian Noack 2015/07/13 16:41:50 Nit: I'd put it above the declaration of documentH
kzar 2015/07/14 09:22:23 Done.
340 340
341 for (var i = 0; i < msg.urls.length; i++) 341 for (var i = 0; i < msg.urls.length; i++)
342 { 342 {
343 var url = new URL(msg.urls[i], msg.baseURL); 343 var url = new URL(msg.urls[i], msg.baseURL);
344 var filter = defaultMatcher.matchesAny( 344 var filter = defaultMatcher.matchesAny(
345 stringifyURL(url), typeMask, 345 stringifyURL(url), typeMask,
346 documentHost, isThirdParty(url, documentHost) 346 documentHost, isThirdParty(url, documentHost)
347 ); 347 );
348 348
349 if (filter instanceof BlockingFilter) 349 if (filter instanceof BlockingFilter)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 break; 424 break;
425 } 425 }
426 }); 426 });
427 427
428 // update icon when page changes location 428 // update icon when page changes location
429 ext.pages.onLoading.addListener(function(page) 429 ext.pages.onLoading.addListener(function(page)
430 { 430 {
431 page.sendMessage({type: "clickhide-deactivate"}); 431 page.sendMessage({type: "clickhide-deactivate"});
432 refreshIconAndContextMenu(page); 432 refreshIconAndContextMenu(page);
433 }); 433 });
LEFTRIGHT
« no previous file | dependencies » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld