Saturday, January 25, 2014

Browser definition safari3plus not found : Blackberry redirection not working

One of the clients of the product that I work on had a problem where a redirection to an apps download page was not working on Blackberry 6.0 and Blackberry 7.0 OS  devices and was working fine for BB 5.0 OS. Strangely this was working fine until the client had installed some updates from Microsoft.

When digging in to the issue the root cause was that there is a custom browser definition for BB 6.0 and BB 7.0 browsers which had a different user agent string compared against BB 5.0 and this browser definition file was having a parent of  "safari3to4". However the machine had an extra browser definition for "safari3plus" under,

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers\safari.browser and
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\safari.browser

This was causing the custom browser definition not getting picked up as the parent ID of it was safari3to4.
The fix is (rather than removing safri3plus definition of the above mentioned files ) to rename the parent Id of the custom browser definition file under App_Browsers in the IIS deployed folder, this doesn't even require an IIS reset or an app pool  recycle.

Microsoft changes these browser definition files from time to time and  developers who use Request.Browser property to do re-directions should be aware of this fact.