getBrowser (XSPUserAgent - JavaScript)

Gets the common name of the browser.

Syntax

getBrowser() : string
Return value Description
string Firefox, IE, Opera, Safari, or an empty string.

Usage

If the return value is an empty string, you must analyze XSPUserAgent (JavaScript).

Examples

This computed field displays the browser and version, or the complete user agent string if the browser is not identified:
var browser = context.getUserAgent().getBrowser();
if(!browser.isEmpty()) {
	return browser + " " + context.getUserAgent().getBrowserVersion();
} else {
	return context.getUserAgent().getUserAgent();
}