NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #1127 most downloaded on NuGet
Headless Browser .NET API
Latest stable
25.15.0
Last release 1 months ago
21 Oct 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
142 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
https://github.com/kblok/puppeteer-sharp/commit/43bd2524f2be67ec36c1b89521316a64c52b1f99 Always add about:blank to default arguments.
about:blank to default arguments.https://github.com/kblok/puppeteer-sharp/commit/a2482c8a06c1695c14c81ec116e91783facaa2e8 Support thrown strings and numbers in getExceptionMessage.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
https://github.com/kblok/puppeteer-sharp/commit/a6c1c6ce0769f430a03e5d367856b34d5308d512 Browser Contexts.
https://github.com/kblok/puppeteer-sharp/commit/4539bbcbe0d54d2fb81e5e5e1a72723695903cd7 Page.CloseAsync(PageCloseOptions)
https://github.com/kblok/puppeteer-sharp/commit/3e985c5f1b2417d6e1067364adcbbca5fee71ea5 CSP Support
https://github.com/kblok/puppeteer-sharp/commit/ccf6e016136833d969d95ba9878026b2aee9ad85 Request.RedirectChain
Frame.EvaluateExpressionHandleAsync
The Downloader class was renamed to BrowserFetcher. BrowserFetcher has the following API:
If you were using Downloader like this:
await Downloader.CreateDefault().DownloadRevisionAsync(chromiumRevision);
It should be changed to :
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
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
});
Nothing published for this version
Nothing published for this version
The day has come. Puppeteer Sharp is fully compatible with Puppeteer V1!
The day has come. Puppeteer Sharp is fully compatible with Puppeteer V1!
Page.SetViewport renamed to Page.SetViewportAsync
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 on
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
* Features - Input simulation * New APIs - ElementHandle.HoverAsync - ElementHandle.ClickAsync - ElementHandle.UploadFileAsync - ElementHandle.TapAsyn
Features
New APIs
Fixed Browse.Close on Azure Functions
v0.4 includes more than 25 Page APIs such as: Full Page.GoToAsync/ReloadAsync support Emulate/EmulateMedia/SetViewport/SetUserAgent Get and Set cookie
v0.4 includes more than 25 Page APIs such as: Full Page.GoToAsync/ReloadAsync support Emulate/EmulateMedia/SetViewport/SetUserAgent Get and Set cookies SetContent Evaluate javascript functions and expressions WaitFor expressions
await page.GoToAsync("http://www.mysite.com");
//Do you need to wait for your javascript framework to load content?
//You got it!
await page.WaitForSelectorAsync("div.main-content");
///Emulate media print? Sure!
await Page.EmulateMediaAsync(MediaType.Print);
//Or an iPhone?
await Page.EmulateAsync(iPhone);
///Inject a cookie
await page.SetCookieAsync(new CookieParam
{
Name = "gridcookie",
Value = "GRID",
Path = "/grid.html"
});
//Or even HTML!
await page.SetContentAsync("<div>hello</div>");
//How about executing javascript functions?
await page.EvaluateFunctionAsync<int>("(a) => 5 + a", myValueForA);
We added support for remote browser connections. This will allow Puppeteer Sharp to be used in docker containers or Azure Functions.
var options = new ConnectOptions()
{
BrowserWSEndpoint = $"wss://browserproviderwhomightwanttosponsortheproject.io"
};
var url = "https://www.google.com/";
using (var browser = await PuppeteerSharp.Puppeteer.ConnectAsync(options))
{
using (var page = await browser.NewPageAsync())
{
await page.GoToAsync(url);
await page.PdfAsync("wot.pdf");
}
}
These are the new available APIs:
- Page.GoToAsync
- Page.ReloadAsync
- Page.EmulateMediaAsync
- Page.SetViewport
- Page.EmulateAsync
- Page.SetUserAgentAsync
- Page.MetricsAsync
- Page.Dialog
- Page.Error
- Page.RequestCreated
- Page.GetCookiesAsync
- Page.SetCookieAsync
- Page.SetExtraHttpHeadersAsync
- Page.AuthenticateAsync
- Page.SetJavaScriptEnabledAsync
- Page.SetContentAsync
- Page.EvaluateFunctionAsync
- Page.EvaluateExpressionAsync
- Page.GetTitleAsync
- Page.SetOfflineModeAsync
- Page.CloseAsync
- Page.Console
- Page.WaitForTimeoutAsync
- Page.WaitForFunctionAsync
- Puppeteer.ConnectAsync
- Browser.Disconnect();
Nothing published for this version
Nothing published for this version
Nothing published for this version
```CS var userDataDir = Launcher.GetTemporaryDirectory(); var options = TestConstants.DefaultBrowserOptions(); options.UserDataDir = userDataDir;
var userDataDir = Launcher.GetTemporaryDirectory();
var options = TestConstants.DefaultBrowserOptions();
options.UserDataDir = userDataDir;
var launcher = new Launcher();
var browser = await launcher.LaunchAsync(options, TestConstants.ChromiumRevision);
var options = TestConstants.DefaultBrowserOptions();
using (var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(options, TestConstants.ChromiumRevision))
using (var page = await browser.NewPageAsync())
{
var response = await page.GoToAsync("https://www.google.com");
}
Nothing published for this version
The first milestone on the roadmap is completed.
The first milestone on the roadmap is completed.
You can export any page to PDF file.
var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(options, chromiumRevision);
var page = await browser.NewPageAsync();
await page.GoToAsync("https://www.google.com");
await page.PdfAsync(outputFile);
You can also get a PDF in a stream.
var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(options, chromiumRevision);
var page = await browser.NewPageAsync();
await page.GoToAsync("https://www.google.com");
var stream = await page.PdfStreamAsync();
await UploadToAzure(stream);
PdfAsync supports the following options:
<decimal> Scale of the webpage rendering. Defaults to 1.<bool> Display header and footer. Defaults to false.<string> HTML template for the print header.<string> HTML template for the print footer. Should use the same format as the HeaderTemplate.<bool> Print background graphics. Defaults to false.<boolean> Paper orientation. Defaults to false.<string> Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.<string> Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.<string> Paper width, accepts values labeled with units.<string> Paper height, accepts values labeled with units.<MarginOptions> Paper margins, defaults to none.<string> Top margin, accepts values labeled with units.<string> Right margin, accepts values labeled with units.<string> Bottom margin accepts values labeled with units.<string> Left margin, accepts values labeled with units.Documentation adapted from the original Puppeteer repo.
You can take a screenshot of a page (the visible part based on the viewport), a full page or a part of it.
var browser = await PuppeteerSharp.Puppeteer.LaunchAsync(options, chromiumRevision);
var page = await browser.NewPageAsync();
await page.SetViewport(new ViewPortOptions
{
Width = 500,
Height = 500
});
await page.GoToAsync("https://www.google.com");
await page.ScreenshotAsync(outputFile);
You can also use ScreenshotStreamAsync to get a stream instead of a file.
The ScreenshotAsync method supports the following options:
<string> Specify screenshot type, can be either jpeg or png. Defaults to 'png'.<decimal?> The quality of the image, between 0-100. Not applicable to png images.<bool> When true, takes a screenshot of the full scrollable page. Defaults to false.<Clip> An object which specifies clipping region of the page. Should have the following fields:
<int> x-coordinate of top-left corner of clip area.<int> y-coordinate of top-left corner of clip area.<int> width of clipping area.<number> height of clipping area.<bool> Hides default white background and allows capturing screenshots with transparency. Defaults to false.Documentation adapted from the original Puppeteer repo.
Nothing published for this version
One column per quarter.