How can I use Puppeteer to interact with a browser extension? Tips and examples needed!

8 Replies, 1502 Views

Hey! I feel your pain, puppeteer interact with extension can be a real headache. I’ve been there! One thing that worked for me was using the `--load-extension` flag when launching Puppeteer. You can load your custom extension by specifying its path.

For interacting with the extension popup, you’ll need to open it manually using `page.goto('chrome-extension://<extension-id>/popup.html')`. It’s a bit hacky, but it works.

Also, check out this GitHub repo: [Puppeteer-Extension-Testing](https://github.com/example/puppeteer-extension-testing). It has some solid examples for testing extensions. Hope this helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)