gree / unity-webview

zlib License
2.31k stars 695 forks source link

userAgent On iPad #961

Open shimeikou-MediaDo opened 1 year ago

shimeikou-MediaDo commented 1 year ago

When using iPad Air 4 with iPadOS 16.5.1, the UserAgent is displayed as 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)'.

On the other hand, when using iPad Mini 4 with iPadOS 16.7.8, the UserAgent is displayed as 'Mozilla/5.0 (iPad; CPU OS 15_7_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'.

Do you understand the reason for this? If possible, could you please provide some insight into it?

KojiNakamaru commented 1 year ago

Depending on device types, the user agent of iPad may change:

https://developer.apple.com/documentation/webkit/wkcontentmode

You can forcibly load mobile/desktop content by specifying the wkContentMode argument of webViewObject.Init():

https://github.com/gree/unity-webview/blob/7d3eb1a7cf5549a8f63cd7a8fa0ef67879e279ba/sample/Assets/Scripts/SampleWebView.cs#L123

shimeikou-MediaDo commented 1 year ago

Thank you for your instruction, I appreciate it.