WebView useragent


#1

I am making an app, and I need to know how to switch the useragent in the WebView. Although I have no idea how to do this.

If you are wondering why I need this it is because I need to display the desktop version of a site on my App.


Useragent switching spped
#2

Try this extension by @Sivagiri_Visakan and @ILoveThunkable:


#3

Thanks, I will try this out!


#4

I tried it out and at first an error was popping up, then I made the error go away by adding some code. When it was not saying an error the WebView was blank. Any way to fix this??


#5

GetUserAgent, returns current user agent, but it only works after using SetUserAgent. In case you want to use OAuth (or pretty much just delete ; wv) use EnableOAuth function.


#6

I made a script to test the enable OAuth and the page never loaded. So I made a script that got the current useragent and just deleted ; wv. The useragent changed, but pages never loaded. So is this just a problem with my phone?


#7

Please give your .aia file.


#9

I recently have been making an app were it switches the useragent of a WebView to a desktop one. Although when I use the ExtendedWebview Extension to do this it, but the site does not even load at all. I added a loader to watch it’s load speed although the loader hits 100% immediately and then the screen is blank. What is wrong with this? Why doesn’t it work? The loader works, I tested it out without the useragent switching. There are no errors reported.


#10

If you use UserAgent like “My Browser”, sometimes website even won’t load, because, you need to provide important things, like your WebKit version & etc.
Mozilla/5.0 (Device; Platform Version) AppleWebKit/WebKit Version (KHTML, like Gecko)


#11

webview.aia (9.5 KB)
That is a simple thing I whipped up to show how it does not load.


WebView useragent
#12

I tried this just to make sure:


It still does not work :frowning:


#13

Hi @Csf30816 ,

I checked your aia file. You don’t load your website after setting the UserAgent .

Try using these blocks :

(I have used the URL the same as the Home URL in the aia file )

Let us know if this works .


How To Make Google Login From Web viewer
#14

Thanks so much! That worked!!!


#15

Hello,

I’m a happy user of Thunkable
I want to use the webviewer to display a html5 page with a youtube video
Example : http://www.dockydoc.com/tv/tv/index_bgYTL4.html

With a desktop browser (Chrome, …) the video starts imediately
But with a mobile browser, it doesn t start unless you press a button

Is there a way to change the UserAgent to make it start imediately as in a desktop browser ?

Thanks for your help !

Olivier
Lille (FRANCE)


#16

I do not think that would help. I am pretty sure (not 100%) that on the WebView the HTML auto-play function is disabled, and you can not enable it through a UserAgent. Currently through any extensions there is no way to enable auto-play, sorry.

Best Regards,
Elijah


#17

You can also take a look into my and @Sivagiri_Visakan extended web viewer extension