> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/js/all/chrome_plugins.md).

# Chrome Plugins

* Chrome.runtime is available on any webpage
* Since Manifest V3, can't use any remote code including any CDNs or packages that load code remotely

To get file from built folder,

```js
chrome.runtime.getURL("../myfile.html"); //relative path
```

Catch errors

```js
chrome.runtime.lastError.message
```

## Keep constant Chrome-ID

Add key value to the manifest.json

1. Go to <https://chrome.google.com/webstore/developer/dashboard/> and click more Info to get the key
2. Add that key value to your manifest.json
