# Filter Manager

The Filter Manager (menu item `Tools > Filter Manager`) allows to block certain elements of a web site, like ads or tracking code.

The filters are managed in collections of filters, each collection is supposed to contain filters which belong together. The collections can be enabled or disabled as unit, and also exported and imported, which makes it possible to share the file collections with other users.

## 3rd party filters

iCab supports popular filters lists from AdBlock Plus, uBlock, Easylist and compatible. You can download these filter lists and import them using the "import" feature to use them in iCab.

The filter manager window even has a few buttons which open web sites where you can find filter lists for this popular third-party filters. Most of these sites include special links (usually named "Add" or "Subscribe", the URL scheme of these links is "abp:" instead of "https:") which when clicked will directly offer to import these lists in iCab. If these special links are missing, you can manually download the filter list and then import the filter file using the "import" feature.

## Activate/deactivate filters

Filters can be activated/deactivated globally using the menu item `View > Enable Filters`. Alternatively you can also use the "filter" icon in the browser toolbar to enable or disable the filters feature itself (configure the toolbar to add this icon if it is missing).

In the filter manager window you can also activate or deactivate individual collections, (and even within the collections you can activate/deactivate individual filters). This way you can enable certain collections of filters only when needed for a certain use case.

In case you suspect that a filter is affecting a web site so that the site isn't working correctly anymore, it is a good idea to temporarily disable the filters globally (via menu or toolbar icon) and reload the page without filters. If it works then, it's probably a filter which is causing the issues.

## Creating a new filter

To create a new filter, select a collection in the left column first (using the `+` button below the collection list you can create new collections). The list at the right will now show the existing filters of the selected collection. Click the `+` button below the filters list to create a new filter and opens a window where you can configure all paramaters for the filter. Double-clicking an existing filter will also open the window to edit the paramaters of the filter.

The following paramaters can be used to define a filter:

Filter
  Here you need to enter the URL of the resource which should be targeted by the filter. In order to target multiple resources and not only one, you can use certain wildcard characters (a subset of "regular expressions"). Without wildcard characters, the filter must equal the URL of a specific resource, using wildcard characters you can generalize the filter to match all resources of a domain, path or even all resources of the whole web. You can also decide if upper and lowercase characters should be treated differently.
Action
  This option defines what the filter should do
  - The option "Block Resource" will prevent that the resources matching the filter (from above) will be loaded.
  - The option "Block Cookies" will block cookies which the resources matching the filter try to set.
  - The option "Ignore previous" will have the effect that all matching filters which are located in the collection before this filter are ignored. This can be useful if these other filters would block certain resources, but there are exceptions where this should not happen.
  - The option "Hide page elements" doesn't block whole resources, but instead only elements within a web site which can be targeted using a CSS selector. When using this action you also need to define the CSS selector for the element which should be hidden.
Resources
  This option allows to limit the filter to 1st party or to 3rd party resources. 1st party resources means that these resources are from the same domain than the main document, 3rd party resources are coming from other domains. If all resources should be targeted by the filer, use the option "all".
File type
  These options can be used to specify certain file types which the filter should block.
Domain Exceptions
  This option can be used to specify the domains from where the resources or the main document must come form or must not come form, in order to be blocked.

## Export & Import

In order to share filters with other users, you can export filter collections into a file. And you can also import filters again.

To export, first select all the filters you want to export, and finally click the "Export" button. This will save the selected collections into a file.

To import filters, click the "Import" button and then pick the file you want to import. The imported collections will then be listed in the collections list as well.