Namespace RapidContext.Browser

Browser

Provides a browser compatibility and diagnostics information.

Field Summary
(static, constant)
List of all optional (or recommended) browser features.
(static, constant)
List of all required browser features.
Method Summary
(static)
Gets, sets or removes browser cookies.
(static)
Returns browser information version and platform information.
(static)
Checks if the browser supports all required APIs.
(static)
Checks for browser support for one or more specified APIs.

Members

(static, constant) OPTIONAL

List of all optional (or recommended) browser features. These are not used in built-in libraries and apps, but will be in the future.

Source:
RapidContext_Browser.js, line 136

(static, constant) REQUIRED

List of all required browser features.

Source:
RapidContext_Browser.js, line 21

Methods

(static) cookie(nameopt, valueopt) → {Object|string}

Gets, sets or removes browser cookies.

Parameters:
Name Type Attributes Description
name {string} <optional>
the cookie name to get/set
value {string} <optional>
the cookie value to set, or null to remove
Returns:
{Object|string} all cookie values or a single value
Source:
RapidContext_Browser.js, line 356

(static) info(userAgentopt) → {Object}

Returns browser information version and platform information.

Parameters:
Name Type Attributes Description
userAgent {string} <optional>
the agent string, or undefined for this browser
Returns:
{Object} a browser meta-data object
Source:
RapidContext_Browser.js, line 268

(static) isSupported() → {boolean}

Checks if the browser supports all required APIs.

Parameters:
Type Description
Returns:
{boolean} true if the browser is supported, or false otherwise
Source:
RapidContext_Browser.js, line 189

(static) supports(…feature) → {boolean}

Checks for browser support for one or more specified APIs. Supports checking JavaScript APIs, JavaScript syntax and CSS support.

Parameters:
Name Type Attributes Description
feature {string|Object|Array} <repeatable>
one or more features to check
Returns:
{boolean} true if supported, or false otherwise
Example:
RapidContext.Browser.supports("Array.isArray") ==> true;
RapidContext.Browser.supports({ test: "let a = 2; a === 2", name: "Let statements" }) ==> true;
RapidContext.Browser.supports("display: flex") ==> false;
Source:
RapidContext_Browser.js, line 214