# Filter Manager

With the help of the Filter Manager of iCab (in the Tools menu), you can configure iCab so that it will use special preferences for different web sites. For example even if Javascript is enabled in general in the preferences dialog, you can tell iCab that for a certain web site "A" JavaScript must be disabled and for another web site "B" iCab should ignore the general cookies settings of the preferences dialog and use some different cookies settings instead.

The Filter Manager can also be used to filter certain page elements on certain web pages or even on all web pages, like filtering out advertising banners.

## How does the Filter Manager work

The settings in the preferences dialog will be used for all web sites. Many of the settings from the preferences dialog are also found in the Filter Manager. In the Filter Manager all of these settings are bound to an URL, which means that whenever you visit a web page with these URLs, iCab will use the settings from the Filter Manager instead of the ones from the preferences dialog. This way you can define different settings for different web sites. In the Filter Manager all settings are grouped into different categories (like Page Layout, Multimedia, JavaScript, Network etc.) and each of the categories can be enabled separately, which makes it more easy to define only the necessary settings and using the default settings from the preferences dialog for all other settings. iCab looks for a matching filter for the web page starting with the top most filter collection, if it finds one it will be used, otherwise if will check the next filter collection. If none of the collections have any matching filters, the global preferences are used. So the order of the filter collections can be important if more than one filter will match a certain web site. So move the more important filters to the top, but also move the more general filters to the bottom (like the advertising filter which addresses all web pages).

## Creating Filter Collections

All filters are part of a filter collection. A collection can have any number of URLs for which special settings are defined. This is useful if a certain filter for a certain task must be valid for more than one URL (because a web site uses more than one domain names (like apple.de, apple.com etc.), or can be addressed by more than one domain name). It is suggested that you create one filter collection for each task. Each web page which needs special settings will be treated as one task, but also a filter like the advertising filter which addresses all web pages is treated as a task.

To create a filter collection, just click the + icon below the filter collection list. You can name the collection and enter an optional description.

## Export & Import

Collections can be exported and saved into a file, and of course such files can be imported again. This makes it easy for users to share filter collections. iCab comes with some example filter collections, like an advertising filter and a YouTube Video Download filter, which must be only imported in iCab to use them. So even non-experiences users can benefit from the Filter Manager. On the iCab web page you'll may find some other filter collections for the Filter Manager.

To export a filter collection, first select the collection and then click the Export button to save the filter collection into a file.

To import a filter collection, either click the Import button and then select the filter file in the file selection box, or double-click the filter file in the Finder, which will open the file in iCab automatically and iCab will import the file as well.

## Creating filter URLs

Each filter collection can have any number of URLs of web pages. And each of these URLs can have its own preferences. To create a new URL, you have to first select the filter collection in the table on the top left of the Filter Manager window for which iCab should create the new URL. Then click the + button below the URL table. When entering the URL you can use the wildcard characters "*" and "?" to make the URL valid for more than one single web page. The wildcard character "*" stands for any number of characters (zero or more characters). For example "http://www.icab.de/" would only address one single web page (the start page of the iCab web site) and no other web page, but "http://www.icab.de/*" would address the whole iCab web site including all subpages like "http://www.icab.de/info.html" etc. The wildcard character "?" stands for a single character. Using wildcard characters you can easily make a filter valid for a larger number of web pages without the need to add a separate URL for each of these pages.

## Defining special filter settings

To define the settings for a certain URL of a filter collection, you have to first select the collection (table at the top left), then select the URL (table at the bottom left) which will then activate the settings panels at the right side of the window. The settings are grouped in different categories, each category is represented by a different Tab. Selecting a Tab will display the settings of this category. At the top of each category there's a checkbox where you can tell iCab if it should use the default preferences (the ones from the preferences dialog), which means that this category is disabled for this filter and the filter settings of this category are ignored. Or when you uncheck the "default preferences" checkbox, the settings for this category will be activated and now you can change the settings for the filter.

There are the following categories available:

Page Layout
  Theses settings affect the page layout and appearance of the web site. It's possible to define special settings for the colors, fonts, font sizes and Style Sheets that are used by the web page. You can select one of the user-defined Style Sheets which are configured in the Style Sheet settings of the preferences dialog. But you can also directly enter some CSS code to manipulate the page layout. The latter is useful when you plan to export the filter configuration and share it with other users. Though selecting user-defined Style Sheet could be used for the same result, the user-defined Style Sheet is not part of the exported filter, while the additional CSS code that is entered in the filter manager is part of the filter and therefore doesn't get lost when exporting the filter collection.
Multimedia
  In this category you can configure if images, Plugins, Java Applets etc. should be loaded and displayed.
JavaScript
  In this category you can configure all the JavaScript settings for the filter. It's also possible to define some user-defined JavaScript code which will be executed when the web page is loaded. This is a very powerful feature that gives you absolute control over the web page structure and code, but it requires some knowledge about HTML, JavaScript and other Web Standards. After selecting a file with user-defined JavaScript code, the code is included directly in the filter, so the original file is no longer needed. If you change the original file, you have to select it again so that the updated file is again added to the filter, replacing the old one.
Network
  In the Network category you can configure the Cookie settings, the HTTP Referrer and the browser identity setting.
Resources
  In this category you can individually filter the resources (images, movies, audio files, but also JavaScript code and Style Sheet files etc.) which are embedded in the main page that is addressed by the filter. You can filter these embedded files by URL, but also by dimension (for resources which do have a dimension like images and movies). When filtering by URL you can use the wildcard characters "*" and "?" (see above) to address more than only one file with the same URL. Also you can explicitly tell iCab to load the resource (which is useful if you want to load the resource which would be otherwise not loaded because of other filters or the global preferences) or to don't load the resource (to filter it out). The dimension filters will filter out all the resources which do have the given width and height. For example many advertising banners do have a size of 168x80, so when defining a filter for 168x80 all banners of this size will be filtered out.

  ## Deactivating Filters

  You can switch off the Filter Manager itself (using the menu item "View > Enable Filter Manager" or directly in the Filter Manager window). But you can also deactivate certain Filter collections only or only certain URLs of a collection by removing the checkbox next to the filter collection or the URL. In this case this collection or the URL is ignored when searching for matching filters.