Understanding filters

 

Filters provide a powerful way for you to override the default property settings for a specific browser in the event that certain information appears in a browser's user agent, cookie, or server environment variable. Some browsers, such as Internet Explorer, report hundreds of different user agent strings for the same browser – depending on various factors such as the operating system or whether the browser is being used through a proxy server.

 

For example, consider the following two user agents, both given by the same version of Microsoft Internet Explorer:

Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)

Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)

 

In this scenario both user agents are for the same exact browser, and therefore there is only one definition in the BDF for Internet Explorer 4.0x. But then how do we set the Platform property to "Windows 98" or "Windows NT" accordingly, since there is only one definition for this browser? Older browser detection technologies required you to have separate browser definitions for each specific user agent string, resulting in thousands of browser definitions to cover all the combinations. But not with BrowserHawk!

 

By using filters, BrowserHawk allows you to override default property settings based on keywords in the user agent, cookies, or environment variable. In this case, we set Platform equal to "Unknown", and then use filters to override that value with "Windows 98" or "Windows NT" accordingly.

 

By using filters you can have just one browser definition for each actual browser, instead of having to create a browser definition for each user agent which it may report. This is one reason why under BrowserHawk there are about 100 browser definitions, as compared to older technology such as browscap.ini where there are over 3,200 definitions – and despite its smaller, more compact nature, BrowserHawk still recognizes several thousand more user agents than any browscap.ini.

 

See Also:

Working with filters

Filter example

The Filters Window Pane

Understanding browsers

Understanding folders

Understanding properties