Skip to content

Releases: hardkoded/puppeteer-sharp

v1.6

14 Sep 11:58
c18b68e
Compare
Choose a tag to compare

New Features

  • a2482c8 Support thrown strings and numbers in getExceptionMessage.
  • 93ea816 Implement PageError event from a worker.
  • 69321c0 Click wrapped links support.
  • 36d39a1 Add an option to collect coverage of anonymous scripts.
  • 050325b ElementHandle.IsIntersectingViewportAsync and Offsetclicks.

New APIs

  • cb6cf77 Page.WaitForRequestAsync and Page.WaitForResponseAsync.

Breaking Changes

  • 6162974 Remove throw in case of empty elementHandle.
  • 7b2707a EvaluateFunctionAsync and EvaluateFunctionAsync now will throw and EvaluationFailedException.

Changelog

  • 6640f5d Roll Chromium to r571375.
  • 04fa70f Migrate exposeFunction from console.debug to Runtime.installBinding.
  • 73f515d Don't pass a reference to the page into frames.
  • 59f9f3c Simplify EmulationManager.
  • c781283 Clarify docs about waitForNavigation.
  • 000dc19 Add new error reasons for request.abort().
  • b4ca3f4 Fix random tests flakiness.
  • acceb52 Test that verifies pptr works with SVG nodes.
  • 7b2707a Nicer protocol error messages.
  • f2e27c7 Add support for target.page for 'backgroud_page'.
  • a3f4175 New devices.
  • 18adf78 Fix race condition in WaitTask.
  • fb4cf11 Make Payload constructor Public.
  • fb4cf11 Fix ContinueAsync payload override.

v.1.5

01 Sep 15:27
3a44de3
Compare
Choose a tag to compare

New Features

New APIs

  • 07cdbd8 Target.Opener.
  • aa6470f Request.IsNavigationRequest.
  • 1de769f Page.IsClosed.
  • d2abe29 Change accessibilty on Payload.
  • c4b876a Page. ScreenshotBase64Async and ElementHandle.ScreenshotBase64Async.
  • 3298bd4 ElementHandle.QuerySelectorAllHandleAsync.
  • 25bc019 CDPSession.TargetType.
  • 25bc019 Page.WorkerCreated.
  • 25bc019 Page.WorkerDestroyed.
  • 25bc019 Page.Workers.

Breaking Changes

  • 7490355 Disable crash reporting by default.
  • f8b5ff5 Added .ConfigureAwait(false) to each await.
  • e510b19 Change ScreenshotOptions.Quality type.
  • 25bc019 Dropped CDPSession.TargetId.
  • 25bc019 Dropped ExecutionContext.FrameId.
  • 25bc019 Dropped ExecutionContext.IsDefault.

Changelog

  • 709cefd Chromium updated to r564778.
  • 7ef326b Update PuppeteerSharp.Tests packages versions.
  • 1f0ecbf Launch browser with 'about:blank' by default.
  • 9ad9de3 Respect timeout 0 in Page.waitForFunctionAsync.
  • cdb4c88 Add a missing test for elementHandle.
  • f19813b Pass through "background_page" types.
  • c918744 Ensure first page is created when browser is launched.
  • 31ad5b0 Improve access to files to use true asynchronous methods.
  • 67ac040 Add test that validates that pages open with userDataDir arg.
  • 539a4cf Normalize scrollbars in headful tests.
  • def5803 Disable OOPIF by default.
  • eb0a322 Not pass user options to browser constructor.
  • c043062 Verify ignoreHTTPSErrors works with puppeteer.ConnectAsync.
  • 521ec40 Update ConsoleType.

v1.4

27 Jul 11:37
8f6ced6
Compare
Choose a tag to compare

New APIs

Minor changes

  • b1f108b Rolled Chromium to r555668.
  • 1ca3e70 Status 204 support.
  • 21daa2d Report 'Log' domain entries as 'console' events.
  • b187eb1 Verify file url interception works as expected.
  • 8e62366 DownloadAsync should return revision info even if the revision was already downloaded.
  • 5b66364 Allow user gesture restricted code to be run in Page.EvaluateExpressionAsync.
  • 1a86165 Add pixel2/pixel2 xl.
  • c39f625 Add explanation to page.waitForNavigation.
  • 60c2c0e ElementHandle EvaluateFunctionAsync examples.

v1.3

23 Jul 11:42
74d434d
Compare
Choose a tag to compare

New Features

New APIs

Breaking Changes

Changelog

  • c99a35d Add an option to disable timeout for WaitForFunctionAsync
  • cd5f9ed Tracing.StopAsync now returns a string with the trace data.
  • 8bfb4d4 ViewPortOptions.DeviceScaleFactor, IsLandscape and HasTouch now has a public setter.
  • 1497c79 Page.waitForNavigation handle mixed content correctly.
  • 011908d Explicitly throw on content request for redirect response
  • 0e581d8 Consume protocol errors when initiating browser.close()

v1.2

13 Jul 11:21
3065bd7
Compare
Choose a tag to compare

New Features

  • New RequestChain property
  • Chromium updated to r543305

New APIs

Changes

  • 4b5758f Response.Ok() returns true for local files
  • 787a76b Target.TargetType is now an enum.
  • 332796a NavigationException Improvements

v1.1

28 Jun 22:38
f81204b
Compare
Choose a tag to compare

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
});

v1

04 Jun 11:38
9fb7254
Compare
Choose a tag to compare
v1

The day has come. Puppeteer Sharp is fully compatible with Puppeteer V1!

New Features

  • Request.RespondAsync support.
  • CSS and JS Coverage.
  • Request Interception.

New APIs

  • Request.RespondAsync
  • Page.Coverage.StartJSCoverageAsync
  • Page.Coverage.StopJSCoverageAsync
  • Page.Coverage.StartCSSCoverageAsync
  • Page.Coverage.StopCSSCoverageAsync
  • Page.ScreenshotDataAsync
  • Page.PdfDataAsync
  • Page.SetRequestInterceptionAsync
  • Page.GoBackAsync
  • Page.GoForwardAsync
  • Page.QueryObjectsAsync
  • ElementHandle.ScreenshotDataAsync
  • ElementHandle.PdfDataAsync
  • Browser.WebSocketEndpoint
  • Browser.Process

Namespace Changes

  • PuppeteerSharp.ClickOptions => PuppeteerSharp.Input.ClickOptions
  • PuppeteerSharp.Key => PuppeteerSharp.Input.Key
  • PuppeteerSharp.Keyboard => PuppeteerSharp.Input.Keyboard
  • PuppeteerSharp.KeyDefinition => PuppeteerSharp.Input.KeyDefinition
  • PuppeteerSharp.KeyDefinitions => PuppeteerSharp.Input.KeyDefinitions
  • PuppeteerSharp.Mouse => PuppeteerSharp.Input.Mouse
  • PuppeteerSharp.MouseButton => PuppeteerSharp.Input.MouseButton
  • PuppeteerSharp.MoveOptions => PuppeteerSharp.Input.MoveOptions
  • PuppeteerSharp.PressOption => PuppeteerSharp.Input.PresspPtions
  • PuppeteerSharp.Touchscreen => PuppeteerSharp.Input.TouchScreen
  • PuppeteerSharp.Clip => PuppeteerSharp.Media.Clip
  • PuppeteerSharp.MarginOptions => PuppeteerSharp.Media.MarginOptions
  • PuppeteerSharp.MediaType => PuppeteerSharp.Media.MediaType
  • PuppeteerSharp.PaperFormat => PuppeteerSharp.Media.PaperFormat
  • PuppeteerSharp.ScreenOrientation => PuppeteerSharp.Media.ScreenOrientation
  • PuppeteerSharp.ScreenOrientationType => PuppeteerSharp.Media.ScreenOrientationType
  • PuppeteerSharp.DeviceDescriptor => PuppeteerSharp.Mobile.DeviceDescriptor
  • PuppeteerSharp.DeviceDescriptors => PuppeteerSharp.Mobile.DeviceDescriptors
  • PuppeteerSharp.DeviceDescriptorName => PuppeteerSharp.Mobile.DeviceDescriptorName

v0.8 ElementHandle Support

28 May 12:06
e0e07a6
Compare
Choose a tag to compare
  • 0.8.0: ElementHandle
    • Features:
      • ElementHandle support
    • API Changes
      • Page.SetViewport renamed to Page.SetViewportAsync
      • JSHandle.AsElement was dropped. Use JSHandle as ElementHandle instead
      • JSHandle.JsonValue renamed to JSHandle.JsonValueAsync
    • New APIs
      • Page.WaitForNavigationAsync
      • ElementHandle.QuerySelectorAsync
      • ElementHandle.QuerySelectorAllAsync
      • ElementHandle.XPathAsync
      • ElementHandle.ScreenshotAsync
      • ElementHandle.ScreenshotStreamAsync
      • ElementHandle.ClickAsync
      • ElementHandle.HoverAsync
      • ElementHandle.BoundingBoxAsync
      • JSHandle.GetPropertyAsync
      • JSHandle.GetPropertiesAsync

v0.7 Page Improvements

09 May 00:03
de31886
Compare
Choose a tag to compare

We are shipping Puppeteer Sharp v0.7 with many cool new features: Element selectors and evaluation over elements. But our big challenge on v0.7 was one of the hard things in computer science: Naming Things.

Puppeteer has these 5 cool functions:

  • $(selector): It calls document.querySelector and returns an ElementHandle.
  • $$(selector): It calls document.querySelectorAll and returns an ElementHandle array.
  • $eval(selector, function): It calls document.querySelector and executes a function passing the element as an argument.
  • $$eval(selector, function): It calls document.querySelectorAll and executes a function passing the element array as an argument.
  • $x(xpathExpression): It calls document.evaluate and returns an ElementHandle array.

What do all these methods have in common? Hint: You can solve this using a string.Substring().
Yes, you guessed it right! They all have that $ symbol. And guess what? exactly, we can't name a method $ in C#.

So, in order to give these functions a clear and "csharpy" name, we decided to call them in this way:

  • page.$(selector) => page.QuerySelectorAsync(selector)
  • page.$$(selector) => page.QuerySelectorAllAsync(selector)
  • page.$eval(selector, function) => page.QuerySelectorAsync(selector).EvaluateFunctionAsync(function)
  • page.$$eval(selector, function) => page.QuerySelectorAllHandleAsync(selector).EvaluateFunctionAsync(function)
  • page.$(selector) => page.XPathAsync(selector)

These methods may be more verbose, but this naming convention makes them clearer and hopefully, easier to learn.

This is the complete list of new APIs we implemented in this version:
- Page.XPathAsync
- Page.QuerySelectorAsync
- Page.QuerySelectorAllAsync
- Page.QuerySelectorAllHandleAsync
- Page.SelectAsync
- Page.ExposeFunctionAsync
- Page.EvaluateOnNewDocumentAsync
- Page.AddScriptTagAsync
- Page.AddStyleTagAsync
- Page.PageError
- JSHandle.EvaluateFunctionAsync
- ElementHandle.EvaluateFunctionAsync

v0.6 Input simulation

04 May 21:50
d43f293
Compare
Choose a tag to compare
  • Features

    • Input simulation
  • New APIs

    • ElementHandle.HoverAsync
    • ElementHandle.ClickAsync
    • ElementHandle.UploadFileAsync
    • ElementHandle.TapAsync
    • ElementHandle.FocusAsync
    • ElementHandle.TypeAsync
    • ElementHandle.PressAsync
    • Keyboard.DownAsync
    • Keyboard.UpAsync
    • Keyboard.SendCharacterAsync
    • Keyboard.TypeAsync
    • Keyboard.PressAsync
    • Mouse.MoveAsync
    • Mouse.ClickAsync
    • Mouse.DownAsync
    • Mouse.UpAsync
    • TouchScreen.TapAsync
    • Page.ClickAsync
    • Page.HoverAsync
    • Page.FocusAsync
    • Page.TypeAsync