8

When we supply the user agent Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.80 Mobile/9A405 Safari/7534.48.3 to our .NET 4 webforms app, the script that defines the function __doPostBack is not present on the page and thus nothing that uses it works.

If we supply any other user agent string (say, Safari) it works fine. Can someone explain this?

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
lukiffer
  • 11,025
  • 8
  • 46
  • 70
  • 1
    This maybe the cause of the issue. http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx and here is the Hotfix is here http://support.microsoft.com/kb/2600088 – Eric LaForce Sep 08 '12 at 02:21
  • Yeah, after hours and hours we figured out that, that was the problem. The hotfix appears to be targeted at IE10 though. I'll post our .browser file below. – lukiffer Sep 08 '12 at 02:25

1 Answers1

16

So the problem is that the Chrome user agent isn't recognized by .net and so it assumes that it's dealing with a low-level browser.

To solve, we added ~/App_Browsers/CriOS.browser with the following contents:

<browsers>
    <browser id="CriOS" parentID="Safari">
        <identification>
            <userAgent match="CriOS" />
        </identification>

        <capabilities>
            <capability name="browser" value="CriOS" />
            <capability name="ecmascriptversion" value="3.0" />
            <capability name="javascript" value="true" />
            <capability name="javascriptversion" value="1.7" />
        </capabilities>
    </browser>
</browsers>
lukiffer
  • 11,025
  • 8
  • 46
  • 70
  • Nice solution! Worked perfect. My LinkButtons were not responsive in Chrome on iOS but now they are. – RyanG Sep 05 '13 at 15:43