| 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-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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| (...skipping 15 matching lines...) Expand all Loading... |
| 29 m_filter.hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL); | 29 m_filter.hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL); |
| 30 | 30 |
| 31 CPluginClient* client = CPluginClient::GetInstance(); | 31 CPluginClient* client = CPluginClient::GetInstance(); |
| 32 m_traverser = new CPluginDomTraverser(static_cast<CPluginTab*>(this)); | 32 m_traverser = new CPluginDomTraverser(static_cast<CPluginTab*>(this)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 CPluginTab::~CPluginTab() | 35 CPluginTab::~CPluginTab() |
| 36 { | 36 { |
| 37 delete m_traverser; | 37 delete m_traverser; |
| 38 m_traverser = NULL; | 38 m_traverser = NULL; |
| 39 /** |
| 40 * ABP only intercepts protocols "http:" and "https:". |
| 41 * We can disable any domain used in those protocol with an appropriate whitelis
t filter. |
| 42 * Thus, the possibility to disable on a particular site depends only on the pro
tocol. |
| 43 */ |
| 44 bool CPluginTab::IsPossibleToDisableOnSite() |
| 45 { |
| 46 auto url = GetDocumentUrl(); |
| 47 return BeginsWith(url, L"http:") || BeginsWith(url, L"https:"); |
| 48 } |
| 49 |
| 39 } | 50 } |
| 40 | 51 |
| 41 namespace | 52 namespace |
| 42 { | 53 { |
| 43 // Entry Point | 54 // Entry Point |
| 44 void FilterLoader(CPluginFilter* filter, const std::wstring& domain) | 55 void FilterLoader(CPluginFilter* filter, const std::wstring& domain) |
| 45 { | 56 { |
| 46 try | 57 try |
| 47 { | 58 { |
| 48 filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSele
ctors(domain)); | 59 filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSele
ctors(domain)); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 { | 354 { |
| 344 if (domain.empty() || domain != m_cacheDomain) | 355 if (domain.empty() || domain != m_cacheDomain) |
| 345 { | 356 { |
| 346 m_cacheFrames.clear(); | 357 m_cacheFrames.clear(); |
| 347 m_cacheDomain = domain; | 358 m_cacheDomain = domain; |
| 348 } | 359 } |
| 349 } | 360 } |
| 350 m_criticalSectionCache.Unlock(); | 361 m_criticalSectionCache.Unlock(); |
| 351 } | 362 } |
| 352 | 363 |
| LEFT | RIGHT |