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

Side by Side Diff: background.js

Issue 29335874: Issue 3636 - Make element collapsing logic consider $genericblock (Closed)
Patch Set: Created Feb. 6, 2016, 1:20 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
« 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 { 322 {
323 sendResponse(false); 323 sendResponse(false);
324 break; 324 break;
325 } 325 }
326 326
327 var typeMask = RegExpFilter.typeMap[msg.mediatype]; 327 var typeMask = RegExpFilter.typeMap[msg.mediatype];
328 var documentHost = extractHostFromFrame(sender.frame); 328 var documentHost = extractHostFromFrame(sender.frame);
329 var sitekey = getKey(sender.page, sender.frame); 329 var sitekey = getKey(sender.page, sender.frame);
330 var blocked = false; 330 var blocked = false;
331 331
332 var specificOnly = checkWhitelisted(
333 sender.page, sender.frame,
334 RegExpFilter.typeMap.GENERICBLOCK
335 );
336
332 for (var i = 0; i < msg.urls.length; i++) 337 for (var i = 0; i < msg.urls.length; i++)
333 { 338 {
334 var url = new URL(msg.urls[i], msg.baseURL); 339 var url = new URL(msg.urls[i], msg.baseURL);
335 var filter = defaultMatcher.matchesAny( 340 var filter = defaultMatcher.matchesAny(
336 stringifyURL(url), typeMask, 341 stringifyURL(url), typeMask,
337 documentHost, isThirdParty(url, documentHost), sitekey 342 documentHost, isThirdParty(url, documentHost),
343 sitekey, specificOnly
338 ); 344 );
339 345
340 if (filter instanceof BlockingFilter) 346 if (filter instanceof BlockingFilter)
341 { 347 {
342 if (filter.collapse != null) 348 if (filter.collapse != null)
343 { 349 {
344 sendResponse(filter.collapse); 350 sendResponse(filter.collapse);
345 return; 351 return;
346 } 352 }
347 353
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 422 }
417 }); 423 });
418 424
419 // update icon when page changes location 425 // update icon when page changes location
420 ext.pages.onLoading.addListener(function(page) 426 ext.pages.onLoading.addListener(function(page)
421 { 427 {
422 page.sendMessage({type: "clickhide-deactivate"}); 428 page.sendMessage({type: "clickhide-deactivate"});
423 refreshIconAndContextMenu(page); 429 refreshIconAndContextMenu(page);
424 showNextNotificationForUrl(page.url); 430 showNextNotificationForUrl(page.url);
425 }); 431 });
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