From ae2a713f26fd58f397aaf93242f24c85dee98a2b Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 3 Oct 2018 16:48:26 +0200 Subject: Convert documentation into asciidoc from markdown --- doc/UrlFilter.md | 95 -------------------------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 doc/UrlFilter.md (limited to 'doc/UrlFilter.md') diff --git a/doc/UrlFilter.md b/doc/UrlFilter.md deleted file mode 100644 index b521228..0000000 --- a/doc/UrlFilter.md +++ /dev/null @@ -1,95 +0,0 @@ -## FilterDomain -Filter Domains are groups of domains that can point to one or more filter -rules. - -### Types -There are 4 Filter Domain types: -- AllowOnDomains - only match specified domains -- BlockOnDomains - match all but specified domains -- AllowOnAllDomains - match all domains -- BlockOnAllDomains - match no domains - -### JSON - { - "type" : "AllowOnDomains", - "domains" : [ "example.com", "test.example.com" ], - "rules" : [] - } - -## FilterRule -Filter rules contain information on how a request should be modified. - -### Action -- Whitelist - allow this request -- Blacklist - block this request -- Redirect - redirect this request -- SetHeader - apply a list of headers - -### Match Type -- "regexp" -- "contains" -- "endswith" -- if none is specified, all URLs are matched - -### JSON -Allow all URLs that contain "waifu.png" - { - "action" : "Whitelist" - "contains" : "waifu.png" - } - -Block specific URL - { - "action" : "Blacklist" - "equals" : "example.com/annoying-ad/masquerade/waifu.png" - } - -Block all URLs that contain "banner.gif" - { - "action" : "Blacklist", - "contains" : "banner.gif" - } - -Redirect URLs containing "ads/annoying-spam.gif" to "waifu.tld/waifu.gif" - { - "action" : "Redirect" - "contains" : "ads/annoying-spam.gif" - "url" : "waifu.tld/waifu.gif" - } - -Set some headers - { - "action" : "SetHeader" - "headers" : [ "DNT:1" ] - } - -## QWebEngineUrlRequestInterceptor - -All network requests pass through the request interceptor. It gives the -following information: - -- firstPartyUrl - the page on which the request is made -- requestUrl - the url of the request -- requestMethod -- resourceType -- navigationType - -And provides the following methods: - -- block (bool shouldBlock) - can block the request -- redirect (const QUrl) - can redirect the requestUrl -- setHttpHeader - can set HTTP headers (such as user agent and do not track) - -### Example -This is a sample request made when loading DuckDuckGo: - - firstPartyUrl=https://duckduckgo.com/ - requestUrl=https://duckduckgo.com/o1635.css - -## How the filter works -When a requst comes in, the interceptor extracts the host of the request and -matches it against the list of FilterDomains. - - firstPartyHost=duckduckgo.com - requestHost=duckduckgo.com - -- cgit v1.2.1