2025-04-15 11:31:12 +08:00
import StartExperience from './common/start-experience.mdx';
2025-04-21 20:51:17 +08:00
import PrepareKeyForFurtherUse from './common/prepare-key-for-further-use.mdx';
2025-04-15 11:31:12 +08:00
2024-12-19 15:49:06 +08:00
# Quick Experience by Chrome Extension
2024-11-11 11:19:25 +08:00
Midscene.js provides a Chrome extension. By using it, you can quickly experience the main features of Midscene on any webpage, without needing to set up a code project.
2025-04-15 11:31:12 +08:00
The extension shares the same code as the npm `@midscene/web` packages, so you can think of it as a playground or a way to debug with Midscene.
2024-11-11 11:19:25 +08:00
2024-11-11 16:29:45 +08:00

2024-11-11 11:19:25 +08:00
## Preparation
2025-04-21 20:51:17 +08:00
<PrepareKeyForFurtherUse />
2024-11-11 11:19:25 +08:00
## Install and config
Install Midscene extension from chrome web store: [Midscene](https://chromewebstore.google.com/detail/midscene/gbldofcpkknbggpkmbdaefngejllnief)
2025-01-15 10:14:36 +08:00
Start the extension (may be folded by Chrome extension icon), setup the config by pasting the config in the K=V format:
2024-11-11 11:19:25 +08:00
2025-04-15 11:31:12 +08:00
```bash
2024-11-11 11:19:25 +08:00
OPENAI_API_KEY="sk-replace-by-your-own"
2025-02-21 16:15:51 +08:00
# ...all other configs here (if any)
2024-11-11 11:19:25 +08:00
```
2025-04-15 11:31:12 +08:00
<StartExperience />
2024-11-11 11:19:25 +08:00
2025-01-15 10:14:36 +08:00
* [Bridge Mode by Chrome Extension](./bridge-mode-by-chrome-extension)
2024-11-11 11:19:25 +08:00
* [Integrate with Puppeteer](./integrate-with-puppeteer)
* [Integrate with Playwright](./integrate-with-playwright)
2024-11-14 19:29:22 +08:00
## FAQ
2025-02-26 14:20:27 +08:00
### Extension fails to run and shows 'Cannot access a chrome-extension:// URL of different extension'
2024-11-14 19:29:22 +08:00
2024-12-26 10:19:16 +08:00
It's mainly due to conflicts with other extensions injecting `<iframe />` or `<script />` into the page. Try disabling the suspicious plugins and refresh.
To find the suspicious plugins:
1. Open the Devtools of the page, find the `<script>` or `<iframe>` with a url like `chrome-extension://{ID-of-the-suspicious-plugin}/...`.
2025-01-17 18:19:22 +08:00
2. Copy the ID from the url, open `chrome://extensions/` , use cmd+f to find the plugin with the same ID, disable it.
2024-12-26 10:19:16 +08:00
3. Refresh the page, try again.