Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 break; | 332 break; |
333 case "should-collapse": | 333 case "should-collapse": |
334 if (isFrameWhitelisted(sender.page, sender.frame, RegExpFilter.typeMap.DOC UMENT)) | 334 if (isFrameWhitelisted(sender.page, sender.frame, RegExpFilter.typeMap.DOC UMENT)) |
335 { | 335 { |
336 sendResponse(false); | 336 sendResponse(false); |
337 break; | 337 break; |
338 } | 338 } |
339 | 339 |
340 var typeMask = RegExpFilter.typeMap[msg.mediatype]; | 340 var typeMask = RegExpFilter.typeMap[msg.mediatype]; |
341 var documentHost = extractHostFromFrame(sender.frame); | 341 var documentHost = extractHostFromFrame(sender.frame); |
342 var sitekey = getKey(sender.page, sender.frame); | |
342 var blocked = false; | 343 var blocked = false; |
343 | 344 |
344 for (var i = 0; i < msg.urls.length; i++) | 345 for (var i = 0; i < msg.urls.length; i++) |
345 { | 346 { |
346 var url = new URL(msg.urls[i], msg.baseURL); | 347 var url = new URL(msg.urls[i], msg.baseURL); |
347 var filter = defaultMatcher.matchesAny( | 348 var filter = defaultMatcher.matchesAny( |
348 stringifyURL(url), typeMask, | 349 stringifyURL(url), typeMask, |
349 documentHost, isThirdParty(url, documentHost), | 350 documentHost, isThirdParty(url, documentHost), sitekey |
350 getKey(sender.page, sender.frame) | |
Sebastian Noack
2015/10/08 04:45:04
Mind getting the key above, outside of the loop?
Thomas Greiner
2015/10/08 12:39:36
Done.
| |
351 ); | 351 ); |
352 | 352 |
353 if (filter instanceof BlockingFilter) | 353 if (filter instanceof BlockingFilter) |
354 { | 354 { |
355 if (filter.collapse != null) | 355 if (filter.collapse != null) |
356 { | 356 { |
357 sendResponse(filter.collapse); | 357 sendResponse(filter.collapse); |
358 return; | 358 return; |
359 } | 359 } |
360 | 360 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 break; | 428 break; |
429 } | 429 } |
430 }); | 430 }); |
431 | 431 |
432 // update icon when page changes location | 432 // update icon when page changes location |
433 ext.pages.onLoading.addListener(function(page) | 433 ext.pages.onLoading.addListener(function(page) |
434 { | 434 { |
435 page.sendMessage({type: "clickhide-deactivate"}); | 435 page.sendMessage({type: "clickhide-deactivate"}); |
436 refreshIconAndContextMenu(page); | 436 refreshIconAndContextMenu(page); |
437 }); | 437 }); |
LEFT | RIGHT |