cabrillo - Client

Cabrillo JS is a client side JavaScript API for accessing capabilities inside ServiceNow native mobile applications.

Use Cabrillo JS to build a custom mobile experience in ServiceNow native mobile applications. Cabrillo JS provides APIs to use native device capabilities, native mobile UI, and other ServiceNow mobile functionality.

Cabrillo JS is available in AngularJS as an injectable parameter. For example, you can inject Cabrillo JS in a Service Portal widget client script.
function(cabrillo) {
    var c = this;

    // Used to determine if Cabrillo is executing in ServiceNow's native mobile apps.
    c.isNative = cabrillo.isNative();

Cabrillo JS APIs are only supported when executing in ServiceNow native mobile applications. Use the cabrillo.isNative() API to determine if the script is executing in a native context.

Note: Cabrillo JS APIs are unavailable in GlideForm client scripts.

cabrillo - isNative()

Boolean value indicating if Cabrillo JS is executing a ServiceNow native mobile application.

Table 1. Parameters
Name Type Description
Table 2. Returns
Type Description
Boolean Returns true if Cabrillo JS is running in a native context; otherwise, false.
var isNative = cabrillo.isNative();