Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserAgent #21

Open
tsapap opened this issue Mar 10, 2020 · 2 comments
Open

UserAgent #21

tsapap opened this issue Mar 10, 2020 · 2 comments

Comments

@tsapap
Copy link

tsapap commented Mar 10, 2020

Hello,
is there a way to assign a userAgent to iOSHTMLViewer to simulate the desktop browser?
I tried to assign it with a javascript and it works
but unfortunately when you run a new javascript in the browser I lose the userAgent assigned.
do you have any solution?

Thanks
Stefano

@jkleroy
Copy link
Collaborator

jkleroy commented Mar 10, 2020

According to this answer on Stackoverflow https://stackoverflow.com/a/27330998
You should be able to set the user agent throughout the whole app by placing this code in the App.Open event

Dim keys() As Foundation.NSObject
keys.Append new Foundation.NSString("UserAgent")
Dim values() As Foundation.NSObject
values.Append new Foundation.NSString("Mozilla/5.0") //Change this
Dim nsDic As new Foundation.NSDictionary(keys, values)
Foundation.NSUserDefaults.StandardUserDefaults.RegisterDefaults(nsDic)

@tsapap
Copy link
Author

tsapap commented Apr 1, 2020

it works thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants