> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guide/javascript/get-extension-id.md).

# Get extension id

Get extension id is an action that instructs the browser to extract the unique identifier (Extension ID) of the extensions installed within the current browser Profile. This ID is extremely important for you to use in subsequent commands, such as directly navigating to the configuration page or wallet of that extension (for example: quickly opening MetaMask, Tonkeeper, OKX Wallet...).

🎥 Watch the tutorial video: [Here](https://youtu.be/I4-kZ7repv8).

#### Configuration parameters:

* Extension name: The name of the extension displayed in the browser from which you want to get the ID.
  * *Note*: The system applies a relative search mechanism, you do not need to enter the entire name accurately but just include a distinctive phrase (For example: just enter `MetaMask` or `OKX` instead of typing the full lengthy name).
* Output variable: The variable name to store the ID string after extraction (For example: store it in the variable `extId`).

#### ⚠️ Mandatory operational note for successful ID retrieval:

Due to the security mechanism and internal data flow management of the Chromium browser engine, if you are on a regular website and call this command immediately, the system will not be able to scan the list of extensions. To ensure this action works 100% accurately, you need to follow the procedure below:

* It is mandatory to access the management page first: Your script must use the Go to URL action to access the internal address of the browser `chrome://extensions/` first.
* A delay is mandatory: After redirecting to the extensions management page, you must insert a short Delay command (about 1 - 2 seconds). This delay allows the browser's management interface to fully load the source code structure of the extensions, avoiding running too quickly which may cause the script to fail to capture the ID.

#### Practical example: Workflow to get the extension ID to automatically open the wallet

When you create an automation script for Crypto/Airdrop tasks, you want to get the ID of the MetaMask wallet to quickly access the wallet unlock page:

* Step 1: Use the Go to URL action ➔ Enter the URL: `chrome://extensions/`.
* Step 2: Drag the Delay action ➔ Enter the wait time: `2000` (equivalent to 2 seconds).
* Step 3: Drag the Get extension id action:
  * *Extension name*: `MetaMask` (just needs to contain this keyword).
  * *Output variable*: `metaMaskId`.
* Step 4: After obtaining the ID stored in the variable `$metaMaskId`, you can use the next Go to URL action with the structure: `chrome-extension://$metaMaskId/home.html` to immediately bring up the wallet interface for processing without needing to manually click search on the toolbar.

<figure><img src="/files/QeHbm7xOcHff4rORm1x1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SClXNy7CAqVNgHXO4THH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ayT0DQqPj6ZAS4Aw2oB9" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.gpmautomate.com/automate-en/action-guide/javascript/get-extension-id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
