| Index: src/plugin/AdblockPlusClient.cpp |
| diff --git a/src/plugin/AdblockPlusClient.cpp b/src/plugin/AdblockPlusClient.cpp |
| index ee2224d7d8978367fbf64023ece5ae0bc98b526e..3464ffb6e1a98d93d7240b3f395104908a693bc4 100644 |
| --- a/src/plugin/AdblockPlusClient.cpp |
| +++ b/src/plugin/AdblockPlusClient.cpp |
| @@ -151,7 +151,7 @@ namespace |
| } |
| CAdblockPlusClient* CAdblockPlusClient::s_instance = NULL; |
| -CComAutoCriticalSection CAdblockPlusClient::s_criticalSectionLocal; |
| +CComAutoCriticalSection CAdblockPlusClient::s_criticalSectionLocal; |
| CAdblockPlusClient::CAdblockPlusClient() |
| { |
| @@ -261,19 +261,24 @@ bool CAdblockPlusClient::IsElementHidden(const std::wstring& tag, IHTMLElement* |
| bool CAdblockPlusClient::IsWhitelistedUrl(const std::wstring& url) |
| { |
| + return !GetWhitelistingFilter(url).empty(); |
| +} |
| + |
| +std::string CAdblockPlusClient::GetWhitelistingFilter(const std::wstring& url) |
| +{ |
| DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" start").c_str()); |
| Communication::OutputBuffer request; |
| - request << Communication::PROC_IS_WHITELISTED_URL << ToUtf8String(url); |
| + request << Communication::PROC_GET_WHITELISTING_FITER << ToUtf8String(url); |
| Communication::InputBuffer response; |
| if (!CallEngine(request, response)) |
| - return false; |
| + return ""; |
| - bool isWhitelisted; |
| - response >> isWhitelisted; |
| + std::string filterText; |
| + response >> filterText; |
| DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" end").c_str()); |
| - return isWhitelisted; |
| + return filterText; |
| } |
| bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url) |
| @@ -406,8 +411,13 @@ void CAdblockPlusClient::AddFilter(const std::wstring& text) |
| void CAdblockPlusClient::RemoveFilter(const std::wstring& text) |
| { |
| + RemoveFilter(ToUtf8String(text)); |
| +} |
| + |
| +void CAdblockPlusClient::RemoveFilter(const std::string& text) |
| +{ |
| Communication::OutputBuffer request; |
| - request << Communication::PROC_REMOVE_FILTER << ToUtf8String(text); |
| + request << Communication::PROC_REMOVE_FILTER << text; |
| CallEngine(request); |
| } |