diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-02-10 20:58:39 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-05-30 11:01:35 +0300 |
commit | d1287f43964633035938f4f4d4133bb6d9da7b3e (patch) | |
tree | d09efa4074815c20be9bd6348203fe4336dfe716 /lib/urlfilter/urlfilter.h | |
parent | Fix segfault in release build (diff) | |
download | smolbote-d1287f43964633035938f4f4d4133bb6d9da7b3e.tar.xz |
staging: smolblok
smolblok is a replacement for the current lib/urlfilter AdBlockPlus
and hostlist format filter parser. It is a library that uses plugins to
provide support for different filter formats.
staging/adblock: AdBlockPlus parser plugin
plugins/smolblok_hostlist: hostlist format parser plugin
Headers will be installed to include/smolbote/
Remove lib/urlfilter
Diffstat (limited to 'lib/urlfilter/urlfilter.h')
-rw-r--r-- | lib/urlfilter/urlfilter.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/urlfilter/urlfilter.h b/lib/urlfilter/urlfilter.h deleted file mode 100644 index e15122a..0000000 --- a/lib/urlfilter/urlfilter.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#include <QUrl> -#include <QString> -#include <utility> -#include <QWebEngineUrlRequestInfo> - -#ifndef SMOLBOTE_URLFILTER_FILTER -#define SMOLBOTE_URLFILTER_FILTER - -class UrlFilter -{ -public: - enum MatchResult { - NotMatched, - Allow, - Block, - Redirect - }; - - enum MatchType { - InvalidMatch, - RegularExpressionMatch, - StringContains, - StringStartsWith, - StringEndsWith, - StringEquals, - DomainMatch - }; - - virtual ~UrlFilter() = default; - - virtual QString metadata(const QString &key) const = 0; - virtual std::pair<MatchResult, QString> match(const QUrl &firstParty, const QUrl &requestUrl, QWebEngineUrlRequestInfo::ResourceType type) const = 0; -}; - -#endif // SMOLBOTE_URLFILTER_FILTER |