I'm working on a Chrome extension where I need to use Puppeteer for web scraping and automation tasks. I understand that Puppeteer is typically used in a Node.js environment, but I want to run it within the background.js or content_script of my Chrome extension.
I came across this Stack Overflow question, but the accepted answer only discusses how to integrate Puppeteer into the popup.html of the extension. Unfortunately, that solution doesn't meet my requirements.
Is it possible to use Puppeteer directly in the background.js or content_script files of a Chrome extension? If so, what are the necessary steps or modifications I need to make? I would greatly appreciate any guidance or alternative solutions for achieving this.
Thank you in advance for your help!