Yo.utils.browser

Use this function to retrieve of the name and version of the current shopper's browser. This function parses the navigator.userAgent.

Prerequisites

The following command to load the appropriate version of the Rapid+JS Library must precede the use of this function on the page. Specify your own site key:

<script src="https://rapid-cdn.yottaa.com/rapid/lib/sitekey.js"></script>

Syntax

Yo.utils.browser();

Returns

An anonymous object (an object without a type) that contains the name and version of the browser for the current shopper, in this format:

{{name: string, version: *}|{name: *, version: *}|{name: string, version: string | string}}

Parameters

None

Example

The following example requests the shopper's browser information, and shows the object that would be returned for a shopper using Chrome 7.0:

/**
* Returns the following:
*{
*        browser: "chrome",
*        version:  '7.0'
*
}*/

Yo.utils.browser();