Does UIWebView send the same User-Agent in the Request Headers as mobile Safari?

后端 未结 2 1104

Sorry, I would just test this myself, but I\'m currently without my mac. Does a web request made inside of a UIWebView send the same user-agent info that a web request made

2条回答
  •  日久生厌
    2020-12-01 02:43

    Standalone mobile Safari user agent strings contain the word 'Version', whereas uiWebView user agent strings do not. So, the detection script can be modified to work with the latest version of iOS like so:

    var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)/i.test(navigator.userAgent);
    

提交回复
热议问题