Set useragent in WKWebview

前端 未结 6 1975
野趣味
野趣味 2021-01-31 14:25

How do I set a custom useragent string in a WKWebView? I\'m trying to embed the version of my app so that my server-side can see what features are available. I found the followi

6条回答
  •  无人共我
    2021-01-31 15:04

    You'll be happy to hear that WKWebView just gained a customUserAgent property in iOS 9 and OSX 10.11

    Example:

    wkWebView.customUserAgent = "your agent" 
    

提交回复
热议问题