HttpBrowserCapabilities Parsing custom browser

If I have a custom .browser file and I want to evaluate what happens if given a specific User Agent, is there a way to do this via the .NET API?

I tried using HttpBrowserCapabilites, but I'm not sure how to load a custom .browser file into this class.

+1


a source to share


2 answers


Typically, you don't need to explicitly load the HttpBrowserCapabilities class; ASP.NET will download it for you if you have the .browser file in the right location (in App_Browsers).

However, testing will be another challenge. You cannot change the "User-Agent" HTTP header from the HttpApplication (global.asax) or custom HttpModule.



This leaves only awkward methods like using Reflection to force a value, or using an external tool (like Fiddler). Alternatively, if you are good with C / C ++, you can take a simple example for an ISAPI filter and modify it and then install it in IIS.

+1


a source


Install the User Agent Switcher Firefox extension. It will allow you to customize the user agent sent by the browser to the web server.



http://chrispederick.com/work/user-agent-switcher/

0


a source







All Articles