Note that getInstalledBrowsers already exists on the Cache, but that doesn't seem like the most logical place to me and seems to fit in much nicer in the browsers package, also to encapsulate the browsers logic a bit more. If that is not possible, it should get a similar API to BrowserFetcher with getInstalledBrowsers and remove methods.
It would be much nicer if Puppeteer's browser package provided a simple API to remove all obsolete (non-current) browser revisions. This is quite suboptimal, and it leads to solutions like which mostly work but require quite a bit of error-prone orchestration in user code. This is now also not an option anymore since Puppeteer 20 all we can use is the Cache.clear method, but that is not fine-grained enough because it will remove all browsers in the cache, including the current ones which we'd then have to download again. This used to be done by Puppeteer before, but was removed in 344bc2a, however we still could do this ourselves with BrowserFetcher.localRevisions and BrowserFetcher.remove. The use case for this is that currently the cache directory can grow indefinitely, which is a problem locally and when running on fixed CI bots, so we need a way to prune old downloaded browsers.
How can I install puppeteer for firefox and include it in the code so I can use it?Ĭode not working in chrome because of data url error const url = await page.evaluate(async () => )Ĭonst chrome = await puppeteerChrome.In Puppeteer 20 the BrowserFetcher class was removed in favor of the new package, but sadly the latter doesn't seem to provide a way to remove browsers and get all installed browsers/revisions that the former did. The problem is "npm install puppeteer-firefox" is not working to install puppeteer for firefox. I am trying to open a url and I am getting a data URL error in chrome console so I am moving to firefox console to get around the no data urls opening in the chrome console issue.