OverrideUserAgent/AppendUserAgent preference does not work with cordova 6.5.0

573 views
Skip to first unread message

Dheeraj Waghmode

unread,
Feb 14, 2017, 3:05:05 PM2/14/17
to phonegap
I am setting user-agent through preference tag in config.xml file for android platform
<preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" >
<preference name="AppendUserAgent" value="My Browser" >
When running the app using ionic serve command I do not see the above mentioned user-agent value in the request headers (Dev tools -> Network tab ->Request headers). user-agent has value like "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"

Is there any another way that we can set user-agent value?
How can I set user-agent value by writing cordova plugin. sample code would really help.
I have referred (https://github.com/LouisT/cordova-useragent) but this does not work.

I greatly appropriate  for any help regarding this.

Am I missing anything?

jcesarmobile

unread,
Feb 16, 2017, 6:08:21 PM2/16/17
to phonegap
Those preferences only work when you run the app in your device, when you run ionic serve, I don't think you really install your app in your device
Reply all
Reply to author
Forward
0 new messages