I have developed a Chrome extension that scrapes some pages that are visited. Now I would like to run this extension on a remote server using Puppeteer and simulate the opening of web pages. From the documentation I found:
- To use a puppeteer extension it must be headless: false
- Chrome extensions do not support content scripts
Do you have any suggestions on how to do it? I have tried this I can see the extension button correctly showing in the navbar of puppeteer launched browser but the content scripts JS is not executed and nothing it's printing in the console. Moreover, using headless: false creates problems on the server, how can I run the extension in headless: true mode?
Said in other words, how can I run an automated test of a Chrome extension that use content scripts?
options = {
headless: false,
devtools: true,
args: [
`--disable-extensions-except=../extension/`,
`--load-extension=../extension/`
]
}