Skip to content

v1.1

Compare
Choose a tag to compare
@kblok kblok released this 28 Jun 22:38
· 1044 commits to master since this release
f81204b

New Features

  • New Chromium version r536395
  • Service workers support
  • Cache Support
  • New WaitFor options
  • New BrowserFetcher utility
  • Dump IO implementation

New APIs

  • Page.SetCacheEnabledAsync
  • Page.DOMContentLoaded
  • Page.WaitForXPathAsync
  • ResponseData.FromServiceWorker
  • ExecutionContext.Frame
  • Frame.EvaluateExpressionHandleAsync
  • Frame.EvaluateFunctionHandleAsync
  • Frame.WaitForSelectorAsync
  • Frame.WaitForXPathAsync
  • Frame.WaitForSelectorOrXPathAsync

Breaking Changes

Downloader changes

The Downloader class was renamed to BrowserFetcher. BrowserFetcher has the following API:

  • DefaultRevision
  • DownloadsFolder
  • DownloadHost
  • Platform
  • DownloadProgressChanged
  • CanDownloadAsync(int revision)
  • LocalRevisions()
  • Remove(int revision)
  • RevisionInfo(int revision)
  • DownloadAsync(int revision)
  • GetExecutablePath(int revision)
  • GetExecutablePath(Platform platform, string folderPath)

If you were using Downloader like this:

await Downloader.CreateDefault().DownloadRevisionAsync(chromiumRevision);

It should be changed to :

await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);

Puppeteer.LaunchAsync breaking change

In order to simplify the API, the revision argument was removed from the LaunchAsync method. So this piece of code:

Puppeteer.LaunchAsync(launcherOptions, Downloader.DefaultRevision);

Should be changed to:

Puppeteer.LaunchAsync(launcherOptions);

If you need to launch Puppeteer using another revision you should handle that using the ExecutablePath option:

var myRevisionInfo = await new BrowserFetcher().DownloadAsync(myRevision);
var browser = Puppeteer.LaunchAsync(new LaunchOptions
{
   Headless = true,
   ExecutablePath = myRevisionInfo.ExecutablePath
});