> For the complete documentation index, see [llms.txt](https://docs.bluefletch.com/bluefletch-enterprise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bluefletch.com/bluefletch-enterprise/product-guides/browser/technical-guide/apis-and-page-actions.md). Agents can also search and read this documentation through its [MCP server](https://docs.bluefletch.com/bluefletch-enterprise/~gitbook/mcp).

# 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="https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/launcher3/custom-intents.md">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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
