OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus extension, | 2 * This file is part of the Adblock Plus extension, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 break; | 530 break; |
531 case "should-collapse": | 531 case "should-collapse": |
532 var tabId = -1; | 532 var tabId = -1; |
533 var frameId = -1; | 533 var frameId = -1; |
534 if (sender.tab) | 534 if (sender.tab) |
535 { | 535 { |
536 tabId = sender.tab.id; | 536 tabId = sender.tab.id; |
537 frameId = getFrameId(tabId, request.documentUrl); | 537 frameId = getFrameId(tabId, request.documentUrl); |
538 } | 538 } |
539 | 539 |
540 var enabled = !isFrameWhitelisted(tabId, frameId, "DOCUMENT"); | 540 if (isFrameWhitelisted(tabId, frameId, "DOCUMENT")) |
541 if (!enabled) | |
542 { | 541 { |
543 sendResponse(false); | 542 sendResponse(false); |
544 break; | 543 break; |
545 } | 544 } |
546 | 545 |
547 var requestHost = extractHostFromURL(request.url); | 546 var requestHost = extractHostFromURL(request.url); |
548 var documentHost = extractHostFromURL(request.documentUrl); | 547 var documentHost = extractHostFromURL(request.documentUrl); |
549 var thirdParty = isThirdParty(requestHost, documentHost); | 548 var thirdParty = isThirdParty(requestHost, documentHost); |
550 var filter = defaultMatcher.matchesAny(request.url, request.type, document
Host, thirdParty); | 549 var filter = defaultMatcher.matchesAny(request.url, request.type, document
Host, thirdParty); |
551 if (filter instanceof BlockingFilter) | 550 if (filter instanceof BlockingFilter) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 refreshIconAndContextMenu(windows[i].tabs[j]); | 596 refreshIconAndContextMenu(windows[i].tabs[j]); |
598 }); | 597 }); |
599 | 598 |
600 // Update icon if a tab changes location | 599 // Update icon if a tab changes location |
601 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) | 600 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) |
602 { | 601 { |
603 chrome.tabs.sendRequest(tabId, {reqtype: "clickhide-deactivate"}) | 602 chrome.tabs.sendRequest(tabId, {reqtype: "clickhide-deactivate"}) |
604 if(changeInfo.status == "loading") | 603 if(changeInfo.status == "loading") |
605 refreshIconAndContextMenu(tab); | 604 refreshIconAndContextMenu(tab); |
606 }); | 605 }); |
OLD | NEW |