JavaScript Documentation / app

This object contains methods for interacting with the app.

app.openURL(url)

Opens a URL, returns true if the URL was successfully opened; otherwise false. This method is not supported in extension.

Parameters

  • url required The URL to be opened.

Example

app.openURL('http://apple.com'); //open apple.com in Safari

app.inDarkMode()

Returns a boolean indicating whether the app is in dark mode.

app.toggleDarkMode()

Toggles dark mode.

app.inExtension()

Returns a boolean indicating whether the action is executing in extension.

app.getClipboard()

Returns the Clipboard contents.

app.setClipboard(text)

Replaces the contents of the Clipboard with text.

Parameters

  • text required The text to place on the Clipboard.