Hey! I struggled with this too. The key is loading the extension AND opening its background page.
Here’s a quick snippet:
```javascript
const extensionPath = '/path/to/extension';
const browser = await puppeteer.launch({
args: [`--disable-extensions-except=${extensionPath}`, `--load-extension=${extensionPath}`]
});
// Access the background page
const backgroundPage = await browser.backgroundPages()[0];
```
Without the background page, you can’t really puppeteer interact with extension properly. Hope this helps!
Here’s a quick snippet:
```javascript
const extensionPath = '/path/to/extension';
const browser = await puppeteer.launch({
args: [`--disable-extensions-except=${extensionPath}`, `--load-extension=${extensionPath}`]
});
// Access the background page
const backgroundPage = await browser.backgroundPages()[0];
```
Without the background page, you can’t really puppeteer interact with extension properly. Hope this helps!
