Home>

WebView on the app behaves differently in html pages
(For example, hide images you don't want on WebView)
When I want to do it, use something like UserAgent to see if it's an iOS browser or WebView on your app
Is there a way to judge?

I would appreciate your teaching.

  • Answer # 1

    There is an article like this that is a bit old.

    In the end, even if it is assumed that the UA has not been changed, I do not know exactly

  • Answer # 2

    Determination using UserAgent in JavaScript | cly7796.net

  • Answer # 3

    I think it's not impossible.

    [window.navigator.userAgent-Web API interface | MDN]
    https://developer.mozilla.org/en/docs/Web/API/NavigatorID/userAgent

    [Summary of how to check OS/browser etc. from UserAgent]
    https://qiita.com/nightyknite/items/b2590a69f2e0135756dc

    [Webview Based Browser User Agents]
    https://developers.whatismybrowser.com/useragents/explore/software_name/webview-based-browser/

  • Answer # 4

    I think it's possible for your app.

    Idea
    * Since it can be done with cordova/inappbrowser, it can also be done with native apps.

    Cass and javascript can be injected according to the webview load event.
    So what if you hide or control it?

Related articles