I have the following code that creates, then closes a Chrome page via PuppeteerSharp:
var options = new LaunchOptions() {Headless = true, Args = new[] { "--disable-web-security" }};
Browser browser = await Puppeteer.LaunchAsync(options, factory);
Page page = await browser.NewPageAsync();
await page.CloseAsync();
page.Dispose();
The last statement (page.Dispose) causes to write out the following warning:
PuppeteerSharp.Page:Warning: Protocol error: Connection closed. Most likely the page has been closed.
I have the following questions:
.Dispose
of the page after I close it?You don't need to call Dispose if you call CloseAsync
. Dispose is just a fire and forget call to CloseAsync. See.