| OLD | NEW |
| 1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
| 2 | 2 |
| 3 #include "PluginClient.h" | 3 #include "PluginClient.h" |
| 4 #include "PluginFilter.h" | 4 #include "PluginFilter.h" |
| 5 #include "PluginSettings.h" | 5 #include "PluginSettings.h" |
| 6 | 6 |
| 7 #include "SimpleAdblockDomTraverser.h" | 7 #include "SimpleAdblockDomTraverser.h" |
| 8 | 8 |
| 9 | 9 |
| 10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB
ase(tab) | 10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB
ase(tab) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 { | 22 { |
| 23 HideElement(pEl, "iframe", url, true, indent); | 23 HideElement(pEl, "iframe", url, true, indent); |
| 24 } | 24 } |
| 25 | 25 |
| 26 return !isBlocked; | 26 return !isBlocked; |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const CString& tag, CPlug
inDomTraverserCache* cache, bool isDebug, CString& indent) | 30 bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const CString& tag, CPlug
inDomTraverserCache* cache, bool isDebug, CString& indent) |
| 31 { | 31 { |
| 32 //is plugin registered | |
| 33 CPluginSettings* settings = CPluginSettings::GetInstance(); | |
| 34 if (!settings->GetBool(SETTING_PLUGIN_REGISTRATION, false)) | |
| 35 { | |
| 36 //is the limit exceeded? | |
| 37 if ((settings->GetValue(SETTING_PLUGIN_ADBLOCKCOUNT, 0) >= setti
ngs->GetValue(SETTING_PLUGIN_ADBLOCKLIMIT, 0)) && | |
| 38 (settings->GetValue(SETTING_PLUGIN_ADBLOCKLIMIT, 0) > 0)
) | |
| 39 { | |
| 40 return true; | |
| 41 } | |
| 42 } | |
| 43 | |
| 44 if (cache->m_isHidden) | 32 if (cache->m_isHidden) |
| 45 { | 33 { |
| 46 return false; | 34 return false; |
| 47 } | 35 } |
| 48 | 36 |
| 49 // Check if element is hidden | 37 // Check if element is hidden |
| 50 CPluginClient* client = CPluginClient::GetInstance(); | 38 CPluginClient* client = CPluginClient::GetInstance(); |
| 51 | 39 |
| 52 cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent); | 40 cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent); |
| 53 if (cache->m_isHidden) | 41 if (cache->m_isHidden) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 139 |
| 152 #ifdef ENABLE_DEBUG_RESULT | 140 #ifdef ENABLE_DEBUG_RESULT |
| 153 if (isDebug) | 141 if (isDebug) |
| 154 { | 142 { |
| 155 CPluginDebug::DebugResultHiding(type, url, "-", "-"); | 143 CPluginDebug::DebugResultHiding(type, url, "-", "-"); |
| 156 } | 144 } |
| 157 #endif // ENABLE_DEBUG_RESULT | 145 #endif // ENABLE_DEBUG_RESULT |
| 158 } | 146 } |
| 159 } | 147 } |
| 160 } | 148 } |
| OLD | NEW |