LEFT | RIGHT |
1 #include <AdblockPlus.h> | 1 #include <AdblockPlus.h> |
2 | 2 |
3 using namespace AdblockPlus; | 3 using namespace AdblockPlus; |
4 | 4 |
5 Subscription::Subscription(const std::string& url, const std::string& title) | 5 Subscription::Subscription(const std::string& url, const std::string& title) |
6 : url(url), title(title) | 6 : url(url), title(title) |
7 { | 7 { |
8 } | 8 } |
9 | 9 |
10 FilterEngine::FilterEngine(JsEngine& jsEngine) : jsEngine(jsEngine) | 10 FilterEngine::FilterEngine(JsEngine& jsEngine) : jsEngine(jsEngine) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 std::vector<Subscription> FilterEngine::FetchAvailableSubscriptions() | 50 std::vector<Subscription> FilterEngine::FetchAvailableSubscriptions() |
51 { | 51 { |
52 std::vector<Subscription> availableSubscriptions; | 52 std::vector<Subscription> availableSubscriptions; |
53 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl
ockplus.org/easylist.txt", "EasyList")); | 53 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl
ockplus.org/easylist.txt", "EasyList")); |
54 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl
ockplus.org/easylistgermany+easylist.txt", "EasyList Germany+EasyList")); | 54 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl
ockplus.org/easylistgermany+easylist.txt", "EasyList Germany+EasyList")); |
55 return availableSubscriptions; | 55 return availableSubscriptions; |
56 } | 56 } |
57 | 57 |
58 bool FilterEngine::MatchesFilters(const std::string& url, | 58 bool FilterEngine::Matches(const std::string& url, |
59 const std::string& contentType) const | 59 const std::string& contentType) const |
60 { | 60 { |
61 return subscriptions.size() && url.length() % 2; | 61 return subscriptions.size() && url.length() % 2; |
62 } | 62 } |
63 | 63 |
64 std::vector<std::string> FilterEngine::GetElementHidingRules() const | 64 std::vector<std::string> FilterEngine::GetElementHidingRules() const |
65 { | 65 { |
66 std::vector<std::string> hidingRules; | 66 std::vector<std::string> hidingRules; |
67 hidingRules.push_back("###ad"); | 67 hidingRules.push_back("###ad"); |
68 hidingRules.push_back("##.ad"); | 68 hidingRules.push_back("##.ad"); |
69 return hidingRules; | 69 return hidingRules; |
70 } | 70 } |
LEFT | RIGHT |