F FrankDev Active Member Licensed User Longtime User Oct 25, 2017 #1 Hi I have a problem with webview. Want to switch to desktop view. I tried' webViewSetting. setUserAgentString (WebViewInfo,"Desktop")' but it doesn't work. The web pages are still displayed in mobile mode. If I try Chrome (for android) then it works fine. what else could you try? regards Frank
Hi I have a problem with webview. Want to switch to desktop view. I tried' webViewSetting. setUserAgentString (WebViewInfo,"Desktop")' but it doesn't work. The web pages are still displayed in mobile mode. If I try Chrome (for android) then it works fine. what else could you try? regards Frank
Erel B4X founder Staff member Licensed User Longtime User Oct 26, 2017 #2 Example of a desktop user agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Upvote 0
Example of a desktop user agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
F FrankDev Active Member Licensed User Longtime User Oct 26, 2017 #3 Hi, Erel, after I knew that you need the' UserAgent' to switch, I tried several strings of course. However, only the mobile websites are still displayed. Maybe I have set something else wrong or used the wrong switch? regards Frank Upvote 0
Hi, Erel, after I knew that you need the' UserAgent' to switch, I tried several strings of course. However, only the mobile websites are still displayed. Maybe I have set something else wrong or used the wrong switch? regards Frank
Erel B4X founder Staff member Licensed User Longtime User Oct 26, 2017 #4 Are you sure that it is not a site with a responsive design (most are)? Such sites do not use the user agent to distinguish between the different layouts. Try this: Code: Copy Dim jo As JavaObject = WebView1 Dim settings As JavaObject = jo.RunMethod("getSettings", Null) settings.RunMethod("setUseWideViewPort", Array(True)) settings.RunMethod("setLoadWithOverviewMode", Array(True)) Upvote 0
Are you sure that it is not a site with a responsive design (most are)? Such sites do not use the user agent to distinguish between the different layouts. Try this: Code: Copy Dim jo As JavaObject = WebView1 Dim settings As JavaObject = jo.RunMethod("getSettings", Null) settings.RunMethod("setUseWideViewPort", Array(True)) settings.RunMethod("setLoadWithOverviewMode", Array(True))
F FrankDev Active Member Licensed User Longtime User Oct 27, 2017 #5 Hi Erel, almost good.. worked with webViewSetting.setLoadWithOverviewMode(WebViewInfo,True) webViewSetting.setUseWideViewPort(WebViewInfo,True) at least on some pages. but I still have a few pages that use chrome (android) to switch to standard view... still not yet in the webview. for example. www.sgbbm.de Attachments ok.jpg 203.6 KB · Views: 766 wrong.jpg 149.9 KB · Views: 814 Upvote 0
Hi Erel, almost good.. worked with webViewSetting.setLoadWithOverviewMode(WebViewInfo,True) webViewSetting.setUseWideViewPort(WebViewInfo,True) at least on some pages. but I still have a few pages that use chrome (android) to switch to standard view... still not yet in the webview. for example. www.sgbbm.de