OLD | NEW |
1 #include <AdblockPlus.h> | 1 #include <AdblockPlus.h> |
2 #include <functional> | 2 #include <functional> |
3 #include <vector> | 3 #include <vector> |
4 #include <thread> | 4 #include <thread> |
5 #include <Windows.h> | 5 #include <Windows.h> |
6 | 6 |
7 #include "../shared/AutoHandle.h" | 7 #include "../shared/AutoHandle.h" |
8 #include "../shared/Communication.h" | 8 #include "../shared/Communication.h" |
9 #include "../shared/Dictionary.h" | 9 #include "../shared/Dictionary.h" |
10 #include "../shared/Utils.h" | 10 #include "../shared/Utils.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 break; | 189 break; |
190 } | 190 } |
191 case Communication::PROC_IS_WHITELISTED_URL: | 191 case Communication::PROC_IS_WHITELISTED_URL: |
192 { | 192 { |
193 std::string url; | 193 std::string url; |
194 request >> url; | 194 request >> url; |
195 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", ur
l); | 195 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", ur
l); |
196 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE
PTION); | 196 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE
PTION); |
197 break; | 197 break; |
198 } | 198 } |
| 199 case Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL: |
| 200 { |
| 201 std::string url; |
| 202 request >> url; |
| 203 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "ELEMHIDE", ur
l); |
| 204 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE
PTION); |
| 205 break; |
| 206 } |
199 case Communication::PROC_ADD_FILTER: | 207 case Communication::PROC_ADD_FILTER: |
200 { | 208 { |
201 std::string text; | 209 std::string text; |
202 request >> text; | 210 request >> text; |
203 | 211 |
204 filterEngine->GetFilter(text)->AddToList(); | 212 filterEngine->GetFilter(text)->AddToList(); |
205 break; | 213 break; |
206 } | 214 } |
207 case Communication::PROC_REMOVE_FILTER: | 215 case Communication::PROC_REMOVE_FILTER: |
208 { | 216 { |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 484 } |
477 catch (const std::runtime_error& e) | 485 catch (const std::runtime_error& e) |
478 { | 486 { |
479 DebugException(e); | 487 DebugException(e); |
480 return 1; | 488 return 1; |
481 } | 489 } |
482 } | 490 } |
483 | 491 |
484 return 0; | 492 return 0; |
485 } | 493 } |
OLD | NEW |