# APIs and Page Actions

BlueFletch Browser contains built-in APIs or Actions that can be used directly from your website code.

## Android Namespace

The following commands are declared under the `window.android` namespace and can be used as follows:

<table><thead><tr><th width="317">Function</th><th>Description</th></tr></thead><tbody><tr><td><code>android.showToast(message)</code></td><td>Instruct browser to show an Android toast message.</td></tr><tr><td><code>android.redirect(url)</code></td><td>Instruct browser to redirect to the specified URL.</td></tr><tr><td><code>android.goBack()</code></td><td>Instruct browser to go back one page</td></tr><tr><td><code>android.quit()</code></td><td>Instruct browser to close the current browser instance</td></tr></tbody></table>

## EMS Namespace

The following commands/actions are declared under the `window.ems` namespace and can be used as follows:

<table><thead><tr><th width="369">Function</th><th>Description</th></tr></thead><tbody><tr><td><code>ems.getCurrentSession()</code></td><td>returns a JSON object containing the current Launcher session.</td></tr><tr><td><code>ems.getCurrentConfig()</code></td><td>returns a JSON object containing the current Launcher configuration</td></tr><tr><td><code>ems.showKeyboard()</code></td><td>Instruct browser to bring up the soft keyboard</td></tr><tr><td><code>ems.hideKeyboard()</code></td><td>Instruct browser to hide the soft keyboard</td></tr><tr><td><code>ems.sendIntent(intentObject)</code></td><td>Instruct browser to send an Android Intent.  The structure of the <code>intentObject</code> is based on the <a href="/pages/KSBb8WYVcJqVZr4wJMtf">Custom Intent</a> object in Launcher.</td></tr><tr><td><code>ems.setStorageItem(key, value)</code></td><td>Instruct browser to keep set a key-value string pair in memory</td></tr><tr><td><code>ems.getStorageItem(key)</code></td><td>Retrieve the value for a given key from memory that was set using <code>setStorageItem</code></td></tr><tr><td><code>ems.clearStorage()</code></td><td>Clear all key-value pairs stored in memory from <code>setStorageItem</code></td></tr><tr><td><code>ems.enterFullscreen</code></td><td>Instructs browser to enter into a fullscreen mode.</td></tr><tr><td><code>ems.exitFullscreen</code></td><td>Instructs browser to exit the fullscreen mode.</td></tr><tr><td><code>ems.Messaging.subscribe(topic)</code></td><td>Instructs browser to request the EMS Messaging application to subscribe to messages for the supplied topic. Introduced in Browser 2.3.14. Depends on the Messaging application.</td></tr><tr><td><code>ems.Messaging.unsubscribe(topic)</code></td><td>Instructs browser to request the EMS Messaging application to unsubscribe from messages for the supplied topic. Introduced in Browser 2.3.14. Depends on the Messaging application.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/browser/technical-guide/apis-and-page-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
