Setting a custom userAgent in HTML or JavaScript

This is working for me. Object.defineProperty(navigator, ‘userAgent’, { get: function () { return ‘Mozilla/5.0 (Windows NT 6.2; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0)’; } }); It is an updated version of code4coffee’s answer as Object.prototype.__defineGetter__() is deprecated: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__

Associate a custom user agent to a specific Google Chrome page/tab

The webRequest API can be used to modify the User Agent header. Note: The Network tab at the Developer tools show the old headers. I’ve verified that the headers are set correctly, using netcat (nc -l 127.0.0.1 -p 6789). In the example below, the code activates on all tabs. Adjust the request filter to meet … Read more

How i can set User Agent in Cordova App

It depends on which version of cordova-android and cordova-ios you are using. You can check the platform cordova versions by running cordova platform list If you are using 4.0 and above versions for both iOS and Android you can set them in config.xml as stated in cordova documentation here <preference name=”OverrideUserAgent” value=”Mozilla/5.0 My Browser” /> … Read more