Index: src/engine/Main.cpp |
diff --git a/src/engine/Main.cpp b/src/engine/Main.cpp |
index 1f5f17c4dc72f8faa3281f40635b5f644f8178a2..12e1ace3d822c46495ea1c9570b041514b6b10d5 100644 |
--- a/src/engine/Main.cpp |
+++ b/src/engine/Main.cpp |
@@ -106,11 +106,17 @@ namespace |
case Communication::PROC_MATCHES: |
{ |
std::string url; |
- std::string type; |
+ int32_t type; |
std::string documentUrl; |
request >> url >> type >> documentUrl; |
- referrerMapping.Add(url, documentUrl); |
- AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referrerMapping.BuildReferrerChain(documentUrl)); |
+ using namespace AdblockPlus; |
+ auto contentType = static_cast<FilterEngine::ContentType>(type); |
+ auto isFrame = contentType == FilterEngine::ContentType::CONTENT_TYPE_SUBDOCUMENT ? |
+ ReferrerMapping::FrameIndicator::FRAME_INDICATOR_FRAME: |
+ ReferrerMapping::FrameIndicator::FRAME_INDICATOR_NOT_FRAME; |
+ |
+ referrerMapping.Add(url, documentUrl, isFrame); |
+ AdblockPlus::FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildFrameStructure(documentUrl)); |
response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -210,7 +216,8 @@ namespace |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_DOCUMENT, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |
@@ -218,7 +225,8 @@ namespace |
{ |
std::string url; |
request >> url; |
- AdblockPlus::FilterPtr match = filterEngine->Matches(url, "ELEMHIDE", url); |
+ AdblockPlus::FilterPtr match = filterEngine->Matches(url, |
+ AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_ELEMHIDE, url); |
response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCEPTION); |
break; |
} |