Headless Chrome .NET API
Hopefully these features are not that popular
Task.Delay
instead. by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2595
ClickCount
to Count
by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2600
Frame.Name
@kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2602
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v16.0.0...v17.0.0
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v15.1.0...v16.0.0
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v15.0.0...v15.1.0
Puppeteer Sharp is now using the new headless mode by default!
If you need to use the old headless mode, you can pass HeadlessMode = HeadlessMode.Shell
into the LaunchOptions
.
As part of this change, we will also download an extra Chrome browser, chrome-headless-shell by default, and use it for the old headless mode.
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v14.1.0...v15.0.0
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v14.0.0...v14.1.0
IElementHandle.ScreenshotAsync(... ScreenshotOptions)
was renamed to IElementHandle.ScreenshotAsync(... ElementScreenshotOptions)
in https://github.com/hardkoded/puppeteer-sharp/pull/2376
You can now wait for a device prompt!
var promptTask = Page.WaitForDevicePromptAsync();
await Task.WhenAll(
promptTask,
Page.ClickAsync("#connect-bluetooth"));
var devicePrompt = await promptTask;
await devicePrompt.SelectAsync(
await devicePrompt.WaitForDeviceAsync(device => device.Name.Contains("My Device")).ConfigureAwait(false)
);
Now you can use AddRequestInterceptor
instead of the Request
page and give the ContinueAsync
, AbortAsync
and RespondAsync
different priorities.
Page.AddRequestInterceptor(request =>
{
if (request.Url.EndsWith(".css"))
{
var headers = request.Headers;
headers["xaction"] = "continue";
return request.ContinueAsync(new Payload() { Headers = headers, }, 4);
}
return request.ContinueAsync(new Payload(), 0);
});
Page.AddRequestInterceptor(request =>
{
if (request.Url.EndsWith(".css"))
{
Dictionary<string, object> headers = [];
foreach (var kvp in request.Headers)
{
headers.Add(kvp.Key, kvp.Value);
}
headers["xaction"] = "respond";
return request.RespondAsync(new ResponseData() { Headers = headers, }, 2);
}
return request.ContinueAsync(new Payload(), 0);
});
AddRequestInterceptor
will ensure that these new async listeners are executed one after the other.
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v13.0.2...v14.0.0
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v13.0.1...v13.0.2
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v13.0.0...v13.0.1
We have a few more breaking changes in our effort to catch puppeteer.
FileChooser.Cancel
was renamed to CancelAsync
, and it's not Async by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2336
CreateIncognitoBrowserContextAsync
to pass proxy settings. by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2346
Worker
was renamed to WebWorker
by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2356
IExecutionContext.QueryObjectsAsync
was removed by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2356
IFrame.GetExecutionContextAsync
was removed by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2356
IJSHandle.ExecutionContext
was removed by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2356
IsVisibleAsync
and IsHiddenAsync
by @kblok in https://github.com/hardkoded/puppeteer-sharp/pull/2349
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v12.0.0...v13.0.0
Chrome version is now 117.0.5938.62
Small breaking change. But as it's a breaking change, we need to bump major. LaunchOption.TargetFilter
now expects a Target
instead a TargetInfo
.
Full Changelog: https://github.com/hardkoded/puppeteer-sharp/compare/v11.0.6...v12.0.0