Detect WebView

enginet

Member
Licensed User
Longtime User
Hi,
I was wondering if there's some trick to make my web-app detecting when it's running into a webview control.

If i was able to do that i could, for example, dinamically disable the web app menu and use an integrate android menu into the webview for example.

Actually i look for the word "Android" into the browser header informations, but it's detected even when i use a common browser like Chrome or Firefox.

Any hint?
Greetings,
Daniele
 

warwound

Expert
Licensed User
Longtime User
You could use WebViewSettings and it setUserAgent method in your b4a app that uses a WebView to load your web app.

Choose a unique user-agent and you should (i think) be able to detect the user agent server side (not sure about client side).

Do you need to detect whether the web app is loaded in a browser or in your b4a app server side or client side?

Martin.
 
Upvote 0
Top