CefSharp Puppeteer is a fork of puppeteer-sharp by Darío Kondratiuk that has been adapted specifically for use with CefSharp. Direct communication with the ChromiumWebBrowser instance rather than opening a web socket. 1:1 mapping of Page and ChromiumWebBrowser CEF only supports a subset of features, features will be added/removed as the project matures
- .Net 4.7.2 or .Net Core 3.1 or greater
- CefSharp 95.7.141 or greater
If you have an issue or a question:
- Ask a question on Discussions.
See this document for information on how to contribute.
You can also change the view port before generating the screenshot when using WinForms
await DevToolsContext.SetViewportAsync(new ViewPortOptions
{
Width = 500,
Height = 500
});
Currently not supported via CefSharp Puppeteer, use ChromiumWebBrowser.PrintToPdfAsync instead.
await using var page = await chromiumWebBrowser.GetDevToolsContextAsync();
await page.SetContentAsync("<div>My Receipt</div>");
var result = await page.GetContentAsync();
await using var page = await chromiumWebBrowser.GetDevToolsContextAsync();
var seven = await page.EvaluateExpressionAsync<int>("4 + 3");
var someObject = await page.EvaluateFunctionAsync<dynamic>("(value) => ({a: value})", 5);
Console.WriteLine(someObject.a);