Files
ua-parser-js/docs/v2/api/ua-parser-js/get-ua.md
2023-04-11 10:41:55 +07:00

362 B

getUA():string

Get user-agent string of current instance

Code Example

// Try to run this code on a browser
const parser = new UAParser();

// This will print the user-agent of current browser
console.log(parser.getUA());

// Replace the user-agent value
parser.setUA('Mozilla/5.0 MyBrowser/1.0');

parser.getUA();
// "Mozilla/5.0 MyBrowser/1.0"