18

I'm using Puppeteer Sharp in my .NET application to do some webpage automation tasks. However, I have to deploy my app in an environment that only has intranet access, which means Puppeteer's BrowserFetcher class is unable to download Chromium from the internet, since it cannot access the Chromium repositories.

Is it possible to bundle a copy of Chromium with my app, so Puppeteer does not have to download it? How would I do that? I'm not finding much in the docs about this...

hardkoded
  • 18,915
  • 3
  • 52
  • 64
Master_T
  • 7,232
  • 11
  • 72
  • 144

1 Answers1

33

You can use the LaunchOptions.ExecutablePath property. If you use ExecutablePath you don't even need to call BrowserFetcher. It would look something like this:

var options = new LaunchOptions
{
    Headless = true,
    ExecutablePath = "<CHROME.EXE FULL PATH>"
};

using (var browser = await Puppeteer.LaunchAsync(options))
{
}
hardkoded
  • 18,915
  • 3
  • 52
  • 64
  • 1
    Thanks for your answer. Where should I download the package from tho? Will any copy of Chromium do, or is it better to obtain a specific version? – Master_T Nov 20 '18 at 15:38
  • 2
    Good question. You can see the version mapping here https://github.com/GoogleChrome/puppeteer/blob/v1.10.0/docs/api.md so you can download a compatible version here https://chromium.woolyss.com/download/en/ – hardkoded Nov 20 '18 at 20:14
  • 1
    Surely you *shouldn't* call `BrowserFetcher` if you want to avoid a download. – Ian Warburton Oct 20 '19 at 14:58