From 61091cc69f4f5522c1d2dd52e2714b441e1f5349 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 11:12:21 +0000 Subject: [PATCH 1/2] docs: document RemoteException, ExceptionThrown events and regenerate API site docs Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Ls2e22Ga6NZa8UZ6vS5dUt --- .../api/PuppeteerSharp.RemoteException.html | 13 + ...ppeteerSharp.RemoteExceptionEventArgs.html | 13 + .../PuppeteerSharp.Bidi/BidiBrowserContext.md | 14 +- .../PuppeteerSharp.Bidi/BidiHttpRequest.md | 37 +- .../PuppeteerSharp.Bidi/BidiHttpResponse.md | 49 ++- .../docs/api/PuppeteerSharp.Bidi/BidiPage.md | 100 ++--- .../api/PuppeteerSharp.BrowserData/Firefox.md | 2 +- .../docs/api/PuppeteerSharp.Cdp/CdpBrowser.md | 48 +-- .../PuppeteerSharp.Cdp/CdpElementHandle.md | 18 +- .../api/PuppeteerSharp.Cdp/CdpHttpRequest.md | 22 +- .../api/PuppeteerSharp.Cdp/CdpHttpResponse.md | 47 +- .../docs/api/PuppeteerSharp.Cdp/CdpPage.md | 118 ++--- .../api/PuppeteerSharp.Cdp/CdpWebWorker.md | 14 +- .../api/PuppeteerSharp.Locators/Locator.md | 36 +- .../docs/api/PuppeteerSharp/Browser.md | 214 +++++++--- .../docs/api/PuppeteerSharp/BrowserContext.md | 146 ++++++- .../docs/api/PuppeteerSharp/BrowserFetcher.md | 30 +- .../PuppeteerSharp/BrowserFetcherOptions.md | 20 +- .../docs/api/PuppeteerSharp/ChromeLauncher.md | 2 +- .../docs/api/PuppeteerSharp/ConnectOptions.md | 37 +- .../docs/api/PuppeteerSharp/ConsoleMessage.md | 74 +++- .../PuppeteerSharp/ConsoleMessageLocation.md | 27 +- .../docs/api/PuppeteerSharp/IResponse.md | 2 +- .../docs/api/PuppeteerSharp/LaunchOptions.md | 45 +- .../docs/api/PuppeteerSharp/Launcher.md | 2 +- .../content/docs/api/PuppeteerSharp/Page.md | 403 ++++++++++-------- .../docs/api/PuppeteerSharp/RecordOptions.md | 28 +- .../api/PuppeteerSharp/RemoteException.md | 133 ++++++ .../RemoteExceptionEventArgs.md | 68 +++ .../docs/api/PuppeteerSharp/Request-1.md | 68 ++- .../docs/api/PuppeteerSharp/Response-1.md | 79 +++- .../api/PuppeteerSharp/ScreenRecording.md | 40 +- .../docs/api/PuppeteerSharp/WebWorker.md | 35 +- .../content/docs/api/PuppeteerSharp/index.md | 2 + lib/PuppeteerSharp/IPage.cs | 4 + lib/PuppeteerSharp/RemoteException.cs | 3 +- 36 files changed, 1410 insertions(+), 583 deletions(-) create mode 100644 docs-site/public/api/PuppeteerSharp.RemoteException.html create mode 100644 docs-site/public/api/PuppeteerSharp.RemoteExceptionEventArgs.html create mode 100644 docs-site/src/content/docs/api/PuppeteerSharp/RemoteException.md create mode 100644 docs-site/src/content/docs/api/PuppeteerSharp/RemoteExceptionEventArgs.md diff --git a/docs-site/public/api/PuppeteerSharp.RemoteException.html b/docs-site/public/api/PuppeteerSharp.RemoteException.html new file mode 100644 index 000000000..521d113d5 --- /dev/null +++ b/docs-site/public/api/PuppeteerSharp.RemoteException.html @@ -0,0 +1,13 @@ + + + + + + +Redirecting… + + + +

Continue

+ + diff --git a/docs-site/public/api/PuppeteerSharp.RemoteExceptionEventArgs.html b/docs-site/public/api/PuppeteerSharp.RemoteExceptionEventArgs.html new file mode 100644 index 000000000..d305812f5 --- /dev/null +++ b/docs-site/public/api/PuppeteerSharp.RemoteExceptionEventArgs.html @@ -0,0 +1,13 @@ + + + + + + +Redirecting… + + + +

Continue

+ + diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiBrowserContext.md b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiBrowserContext.md index 595a1ee02..e77500e3e 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiBrowserContext.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiBrowserContext.md @@ -44,7 +44,7 @@ Clears all permission overrides for the browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L145) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L161) @@ -61,7 +61,7 @@ Closes the browser context. All the targets that belong to the browser context w **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L244) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L259) @@ -78,7 +78,7 @@ Gets all cookies in the browser context. **Returns:** [Task<CookieParam\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to an array of [CookieParam](/api/PuppeteerSharp/CookieParam/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L170) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L185) @@ -101,7 +101,7 @@ Creates a new page. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to a new [IPage](/api/PuppeteerSharp/IPage/) object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L195) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L210) @@ -155,7 +155,7 @@ An array of all pages inside the browser context. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [PageAsync()](/api/PuppeteerSharp/ITarget/#PuppeteerSharp_ITarget_PageAsync). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L192) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L207) @@ -178,7 +178,7 @@ Sets cookies in the browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L177) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L192) @@ -219,4 +219,4 @@ Gets an array of all active targets inside the browser context. **Returns:** `ITarget\[\]` — An array of all active targets inside the browser context. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L265) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiBrowserContext.cs#L280) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpRequest.md b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpRequest.md index c60d6e747..a4fd12536 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpRequest.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpRequest.md @@ -80,6 +80,29 @@ Gets whether the intercept resolution has already been handled. [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L99) + + + +### Worker + + +```csharp +public override WebWorker Worker { get; } +``` + + +Gets the worker that initiated the request, or null if the request was not initiated by a worker. + +**Value:** [WebWorker](/api/PuppeteerSharp/WebWorker/) — The worker. + +**Exceptions** + +| Type | Condition | +| --- | --- | +| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | Always thrown. Worker requests are not available in WebDriver BiDi. | + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L103) + ## Methods @@ -105,7 +128,7 @@ Exception is immediately thrown if the request interception is not enabled. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L207) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L213) @@ -122,7 +145,7 @@ Determines whether this request can be intercepted. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — `true` if the request can be intercepted; otherwise, `false`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L330) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L336) @@ -139,7 +162,7 @@ Fetches the unmodified POST data bytes for the request from the browser. **Returns:** [Task<byte\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the request's raw POST data, or `null` when there is none or fetching it fails. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L234) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L240) @@ -164,7 +187,7 @@ If the URL is set it won't perform a redirect. The request will be silently forw **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L131) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L135) @@ -181,7 +204,7 @@ Fetches the POST data for the request from the browser. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the request's POST data. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L231) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L237) @@ -205,7 +228,7 @@ Fulfills request with given response. To use this, request interception should b **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L167) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L173) @@ -226,4 +249,4 @@ Verifies that request interception is enabled and the request has not been handl | --- | --- | | [PuppeteerException](/api/PuppeteerSharp/PuppeteerException/) | Thrown when interception is not enabled or request is already handled. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L316) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpRequest.cs#L322) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpResponse.md b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpResponse.md index 8be684a73..2dd8df412 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpResponse.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiHttpResponse.md @@ -25,10 +25,33 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Implements:** [IResponse](/api/PuppeteerSharp/IResponse/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L34) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L35) ## Properties + + + +### EncodedDataLength + + +```csharp +public override long EncodedDataLength { get; } +``` + + +Total number of bytes received for this request over the network. + +**Value:** [long](https://learn.microsoft.com/dotnet/api/system.int64) + +The value is updated when the response finishes loading. During the `Response` event, it only covers +the bytes received up to the response headers. To get the total encoded transfer size (headers + compressed +body), read it in a `RequestFinished` handler or after awaiting [BufferAsync()](/api/PuppeteerSharp/IResponse/#PuppeteerSharp_IResponse_BufferAsync). +If the request fails after the response is received, the value is not updated. If the browser does not +report a size, e.g. for `data:` or `file:` URLs, the value is `0`. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L111) + @@ -44,7 +67,7 @@ True if the response was served from either the browser's disk cache or memory c **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L107) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L108) ## Methods @@ -63,4 +86,24 @@ Returns a Task which resolves to a buffer with response body. **Returns:** [ValueTask<byte\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1) — A Task which resolves to a buffer with response body. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L110) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L114) + + + + +### StreamAsync() + + +```csharp +public override Task StreamAsync() +``` + + +Returns a Task which resolves to a stream of the response body, with chunks delivered as they arrive from the network. + +**Returns:** [Task<Stream>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A Task which resolves to a stream of the response body. + +Call this from the [Response](/api/PuppeteerSharp/Page/#PuppeteerSharp_Page_Response) event to receive the body while it is still loading. +If the body has already finished loading, the stream contains the whole body as a single chunk. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiHttpResponse.cs#L125) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiPage.md b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiPage.md index 56f8cde73..2d46f6c52 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiPage.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Bidi/BidiPage.md @@ -192,7 +192,7 @@ Provide credentials for http authentication <a href="https://developer.mozill To disable authentication, pass `null`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L186) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L188) @@ -209,7 +209,7 @@ Brings page to front (activates tab). **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to Chromium. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L197) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L199) @@ -232,7 +232,7 @@ Captures a snapshot of the JavaScript heap and writes it to a file. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A Task which resolves after the heap snapshot is captured and written to disk. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L648) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L651) @@ -255,7 +255,7 @@ Closes the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L588) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L591) @@ -278,7 +278,7 @@ Creates a protocol-specific screen recording instance. **Returns:** [ScreenRecording](/api/PuppeteerSharp/ScreenRecording/) — A screen recording instance. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1111) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1116) @@ -301,7 +301,7 @@ Deletes cookies from the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L604) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L607) @@ -322,7 +322,7 @@ Dispose resources. | --- | --- | --- | | `disposing` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates whether disposal was initiated by [Dispose()](/api/PuppeteerSharp/Page/#PuppeteerSharp_Page_Dispose) operation. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1118) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1123) @@ -345,7 +345,7 @@ Enables CPU throttling to emulate slow CPUs. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L265) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L268) @@ -368,7 +368,7 @@ Emulates focus state of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L269) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L272) @@ -403,7 +403,7 @@ await page.EmulateIdleStateAsync(new EmulateIdleOverrides() {IsUserActive = true await page.EmulateIdleStateAsync(); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L261) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L264) @@ -426,7 +426,7 @@ Emulates the locale of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the locale has been set. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L249) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L252) @@ -481,7 +481,7 @@ await page.EvaluateFunctionAsync("() => matchMedia('(prefers-color-scheme: // → false ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L430) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L433) @@ -523,7 +523,7 @@ await page.EvaluateFunctionAsync("() => matchMedia('print').matches)"); // → true ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L427) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L430) @@ -548,7 +548,7 @@ Emulates network conditions. **NOTE** This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L736) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L739) @@ -571,7 +571,7 @@ Changes the timezone of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The viewport task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L205) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L207) @@ -599,7 +599,7 @@ Simulates the given vision deficiency on the page. await Page.EmulateVisionDeficiencyAsync(VisionDeficiency.Achromatopsia); await Page.ScreenshotAsync("Achromatopsia.png"). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L201) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L203) @@ -635,7 +635,7 @@ An example of overriding the navigator.languages property before the page loads: await page.EvaluateExpressionOnNewDocumentAsync("window.__example = true;"); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L685) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L688) @@ -672,7 +672,7 @@ An example of overriding the navigator.languages property before the page loads: await page.EvaluateFunctionOnNewDocumentAsync("() => window.__example = true"); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L652) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L655) @@ -696,7 +696,7 @@ Internal add exposed functions. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that completes when the function has been added. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1107) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1112) @@ -714,7 +714,7 @@ Shortcut for `MainFrame.ExtensionRealms()`. **Returns:** [IReadOnlyList<Realm>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1) — A list of [Realm](/api/PuppeteerSharp/Realm/) instances representing extension execution contexts. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L681) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L684) @@ -740,7 +740,7 @@ Returns the page's cookies. If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L770) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L773) @@ -764,7 +764,7 @@ Navigate to the previous page in history. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task that resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If can not go back, resolves to null. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L343) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L346) @@ -788,7 +788,7 @@ Navigate to the next page in history. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task that resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If can not go forward, resolves to null. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L346) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L349) @@ -806,7 +806,7 @@ Use [OpenDevToolsAsync()](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_OpenDe **Returns:** [Task<bool>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A `Task%601` that completes with true if DevTools is attached. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L703) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L706) @@ -825,7 +825,7 @@ Returns metrics. All timestamps are in monotonic time: monotonically increasing time in seconds since an arbitrary point in the past. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L644) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L647) @@ -843,7 +843,7 @@ This method is only available in Chrome. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A `Task%601` that completes with the DevTools page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L700) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L703) @@ -867,7 +867,7 @@ PDF implementation. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — PDF data. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L922) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L927) @@ -891,7 +891,7 @@ Screenshot implementation. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — The screenshot as a base64 string. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1009) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L1014) @@ -915,7 +915,7 @@ Shortcut for `page.MainFrame.GetExecutionContextAsync().QueryObjectsAsync(protot **Returns:** [Task<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task which resolves to a handle to an array of objects with this prototype. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L697) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L700) @@ -938,7 +938,7 @@ Reloads the page. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L273) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L276) @@ -961,7 +961,7 @@ Removes a previously added function via `Action)`. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L663) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L666) @@ -984,7 +984,7 @@ Removes script that injected into page by [EvaluateExpressionOnNewDocumentAsync( **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the script is removed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L667) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L670) @@ -1010,7 +1010,7 @@ Resizes the browser window of this page so that the content area (excluding brow This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L237) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L240) @@ -1027,7 +1027,7 @@ Resets the background color and Viewport after taking Screenshots using BurstMod **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The burst mode off. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L349) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L352) @@ -1053,7 +1053,7 @@ Toggles bypassing page's Content-Security-Policy. CSP bypassing happens at the moment of CSP initialization rather then evaluation. Usually this means that [SetBypassCSPAsync(bool)](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_SetBypassCSPAsync_System_Boolean_) should be called before navigating to the domain. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L409) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L412) @@ -1076,7 +1076,7 @@ Toggles ignoring of service worker for each request. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message is sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L674) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L677) @@ -1099,7 +1099,7 @@ Toggles ignoring cache for each request based on the enabled state. By default, **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L418) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L421) @@ -1122,7 +1122,7 @@ Clears all of the current cookies and then sets the cookies for the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L502) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L505) @@ -1149,7 +1149,7 @@ Activating drag interception enables the `Input.drag`, methods This provides the capability to capture drag events emitted on the page, which can then be used to simulate drag-and-drop. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L641) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L644) @@ -1197,7 +1197,7 @@ Sets the page's geolocation. Consider using `OverridePermission%7d)` to grant permissions for the page to read its geolocation. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L352) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L355) @@ -1220,7 +1220,7 @@ Enables/Disables Javascript on the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L396) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L399) @@ -1243,7 +1243,7 @@ Set offline mode for the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Result task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L715) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L718) @@ -1267,7 +1267,7 @@ Activating request interception enables `AbortAsync`, **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The request interception task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L706) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L709) @@ -1290,7 +1290,7 @@ Sets the user agent, user agent metadata, and platform. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L447) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L450) @@ -1313,7 +1313,7 @@ Sets the user agent to be used in this page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L434) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L437) @@ -1351,7 +1351,7 @@ using(var page = await browser.NewPageAsync()) await page.goto('https://www.example.com'); } -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L461) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L464) @@ -1370,7 +1370,7 @@ Returns information about the browser tab of this page. The result is a snapshot This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L245) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L248) @@ -1393,7 +1393,7 @@ Triggers an extension action for the given extension. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the extension action has been triggered. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L677) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L680) @@ -1437,7 +1437,7 @@ await waitTask.Result.AcceptAsync('/tmp/myfile.pdf'); This must be called *before* the file chooser is launched. It will not return a currently active file chooser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L305) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L308) @@ -1456,4 +1456,4 @@ Returns the page's window ID. This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L241) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Bidi/BidiPage.cs#L244) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.BrowserData/Firefox.md b/docs-site/src/content/docs/api/PuppeteerSharp.BrowserData/Firefox.md index a64b3fb7b..9e50ab662 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.BrowserData/Firefox.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.BrowserData/Firefox.md @@ -33,7 +33,7 @@ Chrome info. ```csharp -public const string DefaultBuildId = "stable_158.0.1" +public const string DefaultBuildId = "stable_160.0" ``` diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpBrowser.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpBrowser.md index d11e6a8f4..9dea46516 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpBrowser.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpBrowser.md @@ -25,7 +25,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Implements:** [IBrowser](/api/PuppeteerSharp/IBrowser/), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable), [IAsyncDisposable](https://learn.microsoft.com/dotnet/api/system.iasyncdisposable) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L35) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L36) ## Properties @@ -46,7 +46,7 @@ Get debug information from Puppeteer. Currently, includes pending protocol calls. In the future, more info might be added. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L120) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L121) @@ -63,7 +63,7 @@ Gets a value indicating if the browser is closed. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L106) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L107) ## Methods @@ -90,7 +90,7 @@ Adds a new screen with specified parameters and returns a [ScreenInfo](/api/Pupp Only supported in headless mode. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L211) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L212) @@ -107,7 +107,7 @@ Returns an array of all open [IBrowserContext](/api/PuppeteerSharp/IBrowserConte **Returns:** `IBrowserContext\[\]` — An array of [IBrowserContext](/api/PuppeteerSharp/IBrowserContext/) objects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L180) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L181) @@ -124,7 +124,7 @@ Closes Chromium and all of its pages (if any were opened). The browser object it **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L156) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L157) @@ -161,7 +161,7 @@ using(var browser = await Puppeteer.LaunchAsync(new LaunchOptions())) } ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L159) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L160) @@ -176,7 +176,7 @@ public override void Disconnect() Disconnects Puppeteer from the browser, but leaves the process running. After calling [Disconnect()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_Disconnect), the browser object is considered disposed and cannot be used anymore. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L149) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L150) @@ -193,7 +193,7 @@ Returns a map of installed extensions, keyed by extension ID. **Returns:** [Task<IReadOnlyDictionary<string, Extension>>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to a dictionary of extension ID to [Extension](/api/PuppeteerSharp/Extension/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L244) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L245) @@ -220,7 +220,7 @@ registered file handlers. Only available over a pipe connection. See [InstallPWAAsync(InstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_InstallPWAAsync_PuppeteerSharp_InstallPWAOptions_). Meaningful only for an app that is currently installed; querying an unknown manifest id rejects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L376) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L377) @@ -239,7 +239,7 @@ Gets the browser's original user agent. Pages can override browser user agent with `UserAgentMetadata)`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L145) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L146) @@ -258,7 +258,7 @@ Gets the browser's version. the format of [GetVersionAsync()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_GetVersionAsync) might change with future releases of Chromium. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L141) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L142) @@ -281,7 +281,7 @@ Gets the specified window bounds. **Returns:** [Task<WindowBounds>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the [WindowBounds](/api/PuppeteerSharp/WindowBounds/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L183) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L184) @@ -305,7 +305,7 @@ Installs an unpacked extension and returns the extension ID. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the extension ID. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L224) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L225) @@ -335,7 +335,7 @@ The returned manifest id echoes [ManifestId](/api/PuppeteerSharp/InstallPWAOptio to [LaunchPWAAsync(LaunchPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_LaunchPWAAsync_PuppeteerSharp_LaunchPWAOptions_), [GetPWAStateAsync(GetPWAStateOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_GetPWAStateAsync_PuppeteerSharp_GetPWAStateOptions_), or [UninstallPWAAsync(UninstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_UninstallPWAAsync_PuppeteerSharp_UninstallPWAOptions_). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L273) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L274) @@ -364,7 +364,7 @@ targets through [Targets()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowse (the app's web contents). If Chromium focuses an existing app window, this returns that window's existing page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L316) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L317) @@ -387,7 +387,7 @@ Creates a new page. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to a new [IPage](/api/PuppeteerSharp/IPage/) object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L132) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L133) @@ -412,7 +412,7 @@ Removes the screen associated with the given screen ID, unless it is the primary Only supported in headless mode. Fails if the primary screen ID is specified. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L218) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L219) @@ -441,7 +441,7 @@ Targets that are already on a blocked URL when this method is called stay attach the blocked page. This differs from launching the browser with network restrictions, where such targets are detached on the initial attach. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L396) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L397) @@ -458,7 +458,7 @@ Gets a list of [ScreenInfo](/api/PuppeteerSharp/ScreenInfo/) objects. **Returns:** [Task<ScreenInfo\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to an array of screen information objects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L204) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L205) @@ -482,7 +482,7 @@ Sets the specified window bounds. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the bounds have been set. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L192) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L193) @@ -499,7 +499,7 @@ Returns An Array of all active targets. **Returns:** `ITarget\[\]` — An Array of all active targets. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L135) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L136) @@ -522,7 +522,7 @@ Uninstalls a previously installed extension by its ID. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the extension is uninstalled. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L236) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L237) @@ -547,4 +547,4 @@ Uninstalls a previously installed Progressive Web App (PWA). Only available over a pipe connection. See [InstallPWAAsync(InstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_InstallPWAAsync_PuppeteerSharp_InstallPWAOptions_). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L300) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpBrowser.cs#L301) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpElementHandle.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpElementHandle.md index c08c22c2e..c08b691d1 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpElementHandle.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpElementHandle.md @@ -26,7 +26,7 @@ ElementHandles can be created by [QuerySelectorAsync(string)](/api/PuppeteerShar **Implements:** [IElementHandle](/api/PuppeteerSharp/IElementHandle/), [ICdpHandle](/api/PuppeteerSharp.Cdp/ICdpHandle/), [IJSHandle](/api/PuppeteerSharp/IJSHandle/), [IAsyncDisposable](https://learn.microsoft.com/dotnet/api/system.iasyncdisposable) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L35) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L36) ## Properties @@ -45,7 +45,7 @@ Element's page. **Value:** [Page](/api/PuppeteerSharp/Page/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L69) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L70) @@ -62,7 +62,7 @@ CDP Remote object. **Value:** [RemoteObject](/api/PuppeteerSharp.Cdp.Messaging/RemoteObject/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L54) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L55) ## Methods @@ -92,7 +92,7 @@ Throws an error if the form cannot be autofilled. Currently, Puppeteer supports auto-filling credit card information only and in Chrome in the new headless and headful modes only. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L182) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L183) @@ -109,7 +109,7 @@ When connected using Chrome DevTools Protocol, it returns a DOM.BackendNodeId fo **Returns:** [Task<int>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the backend node ID. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L166) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L167) @@ -126,7 +126,7 @@ Resolves the frame associated with the element.. **Returns:** [Task<IFrame>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the frame associated with the element. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L83) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L84) @@ -143,7 +143,7 @@ Scrolls the element into view using either the automation protocol client or by **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A Task that resolves when the message was confirmed by the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L95) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L96) @@ -160,7 +160,7 @@ Returns a string that represents the current object. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string that represents the current object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L206) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L207) @@ -186,4 +186,4 @@ Uploads files. This method expects `elementHandle` to point to an `input element` <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input</a>. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L117) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpElementHandle.cs#L118) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpRequest.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpRequest.md index 4f1812aee..542ca0267 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpRequest.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpRequest.md @@ -25,7 +25,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Implements:** [IRequest](/api/PuppeteerSharp/IRequest/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L16) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L17) ## Properties @@ -44,7 +44,7 @@ Gets the current intercept resolution state. **Value:** [InterceptResolutionState](/api/PuppeteerSharp/InterceptResolutionState/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L76) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L79) @@ -61,7 +61,7 @@ Gets whether the intercept resolution has already been handled. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L92) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L95) @@ -76,7 +76,7 @@ public override CdpHttpResponse Response { get; } **Value:** [CdpHttpResponse](/api/PuppeteerSharp.Cdp/CdpHttpResponse/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L73) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L76) ## Methods @@ -103,7 +103,7 @@ Exception is immediately thrown if the request interception is not enabled. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L186) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L191) @@ -120,7 +120,7 @@ Determines whether this request can be intercepted. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — `true` if the request can be intercepted; otherwise, `false`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L295) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L300) @@ -137,7 +137,7 @@ Fetches the unmodified POST data bytes for the request from the browser. **Returns:** [Task<byte\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the request's raw POST data, or `null` when there is none or fetching it fails. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L217) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L222) @@ -162,7 +162,7 @@ If the URL is set it won't perform a redirect. The request will be silently forw **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L115) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L118) @@ -179,7 +179,7 @@ Fetches the POST data for the request from the browser. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the request's POST data. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L210) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L215) @@ -203,7 +203,7 @@ Fulfills request with given response. To use this, request interception should b **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L151) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L156) @@ -224,4 +224,4 @@ Verifies that request interception is enabled and the request has not been handl | --- | --- | | [PuppeteerException](/api/PuppeteerSharp/PuppeteerException/) | Thrown when interception is not enabled or request is already handled. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L281) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpRequest.cs#L286) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpResponse.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpResponse.md index 016865b38..43d3a0379 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpResponse.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpHttpResponse.md @@ -29,6 +29,29 @@ Supports all classes in the .NET class hierarchy and provides low-level services ## Properties + + + +### EncodedDataLength + + +```csharp +public override long EncodedDataLength { get; } +``` + + +Total number of bytes received for this request over the network. + +**Value:** [long](https://learn.microsoft.com/dotnet/api/system.int64) + +The value is updated when the response finishes loading. During the `Response` event, it only covers +the bytes received up to the response headers. To get the total encoded transfer size (headers + compressed +body), read it in a `RequestFinished` handler or after awaiting [BufferAsync()](/api/PuppeteerSharp/IResponse/#PuppeteerSharp_IResponse_BufferAsync). +If the request fails after the response is received, the value is not updated. If the browser does not +report a size, e.g. for `data:` or `file:` URLs, the value is `0`. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L62) + @@ -44,7 +67,7 @@ True if the response was served from either the browser's disk cache or memory c **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L56) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L59) ## Methods @@ -63,4 +86,24 @@ Returns a Task which resolves to a buffer with response body. **Returns:** [ValueTask<byte\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask-1) — A Task which resolves to a buffer with response body. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L64) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L70) + + + + +### StreamAsync() + + +```csharp +public override Task StreamAsync() +``` + + +Returns a Task which resolves to a stream of the response body, with chunks delivered as they arrive from the network. + +**Returns:** [Task<Stream>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A Task which resolves to a stream of the response body. + +Call this from the [Response](/api/PuppeteerSharp/Page/#PuppeteerSharp_Page_Response) event to receive the body while it is still loading. +If the body has already finished loading, the stream contains the whole body as a single chunk. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpHttpResponse.cs#L99) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpPage.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpPage.md index 42a5898d1..41f4f9aa1 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpPage.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpPage.md @@ -44,7 +44,7 @@ Browser. **Value:** [Browser](/api/PuppeteerSharp/Browser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L141) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L146) @@ -61,7 +61,7 @@ Get the browser context that the page belongs to. **Value:** [IBrowserContext](/api/PuppeteerSharp/IBrowserContext/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L132) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L137) @@ -78,7 +78,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Value:** [CDPSession](/api/PuppeteerSharp/CDPSession/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L117) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L122) @@ -95,7 +95,7 @@ Gets all frames attached to the page. **Value:** `IFrame\[\]` — An array of all frames attached to the page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L126) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L131) @@ -112,7 +112,7 @@ If the page has JavaScript enabled. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L135) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L140) @@ -131,7 +131,7 @@ Gets page's main frame. Page is guaranteed to have a main frame which persists during navigations. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L123) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L128) @@ -148,7 +148,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Value:** [Target](/api/PuppeteerSharp/Target/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L120) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L125) @@ -173,7 +173,7 @@ Only supported with CDP protocol. | --- | --- | | [PuppeteerException](/api/PuppeteerSharp/PuppeteerException/) | Thrown when not supported by the current browser/protocol. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L138) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L143) @@ -190,7 +190,7 @@ Gets all workers in the page. **Value:** `WebWorker\[\]` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L129) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L134) ## Methods @@ -217,7 +217,7 @@ Provide credentials for http authentication <a href="https://developer.mozill To disable authentication, pass `null`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L621) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L627) @@ -234,7 +234,7 @@ Brings page to front (activates tab). **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to Chromium. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L536) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L541) @@ -257,7 +257,7 @@ Captures a snapshot of the JavaScript heap and writes it to a file. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A Task which resolves after the heap snapshot is captured and written to disk. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L310) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L315) @@ -280,7 +280,7 @@ Closes the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L625) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L631) @@ -303,7 +303,7 @@ Creates a protocol-specific screen recording instance. **Returns:** [ScreenRecording](/api/PuppeteerSharp/ScreenRecording/) — A screen recording instance. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L911) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L917) @@ -326,7 +326,7 @@ Deletes cookies from the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L261) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L266) @@ -349,7 +349,7 @@ Enables CPU throttling to emulate slow CPUs. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L558) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L563) @@ -372,7 +372,7 @@ Emulates focus state of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message has been sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L562) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L567) @@ -407,7 +407,7 @@ await page.EmulateIdleStateAsync(new EmulateIdleOverrides() {IsUserActive = true await page.EmulateIdleStateAsync(); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L554) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L559) @@ -430,7 +430,7 @@ Emulates the locale of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the locale has been set. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L547) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L552) @@ -485,7 +485,7 @@ await page.EvaluateFunctionAsync("() => matchMedia('(prefers-color-scheme: // → false ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L438) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L443) @@ -527,7 +527,7 @@ await page.EvaluateFunctionAsync("() => matchMedia('print').matches)"); // → true ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L434) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L439) @@ -552,7 +552,7 @@ Emulates network conditions. **NOTE** This does not affect WebSockets and WebRTC PeerConnections (see https://crbug.com/563644). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L499) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L504) @@ -575,7 +575,7 @@ Changes the timezone of the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The viewport task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L543) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L548) @@ -603,7 +603,7 @@ Simulates the given vision deficiency on the page. await Page.EmulateVisionDeficiencyAsync(VisionDeficiency.Achromatopsia); await Page.ScreenshotAsync("Achromatopsia.png"). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L539) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L544) @@ -639,7 +639,7 @@ An example of overriding the navigator.languages property before the page loads: await page.EvaluateExpressionOnNewDocumentAsync("window.__example = true;"); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L383) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L388) @@ -676,7 +676,7 @@ An example of overriding the navigator.languages property before the page loads: await page.EvaluateFunctionOnNewDocumentAsync("() => window.__example = true"); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L349) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L354) @@ -700,7 +700,7 @@ Internal add exposed functions. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that completes when the function has been added. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L749) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L755) @@ -718,7 +718,7 @@ Shortcut for `MainFrame.ExtensionRealms()`. **Returns:** [IReadOnlyList<Realm>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1) — A list of [Realm](/api/PuppeteerSharp/Realm/) instances representing extension execution contexts. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L675) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L678) @@ -744,7 +744,7 @@ Returns the page's cookies. If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L189) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L194) @@ -768,7 +768,7 @@ Navigate to the previous page in history. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task that resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If can not go back, resolves to null. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L566) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L571) @@ -792,7 +792,7 @@ Navigate to the next page in history. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task that resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. If can not go forward, resolves to null. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L569) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L574) @@ -810,7 +810,7 @@ Use [OpenDevToolsAsync()](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_OpenDe **Returns:** [Task<bool>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A `Task%601` that completes with true if DevTools is attached. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L181) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L186) @@ -829,7 +829,7 @@ Returns metrics. All timestamps are in monotonic time: monotonically increasing time in seconds since an arbitrary point in the past. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L302) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L307) @@ -847,7 +847,7 @@ This method is only available in Chrome. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A `Task%601` that completes with the DevTools page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L167) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L172) @@ -871,7 +871,7 @@ PDF implementation. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — PDF data. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L769) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L775) @@ -895,7 +895,7 @@ Screenshot implementation. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — The screenshot as a base64 string. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L850) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L856) @@ -919,7 +919,7 @@ Shortcut for `page.MainFrame.GetExecutionContextAsync().QueryObjectsAsync(protot **Returns:** [Task<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task which resolves to a handle to an array of objects with this prototype. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L389) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L394) @@ -942,7 +942,7 @@ Reloads the page. **Returns:** [Task<IResponse>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L518) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L523) @@ -965,7 +965,7 @@ Removes a previously added function via `Action)`. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L239) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L244) @@ -988,7 +988,7 @@ Removes script that injected into page by [EvaluateExpressionOnNewDocumentAsync( **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the script is removed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L358) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L363) @@ -1014,7 +1014,7 @@ Resizes the browser window of this page so that the content area (excluding brow This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L454) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L459) @@ -1031,7 +1031,7 @@ Resets the background color and Viewport after taking Screenshots using BurstMod **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The burst mode off. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L598) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L603) @@ -1057,7 +1057,7 @@ Toggles bypassing page's Content-Security-Policy. CSP bypassing happens at the moment of CSP initialization rather then evaluation. Usually this means that [SetBypassCSPAsync(bool)](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_SetBypassCSPAsync_System_Boolean_) should be called before navigating to the domain. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L429) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L434) @@ -1080,7 +1080,7 @@ Toggles ignoring of service worker for each request. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the message is sent to the browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L362) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L367) @@ -1103,7 +1103,7 @@ Toggles ignoring cache for each request based on the enabled state. By default, **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L503) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L508) @@ -1126,7 +1126,7 @@ Clears all of the current cookies and then sets the cookies for the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L203) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L208) @@ -1153,7 +1153,7 @@ Activating drag interception enables the `Input.drag`, methods This provides the capability to capture drag events emitted on the page, which can then be used to simulate drag-and-drop. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L158) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L163) @@ -1176,7 +1176,7 @@ Sets extra HTTP headers that will be sent with every request the page initiates. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L610) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L615) @@ -1201,7 +1201,7 @@ Sets the page's geolocation. Consider using `OverridePermission%7d)` to grant permissions for the page to read its geolocation. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L154) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L159) @@ -1224,7 +1224,7 @@ Enables/Disables Javascript on the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L425) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L430) @@ -1247,7 +1247,7 @@ Set offline mode for the page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Result task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L422) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L427) @@ -1271,7 +1271,7 @@ Activating request interception enables `AbortAsync`, **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The request interception task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L418) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L423) @@ -1294,7 +1294,7 @@ Sets the user agent, user agent metadata, and platform. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L511) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L516) @@ -1317,7 +1317,7 @@ Sets the user agent to be used in this page. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L507) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L512) @@ -1355,7 +1355,7 @@ using(var page = await browser.NewPageAsync()) await page.goto('https://www.example.com'); } -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L442) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L447) @@ -1374,7 +1374,7 @@ Returns information about the browser tab of this page. The result is a snapshot This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L478) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L483) @@ -1397,7 +1397,7 @@ Triggers an extension action for the given extension. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the extension action has been triggered. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L372) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L377) @@ -1441,7 +1441,7 @@ await waitTask.Result.AcceptAsync('/tmp/myfile.pdf'); This must be called *before* the file chooser is launched. It will not return a currently active file chooser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L572) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L577) @@ -1460,4 +1460,4 @@ Returns the page's window ID. This is an experimental API. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L469) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpPage.cs#L474) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpWebWorker.md b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpWebWorker.md index ad4d61da6..41bcf34e4 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpWebWorker.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Cdp/CdpWebWorker.md @@ -54,7 +54,7 @@ The CDP session client the WebWorker belongs to. **Value:** [ICDPSession](/api/PuppeteerSharp/ICDPSession/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L90) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L96) ## Methods @@ -73,7 +73,7 @@ Closes the worker. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that completes when the worker is closed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L100) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L106) @@ -104,7 +104,7 @@ Executes a script in browser context. If the script, returns a Promise, then the method would wait for the promise to resolve and return its value. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L158) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L164) @@ -129,7 +129,7 @@ Executes a script in browser context. If the script, returns a Promise, then the method would wait for the promise to resolve and return its value. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L165) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L171) @@ -156,7 +156,7 @@ Executes a function in browser context. If the script, returns a Promise, then the method would wait for the promise to resolve and return its value. [IJSHandle](/api/PuppeteerSharp/IJSHandle/) instances can be passed as arguments. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L151) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L157) @@ -188,7 +188,7 @@ Executes a function in the context. If the script, returns a Promise, then the method would wait for the promise to resolve and return its value. [IJSHandle](/api/PuppeteerSharp/IJSHandle/) instances can be passed as arguments. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L144) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L150) @@ -214,4 +214,4 @@ evaluated in the worker's context. **Returns:** [Task<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that resolves to a [IJSHandle](/api/PuppeteerSharp/IJSHandle/) of the truthy value returned by the function. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L172) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Cdp/CdpWebWorker.cs#L178) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp.Locators/Locator.md b/docs-site/src/content/docs/api/PuppeteerSharp.Locators/Locator.md index b61dec234..c3351b550 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp.Locators/Locator.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp.Locators/Locator.md @@ -138,7 +138,7 @@ Clicks the located element. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the click is performed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L234) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L236) @@ -162,16 +162,16 @@ Fills the located element with the provided value. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the fill is performed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L293) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L295) - + -### Filter(string) +### Filter(string, params object[]) ```csharp -public Locator Filter(string predicate) +public Locator Filter(string predicate, params object[] args) ``` @@ -183,10 +183,11 @@ If the predicate does not match, the locator will retry. | Name | Type | Description | | --- | --- | --- | | `predicate` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A JavaScript function expression that takes an element and returns a boolean. | +| `args` | [object\[\]](https://learn.microsoft.com/dotnet/api/system.object) | Additional serializable values or handles forwarded to the predicate after the element. | **Returns:** [Locator](./) — A new locator that filters based on the predicate. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L140) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L141) @@ -210,7 +211,7 @@ If the predicate does not match, the locator will retry. **Returns:** [Locator](./) — A new locator that filters based on the predicate. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L161) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L163) @@ -233,16 +234,16 @@ Hovers over the located element. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the hover is performed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L257) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L259) - + -### Map(string) +### Map(string, params object[]) ```csharp -public Locator Map(string mapper) +public Locator Map(string mapper, params object[] args) ``` @@ -253,10 +254,11 @@ Maps the locator using the provided mapper. | Name | Type | Description | | --- | --- | --- | | `mapper` | [string](https://learn.microsoft.com/dotnet/api/system.string) | A JavaScript function expression that transforms the element. | +| `args` | [object\[\]](https://learn.microsoft.com/dotnet/api/system.object) | Additional serializable values or handles forwarded to the mapper after the element. | **Returns:** [Locator](./) — A new locator that maps the element. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L150) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L152) @@ -279,7 +281,7 @@ Maps the locator using a handle-based mapper. **Returns:** [Locator](./) — A new locator that maps the element. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L171) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L173) @@ -325,7 +327,7 @@ Scrolls the located element. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the scroll is performed. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L270) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L272) @@ -463,7 +465,7 @@ Waits for the locator to locate an element. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the element is located. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L219) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L221) @@ -492,7 +494,7 @@ Note this requires the value to be JSON-serializable. **Returns:** [Task<T>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the serialized value. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L195) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L197) @@ -515,4 +517,4 @@ Waits for the locator to get a handle from the page. **Returns:** [Task<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to a handle for the located element. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L181) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Locators/Locator.cs#L183) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/Browser.md b/docs-site/src/content/docs/api/PuppeteerSharp/Browser.md index 239981fc1..67c637e6e 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/Browser.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/Browser.md @@ -46,7 +46,7 @@ Returns the browser type. Chrome, Chromium or Firefox. **Value:** [SupportedBrowser](/api/PuppeteerSharp/SupportedBrowser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L48) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L66) @@ -65,7 +65,7 @@ Get debug information from Puppeteer. Currently, includes pending protocol calls. In the future, more info might be added. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L66) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L84) @@ -82,7 +82,7 @@ Returns the default browser context. The default browser context can not be clos **Value:** [IBrowserContext](/api/PuppeteerSharp/IBrowserContext/) — The default context. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L57) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L75) @@ -99,7 +99,7 @@ Default wait time in milliseconds. Defaults to 30 seconds. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L60) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L78) @@ -116,7 +116,7 @@ Gets a value indicating if the browser is closed. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L54) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L72) @@ -133,7 +133,7 @@ Indicates that the browser is connected. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L63) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L81) @@ -150,7 +150,7 @@ Gets the spawned browser process. Returns `null` if the browser instance was cre **Value:** [Process](https://learn.microsoft.com/dotnet/api/system.diagnostics.process) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L51) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L69) @@ -167,7 +167,7 @@ A target associated with the browser. **Value:** [ITarget](/api/PuppeteerSharp/ITarget/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L69) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L87) @@ -190,7 +190,7 @@ You can find the `webSocketDebuggerUrl` from `http://${host}:${port}/json/versio Learn more about the devtools protocol <a href="https://chromedevtools.github.io/devtools-protocol">https://chromedevtools.github.io/devtools-protocol</a> and the browser endpoint <a href="https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target">https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target</a>. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L45) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L63) ## Events @@ -210,6 +210,25 @@ Raised when the [IBrowser](/api/PuppeteerSharp/IBrowser/) gets closed. [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L27) + + +### Console + + +```csharp +public event EventHandler Console +``` + + +Raised when JavaScript within any page or worker in the browser calls one of the console API methods, e.g. `console.log` or `console.dir`. +Only messages from pages and workers that PuppeteerSharp has attached to are delivered, e.g. via `Targets()`. +Service and shared workers are not attached automatically: their messages are only delivered after `WorkerAsync()` has been called for their target. +With WebDriver BiDi, service and shared worker console messages are not reported. + +**Value:** [EventHandler<ConsoleEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L30) + ### Disconnected @@ -226,7 +245,92 @@ Raised when puppeteer gets disconnected from the Chromium instance. This might h **Value:** [EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L30) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L33) + + + +### Request + + +```csharp +public event EventHandler Request +``` + + +Raised when any page in the browser issues a request. Contains an [IRequest](/api/PuppeteerSharp/IRequest/) instance. +Use [IPage](/api/PuppeteerSharp/IPage/) or [IFrame](/api/PuppeteerSharp/IFrame/) from the request to identify the originating context. +Events are only delivered for pages that have an [IPage](/api/PuppeteerSharp/IPage/) instance, for example one created via [PagesAsync(bool)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_PagesAsync_System_Boolean_). +These listeners only observe requests. Do not call `Continue`, `Abort` or `Respond` from them. To intercept requests, use [SetRequestInterceptionAsync(bool)](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_SetRequestInterceptionAsync_System_Boolean_) with an [Request](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_Request) listener. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L60) + + + +### RequestFailed + + +```csharp +public event EventHandler RequestFailed +``` + + +Raised when a request issued by any page in the browser fails, for example by timing out. +HTTP error responses, such as 404 or 503, complete with [RequestFinished](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_RequestFinished) instead. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L54) + + + +### RequestFinished + + +```csharp +public event EventHandler RequestFinished +``` + + +Raised when a request issued by any page in the browser finishes successfully. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L57) + + + +### RequestServedFromCache + + +```csharp +public event EventHandler RequestServedFromCache +``` + + +Raised when a request issued by any page in the browser is served from the memory cache. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L48) + + + +### Response + + +```csharp +public event EventHandler Response +``` + + +Raised when a response is received for a request issued by any page in the browser. +Use [Request](/api/PuppeteerSharp/IResponse/#PuppeteerSharp_IResponse_Request) to access the originating request. + +**Value:** [EventHandler<ResponseCreatedEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L51) @@ -242,7 +346,7 @@ Raised when the url of a target changes **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L33) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L36) @@ -258,7 +362,7 @@ Raised when a target is created, for example when a new page is opened by `windo **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L36) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L39) @@ -274,7 +378,7 @@ Raised when a target is destroyed, for example when a page is closed **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L39) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L42) @@ -290,7 +394,7 @@ Raised when a target is discovered **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L42) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L45) ## Methods @@ -317,7 +421,7 @@ Adds a new screen with specified parameters and returns a [ScreenInfo](/api/Pupp Only supported in headless mode. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L101) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L121) @@ -334,7 +438,7 @@ Returns an array of all open [IBrowserContext](/api/PuppeteerSharp/IBrowserConte **Returns:** `IBrowserContext\[\]` — An array of [IBrowserContext](/api/PuppeteerSharp/IBrowserContext/) objects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L95) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L115) @@ -349,7 +453,7 @@ public void ClearCustomQueryHandlers() Clears all registered handlers. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L208) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L228) @@ -366,7 +470,7 @@ Closes Chromium and all of its pages (if any were opened). The browser object it **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L147) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L167) @@ -403,7 +507,7 @@ using(var browser = await Puppeteer.LaunchAsync(new LaunchOptions())) } ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L92) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L112) @@ -420,7 +524,7 @@ Creates a Chrome Devtools Protocol session attached to the browser. **Returns:** [Task<ICDPSession>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that returns a [ICDPSession](/api/PuppeteerSharp/ICDPSession/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L232) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L252) @@ -443,7 +547,7 @@ Removes cookies from the default browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L224) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L244) @@ -466,7 +570,7 @@ Deletes cookies matching the provided filters from the default [IBrowserContext] **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L228) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L248) @@ -481,7 +585,7 @@ public abstract void Disconnect() Disconnects Puppeteer from the browser, but leaves the process running. After calling [Disconnect()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_Disconnect), the browser object is considered disposed and cannot be used anymore. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L144) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L164) @@ -496,7 +600,7 @@ public void Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L241) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L261) @@ -517,7 +621,7 @@ created by Puppeteer. | --- | --- | --- | | `disposing` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates whether disposal was initiated by [Dispose()](#PuppeteerSharp_Browser_Dispose) operation. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L281) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L337) @@ -535,7 +639,7 @@ created by Puppeteer. **Returns:** [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask) — ValueTask. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L252) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L272) @@ -552,7 +656,7 @@ Returns a map of installed extensions, keyed by extension ID. **Returns:** [Task<IReadOnlyDictionary<string, Extension>>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to a dictionary of extension ID to [Extension](/api/PuppeteerSharp/Extension/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L113) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L133) @@ -569,7 +673,7 @@ Gets all cookies in the default browser context. **Returns:** [Task<CookieParam\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to an array of [CookieParam](/api/PuppeteerSharp/CookieParam/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L216) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L236) @@ -596,7 +700,7 @@ registered file handlers. Only available over a pipe connection. See [InstallPWAAsync(InstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_InstallPWAAsync_PuppeteerSharp_InstallPWAOptions_). Meaningful only for an app that is currently installed; querying an unknown manifest id rejects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L125) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L145) @@ -615,7 +719,7 @@ Gets the browser's original user agent. Pages can override browser user agent with `UserAgentMetadata)`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L141) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L161) @@ -634,7 +738,7 @@ Gets the browser's version. the format of [GetVersionAsync()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_GetVersionAsync) might change with future releases of Chromium. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L138) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L158) @@ -657,7 +761,7 @@ Gets the specified window bounds. **Returns:** [Task<WindowBounds>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the [WindowBounds](/api/PuppeteerSharp/WindowBounds/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L235) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L255) @@ -681,7 +785,7 @@ Installs an unpacked extension and returns the extension ID. **Returns:** [Task<string>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to the extension ID. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L107) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L127) @@ -711,7 +815,7 @@ The returned manifest id echoes [ManifestId](/api/PuppeteerSharp/InstallPWAOptio to [LaunchPWAAsync(LaunchPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_LaunchPWAAsync_PuppeteerSharp_LaunchPWAOptions_), [GetPWAStateAsync(GetPWAStateOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_GetPWAStateAsync_PuppeteerSharp_GetPWAStateOptions_), or [UninstallPWAAsync(UninstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_UninstallPWAAsync_PuppeteerSharp_UninstallPWAOptions_). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L116) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L136) @@ -740,7 +844,7 @@ targets through [Targets()](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowse (the app's web contents). If Chromium focuses an existing app window, this returns that window's existing page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L122) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L142) @@ -763,7 +867,7 @@ Creates a new page. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to a new [IPage](/api/PuppeteerSharp/IPage/) object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L86) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L106) @@ -778,7 +882,7 @@ protected void OnClosed() Emits [Closed](#PuppeteerSharp_Browser_Closed) event. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L289) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L345) @@ -793,7 +897,7 @@ protected void OnDisconnected() Emits [Disconnected](#PuppeteerSharp_Browser_Disconnected) event. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L294) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L350) @@ -814,7 +918,7 @@ Emits [TargetChanged](#PuppeteerSharp_Browser_TargetChanged) event. | --- | --- | --- | | `e` | [TargetChangedArgs](/api/PuppeteerSharp/TargetChangedArgs/) | The event arguments. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L300) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L356) @@ -835,7 +939,7 @@ Emits [TargetCreated](#PuppeteerSharp_Browser_TargetCreated) event. | --- | --- | --- | | `e` | [TargetChangedArgs](/api/PuppeteerSharp/TargetChangedArgs/) | The event arguments. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L306) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L362) @@ -856,7 +960,7 @@ Emits [TargetDestroyed](#PuppeteerSharp_Browser_TargetDestroyed) event. | --- | --- | --- | | `e` | [TargetChangedArgs](/api/PuppeteerSharp/TargetChangedArgs/) | The event arguments. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L312) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L368) @@ -877,7 +981,7 @@ Emits [TargetDiscovered](#PuppeteerSharp_Browser_TargetDiscovered) event. | --- | --- | --- | | `e` | [TargetChangedArgs](/api/PuppeteerSharp/TargetChangedArgs/) | The event arguments. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L318) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L374) @@ -902,7 +1006,7 @@ Non visible pages, such as `"background_page"`, will not be listed here. You can **Returns:** [Task<IPage\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to an array of all open pages inside the Browser. In case of multiple browser contexts, the method will return an array with all the pages in all browser contexts. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L132) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L152) @@ -932,7 +1036,7 @@ only allowed to consist of lower- and upper case latin letters. Puppeteer.RegisterCustomQueryHandler("text", "{ … }"); var aHandle = await page.QuerySelectorAsync("text/…"). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L188) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L208) @@ -957,7 +1061,7 @@ Removes the screen associated with the given screen ID, unless it is the primary Only supported in headless mode. Fails if the primary screen ID is specified. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L104) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L124) @@ -986,7 +1090,7 @@ Targets that are already on a blocked URL when this method is called stay attach the blocked page. This differs from launching the browser with network restrictions, where such targets are detached on the initial attach. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L128) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L148) @@ -1003,7 +1107,7 @@ Gets a list of [ScreenInfo](/api/PuppeteerSharp/ScreenInfo/) objects. **Returns:** [Task<ScreenInfo\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A task that resolves to an array of screen information objects. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L98) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L118) @@ -1026,7 +1130,7 @@ Sets cookies in the default browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L220) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L240) @@ -1050,7 +1154,7 @@ Sets the permission for a specific origin on the default browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L212) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L232) @@ -1074,7 +1178,7 @@ Sets the specified window bounds. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that resolves when the bounds have been set. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L238) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L258) @@ -1091,7 +1195,7 @@ Returns An Array of all active targets. **Returns:** `ITarget\[\]` — An Array of all active targets. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L89) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L109) @@ -1114,7 +1218,7 @@ Uninstalls a previously installed extension by its ID. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — A task that completes when the extension is uninstalled. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L110) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L130) @@ -1139,7 +1243,7 @@ Uninstalls a previously installed Progressive Web App (PWA). Only available over a pipe connection. See [InstallPWAAsync(InstallPWAOptions)](/api/PuppeteerSharp/IBrowser/#PuppeteerSharp_IBrowser_InstallPWAAsync_PuppeteerSharp_InstallPWAOptions_). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L119) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L139) @@ -1160,7 +1264,7 @@ Unregister a custom query handler. | --- | --- | --- | | `name` | [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the query handler to unregistered. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L204) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L224) @@ -1195,4 +1299,4 @@ var newWindowTarget = await browserContext.WaitForTargetAsync((target) => target **Returns:** [Task<ITarget>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Resolves to the first target found that matches the predicate function. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L150) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Browser.cs#L170) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserContext.md b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserContext.md index d696d40e7..d70527b5e 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserContext.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserContext.md @@ -44,7 +44,7 @@ public Browser Browser { get; protected init; } **Value:** [Browser](/api/PuppeteerSharp/Browser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L32) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L50) @@ -61,7 +61,7 @@ Browser Context Id. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L26) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L44) @@ -78,10 +78,114 @@ Whether this <a href="IBrowserContext">IBrowserContext</a> is closed **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L29) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L47) ## Events + + +### Console + + +```csharp +public event EventHandler Console +``` + + +Raised when JavaScript within any page or worker in the browser context calls one of the console API methods, e.g. `console.log` or `console.dir`. +Only messages from pages and workers that PuppeteerSharp has attached to are delivered, e.g. via `Targets()`. +Service and shared workers are not attached automatically: their messages are only delivered after `WorkerAsync()` has been called for their target. +With WebDriver BiDi, service and shared worker console messages are not reported. + +**Value:** [EventHandler<ConsoleEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L17) + + + +### Request + + +```csharp +public event EventHandler Request +``` + + +Raised when any page in the browser context issues a request. Contains an [IRequest](/api/PuppeteerSharp/IRequest/) instance. +Use [IPage](/api/PuppeteerSharp/IPage/) or [IFrame](/api/PuppeteerSharp/IFrame/) from the request to identify the originating context. +Events are only delivered for pages that have an [IPage](/api/PuppeteerSharp/IPage/) instance, for example one created via [PagesAsync(bool)](/api/PuppeteerSharp/IBrowserContext/#PuppeteerSharp_IBrowserContext_PagesAsync_System_Boolean_). +These listeners only observe requests. Do not call `Continue`, `Abort` or `Respond` from them. To intercept requests, use [SetRequestInterceptionAsync(bool)](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_SetRequestInterceptionAsync_System_Boolean_) with an [Request](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_Request) listener. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L41) + + + +### RequestFailed + + +```csharp +public event EventHandler RequestFailed +``` + + +Raised when a request issued by any page in the browser context fails, for example by timing out. +HTTP error responses, such as 404 or 503, complete with [RequestFinished](/api/PuppeteerSharp/IBrowserContext/#PuppeteerSharp_IBrowserContext_RequestFinished) instead. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L35) + + + +### RequestFinished + + +```csharp +public event EventHandler RequestFinished +``` + + +Raised when a request issued by any page in the browser context finishes successfully. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L38) + + + +### RequestServedFromCache + + +```csharp +public event EventHandler RequestServedFromCache +``` + + +Raised when a request issued by any page in the browser context is served from the memory cache. + +**Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L29) + + + +### Response + + +```csharp +public event EventHandler Response +``` + + +Raised when a response is received for a request issued by any page in the browser context. +Use [Request](/api/PuppeteerSharp/IResponse/#PuppeteerSharp_IResponse_Request) to access the originating request. + +**Value:** [EventHandler<ResponseCreatedEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L32) + ### TargetChanged @@ -96,7 +200,7 @@ Raised when the url of a target changes **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L17) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L20) @@ -112,7 +216,7 @@ Raised when a target is created, for example when a new page is opened by `windo **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L20) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L23) @@ -128,7 +232,7 @@ Raised when a target is destroyed, for example when a page is closed **Value:** [EventHandler<TargetChangedArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L23) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L26) ## Methods @@ -147,7 +251,7 @@ Clears all permission overrides for the browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L60) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L80) @@ -164,7 +268,7 @@ Closes the browser context. All the targets that belong to the browser context w **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L51) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L71) @@ -187,7 +291,7 @@ Removes cookies from the browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L69) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L89) @@ -210,7 +314,7 @@ Deletes cookies matching the provided filters in this browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L89) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L109) @@ -225,7 +329,7 @@ public void Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L142) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L162) @@ -245,7 +349,7 @@ Closes the browser context. All the targets that belong to the browser context w | --- | --- | --- | | `disposing` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates whether disposal was initiated by [Dispose()](#PuppeteerSharp_BrowserContext_Dispose) operation. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L204) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L236) @@ -262,7 +366,7 @@ Closes the browser context. All the targets that belong to the browser context w **Returns:** [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask) — ValueTask. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L152) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L172) @@ -279,7 +383,7 @@ Gets all cookies in the browser context. **Returns:** [Task<CookieParam\[\]>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to an array of [CookieParam](/api/PuppeteerSharp/CookieParam/). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L63) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L83) @@ -302,7 +406,7 @@ Creates a new page. **Returns:** [Task<IPage>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to a new [IPage](/api/PuppeteerSharp/IPage/) object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L48) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L68) @@ -331,7 +435,7 @@ Overrides the browser context permissions. var context = browser.DefaultBrowserContext; await context.OverridePermissionsAsync("https://html5demos.com", new List<string> {"geolocation"}); -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L54) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L74) @@ -356,7 +460,7 @@ An array of all pages inside the browser context. Non visible pages, such as `"background_page"`, will not be listed here. You can find them using [PageAsync()](/api/PuppeteerSharp/ITarget/#PuppeteerSharp_ITarget_PageAsync). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L45) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L65) @@ -379,7 +483,7 @@ Sets cookies in the browser context. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — Task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L66) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L86) @@ -403,7 +507,7 @@ Sets the permission for a specific origin. **Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) — The task. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L57) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L77) @@ -420,7 +524,7 @@ Gets an array of all active targets inside the browser context. **Returns:** `ITarget\[\]` — An array of all active targets inside the browser context. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L38) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L58) @@ -455,4 +559,4 @@ var newWindowTarget = await browserContext.WaitForTargetAsync((target) => target **Returns:** [Task<ITarget>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Resolves to the first target found that matches the predicate function. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L41) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserContext.cs#L61) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcher.md b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcher.md index 3ce8accc5..74beb65f4 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcher.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcher.md @@ -42,7 +42,7 @@ public BrowserFetcher() Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L29) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L30) @@ -63,7 +63,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services | `options` | [BrowserFetcherOptions](/api/PuppeteerSharp/BrowserFetcherOptions/) | | | `loggerFactory` | [ILoggerFactory](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.iloggerfactory) | | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L44) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L45) @@ -84,7 +84,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services | `browser` | [SupportedBrowser](/api/PuppeteerSharp/SupportedBrowser/) | | | `loggerFactory` | [ILoggerFactory](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.iloggerfactory) | | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L38) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L39) ## Properties @@ -103,7 +103,7 @@ A download host to be used. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L62) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L64) @@ -120,7 +120,7 @@ Gets the browser. **Value:** [SupportedBrowser](/api/PuppeteerSharp/SupportedBrowser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L68) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L70) @@ -137,7 +137,7 @@ Determines the path to download browsers to. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L59) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L61) @@ -154,7 +154,7 @@ Gets the platform. **Value:** [Platform](/api/PuppeteerSharp/Platform/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L65) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L67) @@ -171,7 +171,7 @@ Proxy used by the HttpClient in [DownloadAsync()](/api/PuppeteerSharp/IBrowserFe **Value:** [IWebProxy](https://learn.microsoft.com/dotnet/api/system.net.iwebproxy) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L71) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L73) ## Methods @@ -196,7 +196,7 @@ The method initiates a HEAD request to check if the revision is available. **Returns:** [Task<bool>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Whether the version is available or not. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L74) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L76) @@ -213,7 +213,7 @@ Downloads the revision. **Returns:** [Task<InstalledBrowser>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the completed download. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L100) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L102) @@ -235,7 +235,7 @@ Downloads the revision. **Returns:** [Task<InstalledBrowser>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the completed download. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L114) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L116) @@ -257,7 +257,7 @@ Downloads the revision. **Returns:** [Task<InstalledBrowser>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — Task which resolves to the completed download. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L129) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L131) @@ -280,7 +280,7 @@ Gets the executable path. **Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The executable path. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L142) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L144) @@ -297,7 +297,7 @@ A list of all browsers available locally on disk. **Returns:** [IEnumerable<InstalledBrowser>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) — The available browsers. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L121) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L123) @@ -318,4 +318,4 @@ Removes a downloaded browser. | --- | --- | --- | | `buildId` | [string](https://learn.microsoft.com/dotnet/api/system.string) | Browser to remove. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L125) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcher.cs#L127) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcherOptions.md b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcherOptions.md index 27f4f466f..d0d782a16 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcherOptions.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/BrowserFetcherOptions.md @@ -59,7 +59,7 @@ Gets the default or a custom download delegate. **Value:** [BrowserFetcherOptions.CustomFileDownloadAction](/api/PuppeteerSharp/BrowserFetcherOptions.CustomFileDownloadAction/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcherOptions.cs#L41) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcherOptions.cs#L47) @@ -111,3 +111,21 @@ Platform. Defaults to current platform. **Value:** `Platform?` [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcherOptions.cs#L26) + + + + +### SkipChromeHeadlessShellDownload + + +```csharp +public bool SkipChromeHeadlessShellDownload { get; set; } +``` + + +Whether to skip downloading Chrome Headless Shell when downloading Chrome. Defaults to false. +Mirrors upstream's `skipChromeHeadlessShellDownload` configuration. + +**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/BrowserFetcherOptions.cs#L42) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/ChromeLauncher.md b/docs-site/src/content/docs/api/PuppeteerSharp/ChromeLauncher.md index e4fabf7d5..9d04ff0d7 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/ChromeLauncher.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/ChromeLauncher.md @@ -73,7 +73,7 @@ Disposes Base process and any temporary user directory. | --- | --- | --- | | `disposing` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Indicates whether disposal was initiated by [Dispose()](/api/PuppeteerSharp/LauncherBase/#PuppeteerSharp_LauncherBase_Dispose) operation. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ChromeLauncher.cs#L211) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ChromeLauncher.cs#L210) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/ConnectOptions.md b/docs-site/src/content/docs/api/PuppeteerSharp/ConnectOptions.md index e621a4791..16dbae463 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/ConnectOptions.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/ConnectOptions.md @@ -90,7 +90,7 @@ Cannot be used along with [BlockList](#PuppeteerSharp_ConnectOptions_BlockList). Pattern to allow a specific domain: `*://example.com/*` Pattern to allow all subdomains: `*://*.example.com/*`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L183) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L189) @@ -132,7 +132,7 @@ Cannot be used along with [Allowlist](#PuppeteerSharp_ConnectOptions_Allowlist). Pattern to block a specific domain: `*://example.com/*` Pattern to block all subdomains: `*://*.evil.com/*`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L149) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L155) @@ -186,6 +186,23 @@ Gets or sets the default Viewport. [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L68) + + + +### DownloadBehavior + + +```csharp +public DownloadBehavior DownloadBehavior { get; set; } +``` + + +Gets or sets the download behavior applied to the default browser context. + +**Value:** [DownloadBehavior](/api/PuppeteerSharp/DownloadBehavior/) — The download behavior. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L74) + @@ -207,7 +224,7 @@ This should normally be set to `true` to support applications that aren't `async has legacy code that is not async which makes calls into PuppeteerSharp. If you experience issues, or your application is not mixed sync/async use, you can set this to `false` (default). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L94) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L100) @@ -227,7 +244,7 @@ If not [PuppeteerSharp.Transport](/api/PuppeteerSharp.Transport/) is set this wi It's set to `true` by default because it's the safest way to send commands to Chromium. Setting this to `false` proved to work in .NET Core but it tends to fail on .NET Framework. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L82) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L88) @@ -244,7 +261,7 @@ Whether to handle the DevTools windows as pages in Puppeteer. Supported only in **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L112) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L118) @@ -283,7 +300,7 @@ Optional callback to initialize properties as soon as the [IBrowser](/api/Puppet **Value:** [Action<IBrowser>](https://learn.microsoft.com/dotnet/api/system.action-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L107) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L113) @@ -338,7 +355,7 @@ Firefox always uses WebDriver BiDi regardless of this setting. **Value:** [ProtocolType](/api/PuppeteerSharp/ProtocolType/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L119) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L125) @@ -356,7 +373,7 @@ Defaults to 180_000. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L102) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L108) @@ -390,7 +407,7 @@ Callback to decide if Puppeteer should connect to a given target or not. **Value:** [Func<Target, bool>](https://learn.microsoft.com/dotnet/api/system.func-2) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L99) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L105) @@ -407,7 +424,7 @@ Optional factory for [IConnectionTransport](/api/PuppeteerSharp.Transport/IConne **Value:** [TransportFactory](/api/PuppeteerSharp.Transport/TransportFactory/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L73) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConnectOptions.cs#L79) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessage.md b/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessage.md index 8b0d8be1d..84acd68fc 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessage.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessage.md @@ -28,13 +28,13 @@ ConsoleMessage is part of [ConsoleEventArgs](/api/PuppeteerSharp/ConsoleEventArg ## Constructors - + -### `ConsoleMessage(ConsoleType, string, IList, ConsoleMessageLocation, IList)` +### `ConsoleMessage(ConsoleType, string, IList, ConsoleMessageLocation, IList, IFrame, WebWorker)` ```csharp -public ConsoleMessage(ConsoleType type, string text, IList args, ConsoleMessageLocation location = null, IList stackTrace = null) +public ConsoleMessage(ConsoleType type, string text, IList args, ConsoleMessageLocation location = null, IList stackTrace = null, IFrame frame = null, WebWorker worker = null) ``` @@ -49,8 +49,10 @@ Initializes a new instance of the [ConsoleMessage](./) class. | `args` | [IList<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) | Arguments. | | `location` | [ConsoleMessageLocation](/api/PuppeteerSharp/ConsoleMessageLocation/) | Message location. | | `stackTrace` | [IList<ConsoleMessageLocation>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) | Stack trace. | +| `frame` | [IFrame](/api/PuppeteerSharp/IFrame/) | The frame that initiated the message, if it originated from a frame. | +| `worker` | [WebWorker](/api/PuppeteerSharp/WebWorker/) | The worker that initiated the message, if it originated from a worker. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L18) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L20) ## Properties @@ -69,7 +71,25 @@ Gets the arguments. **Value:** [IList<IJSHandle>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) — The arguments. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L43) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L54) + + + + +### Frame + + +```csharp +public IFrame Frame { get; } +``` + + +Gets the [IFrame](/api/PuppeteerSharp/IFrame/) that initiated the console message, or `null` if the +message originated from a worker. + +**Value:** [IFrame](/api/PuppeteerSharp/IFrame/) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L76) @@ -86,7 +106,25 @@ Gets the location. **Value:** [ConsoleMessageLocation](/api/PuppeteerSharp/ConsoleMessageLocation/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L48) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L59) + + + + +### Page + + +```csharp +public IPage Page { get; } +``` + + +Gets the [IPage](/api/PuppeteerSharp/IPage/) that the console message originated from, or `null` if the +message originated from a worker or outside of a frame context. + +**Value:** [IPage](/api/PuppeteerSharp/IPage/) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L70) @@ -103,7 +141,7 @@ Gets the stack trace. **Value:** [IList<ConsoleMessageLocation>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L53) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L64) @@ -120,7 +158,7 @@ Gets the console text. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The text. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L37) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L48) @@ -137,4 +175,22 @@ Gets the ConsoleMessage type. **Value:** [ConsoleType](/api/PuppeteerSharp/ConsoleType/) — ConsoleMessageType. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L31) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L42) + + + + +### Worker + + +```csharp +public WebWorker Worker { get; } +``` + + +Gets the [WebWorker](/api/PuppeteerSharp/WebWorker/) that initiated the console message, or `null` if the +message originated from a frame. + +**Value:** [WebWorker](/api/PuppeteerSharp/WebWorker/) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessage.cs#L82) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessageLocation.md b/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessageLocation.md index 1f4d548d1..ad457fbfe 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessageLocation.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/ConsoleMessageLocation.md @@ -80,6 +80,23 @@ public int? LineNumber { get; set; } [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L19) + + + +### ScriptId + + +```csharp +public string ScriptId { get; set; } +``` + + +Script identifier if known. + +**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L34) + @@ -120,7 +137,7 @@ Indicates whether the current object is equal to another object of the same type **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the current object is equal to the <code class="paramref">other</code> parameter; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L46) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L51) @@ -142,7 +159,7 @@ Determines whether the specified object is equal to the current object. **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if the specified object is equal to the current object; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L50) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L55) @@ -159,7 +176,7 @@ Serves as the default hash function. **Returns:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — A hash code for the current object. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L53) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L58) ## Operators @@ -185,7 +202,7 @@ Overriding == operator for [ConsoleMessageLocation](./). **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — `true` if the two instances are equal to the same value. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L35) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L40) @@ -209,4 +226,4 @@ Overriding != operator for [ConsoleMessageLocation](./). **Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — `true` if the two instances are not equal to the same value. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L42) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/ConsoleMessageLocation.cs#L47) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/IResponse.md b/docs-site/src/content/docs/api/PuppeteerSharp/IResponse.md index 6b33e6fa9..685ca8f50 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/IResponse.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/IResponse.md @@ -23,4 +23,4 @@ public interface IResponse **Derived:** [BidiHttpResponse](/api/PuppeteerSharp.Bidi/BidiHttpResponse/), [CdpHttpResponse](/api/PuppeteerSharp.Cdp/CdpHttpResponse/), [Response<TRequest>](/api/PuppeteerSharp/Response-1/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/IResponse.cs#L17) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/IResponse.cs#L18) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/LaunchOptions.md b/docs-site/src/content/docs/api/PuppeteerSharp/LaunchOptions.md index 3c1da558b..c0faaa591 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/LaunchOptions.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/LaunchOptions.md @@ -86,7 +86,7 @@ Cannot be used along with [BlockList](#PuppeteerSharp_LaunchOptions_BlockList). Pattern to allow a specific domain: `*://example.com/*` Pattern to allow all subdomains: `*://*.example.com/*`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L320) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L326) @@ -141,7 +141,7 @@ Cannot be used along with [Allowlist](#PuppeteerSharp_LaunchOptions_Allowlist). Pattern to block a specific domain: `*://example.com/*` Pattern to block all subdomains: `*://*.evil.com/*`. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L290) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L296) @@ -158,7 +158,7 @@ The browser to be used (Chrome, Chromium, Firefox). **Value:** [SupportedBrowser](/api/PuppeteerSharp/SupportedBrowser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L198) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L204) @@ -211,6 +211,23 @@ Whether to auto-open DevTools panel for each tab. If this option is true, the he [View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L81) + + + +### DownloadBehavior + + +```csharp +public DownloadBehavior DownloadBehavior { get; set; } +``` + + +Gets or sets the download behavior applied to the default browser context. + +**Value:** [DownloadBehavior](/api/PuppeteerSharp/DownloadBehavior/) — The download behavior. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L190) + @@ -250,7 +267,7 @@ load the provided paths as unpacked extensions. <p>Passing a `string[]` is only supported with Firefox (BiDi) at this time.</p> <p>In Firefox, there is no known command line flag to disable addons so they are always enabled.</p> -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L241) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L247) @@ -273,7 +290,7 @@ This should normally be set to `true` to support applications that aren't `async has legacy code that is not async which makes calls into PuppeteerSharp. If you experience issues, or your application is not mixed sync/async use, you can set this to `false` (default). -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L210) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L216) @@ -293,7 +310,7 @@ If not [PuppeteerSharp.Transport](/api/PuppeteerSharp.Transport/) is set this wi It's set to `true` by default because it's the safest way to send commands to Chromium. Setting this to `false` proved to work in .NET Core, but it tends to fail on .NET Framework. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L193) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L199) @@ -344,7 +361,7 @@ Gets or sets the list of extension paths that will be enabled in Incognito and o **Value:** [string\[\]](https://learn.microsoft.com/dotnet/api/system.string) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L246) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L252) @@ -361,7 +378,7 @@ Additional preferences that can be passed when launching with Firefox. <see f **Value:** [Dictionary<string, object>](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L223) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L229) @@ -378,7 +395,7 @@ Whether to handle the DevTools windows as pages in Puppeteer. Supported only in **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L251) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L257) @@ -548,7 +565,7 @@ Only supported for Chrome/Chromium with CDP protocol. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L257) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L263) @@ -567,7 +584,7 @@ Firefox always uses WebDriver BiDi regardless of this setting. **Value:** [ProtocolType](/api/PuppeteerSharp/ProtocolType/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L264) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L270) @@ -585,7 +602,7 @@ Defaults to 180_000. **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L218) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L224) @@ -619,7 +636,7 @@ Callback to decide if Puppeteer should connect to a given target or not. **Value:** [Func<Target, bool>](https://learn.microsoft.com/dotnet/api/system.func-2) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L215) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L221) @@ -687,7 +704,7 @@ Wait for the initial page before initializing. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L228) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/LaunchOptions.cs#L234) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/Launcher.md b/docs-site/src/content/docs/api/PuppeteerSharp/Launcher.md index ad8bb9ff5..b9bb19403 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/Launcher.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/Launcher.md @@ -90,7 +90,7 @@ Attaches Puppeteer to an existing process instance. The browser will be closed w **Returns:** [Task<IBrowser>](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1) — A connected browser. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Launcher.cs#L264) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Launcher.cs#L265) diff --git a/docs-site/src/content/docs/api/PuppeteerSharp/Page.md b/docs-site/src/content/docs/api/PuppeteerSharp/Page.md index 8fba714d0..f1442fac3 100644 --- a/docs-site/src/content/docs/api/PuppeteerSharp/Page.md +++ b/docs-site/src/content/docs/api/PuppeteerSharp/Page.md @@ -64,7 +64,7 @@ Browser. **Value:** [Browser](/api/PuppeteerSharp/Browser/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L255) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L267) @@ -81,7 +81,7 @@ Get the browser context that the page belongs to. **Value:** [IBrowserContext](/api/PuppeteerSharp/IBrowserContext/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L202) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L207) @@ -98,7 +98,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Value:** [CDPSession](/api/PuppeteerSharp/CDPSession/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L132) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L137) @@ -122,7 +122,7 @@ This setting will change the default maximum time for the following methods: **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L135) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L140) @@ -150,7 +150,7 @@ This setting will change the default maximum times for the following methods: **Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L142) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L147) @@ -167,24 +167,7 @@ Gets all frames attached to the page. **Value:** `IFrame\[\]` — An array of all frames attached to the page. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L152) - - - - -### HasConsoleEventListeners - - -```csharp -protected bool HasConsoleEventListeners { get; } -``` - - -Whether the [Console](#PuppeteerSharp_Page_Console) event has listeners. - -**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L250) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L157) @@ -201,7 +184,7 @@ Get an indication that the page has been closed. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L207) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L212) @@ -218,7 +201,7 @@ public bool IsDragInterceptionEnabled { get; protected set; } **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L223) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L228) @@ -235,7 +218,7 @@ If the page has JavaScript enabled. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L215) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L220) @@ -252,7 +235,7 @@ public bool IsServiceWorkerBypassed { get; protected set; } **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L166) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L171) @@ -271,7 +254,7 @@ Gets page's main frame. Page is guaranteed to have a main frame which persists during navigations. -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L149) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L154) @@ -288,7 +271,7 @@ Whether burst mode is on. **Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L260) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L272) @@ -305,7 +288,7 @@ Screenshot burst mode options. **Value:** [ScreenshotOptions](/api/PuppeteerSharp/ScreenshotOptions/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L265) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L277) @@ -322,7 +305,7 @@ Supports all classes in the .NET class hierarchy and provides low-level services **Value:** [Target](/api/PuppeteerSharp/Target/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L175) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L180) @@ -339,7 +322,7 @@ Timeout settings. **Value:** [TimeoutSettings](/api/PuppeteerSharp/TimeoutSettings/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L220) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L225) @@ -356,7 +339,7 @@ Shortcut for `page.MainFrame.Url`. **Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L169) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L174) @@ -373,7 +356,7 @@ Gets this page's viewport. **Value:** [ViewPortOptions](/api/PuppeteerSharp/ViewPortOptions/) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L196) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L201) @@ -398,7 +381,7 @@ Only supported with CDP protocol. | --- | --- | | [PuppeteerException](/api/PuppeteerSharp/PuppeteerException/) | Thrown when not supported by the current browser/protocol. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L163) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L168) @@ -415,7 +398,7 @@ Gets all workers in the page. **Value:** `WebWorker\[\]` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L155) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L160) ## Events @@ -433,7 +416,7 @@ Raised when the page closes. **Value:** [EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L123) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L128) @@ -465,7 +448,7 @@ page.Console += (sender, e) => } ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L84) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L86) @@ -481,7 +464,7 @@ Raised when the JavaScript `DOMContentLoaded` <a href="https://developer.mozi **Value:** [EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L81) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L83) @@ -497,7 +480,7 @@ Raised when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or **Value:** [EventHandler<DialogEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L78) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L80) @@ -513,7 +496,27 @@ Raised when the page crashes **Value:** [EventHandler<ErrorEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L72) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L74) + + + +### ExceptionThrown + + +```csharp +public event EventHandler ExceptionThrown +``` + + +Raised when an uncaught exception happens within the page or one of its dedicated workers. +Contains a [RemoteException](/api/PuppeteerSharp/RemoteException/). This is the successor of [PageError](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_PageError). + +**Value:** [EventHandler<RemoteExceptionEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) + +The [Handle](/api/PuppeteerSharp/RemoteException/#PuppeteerSharp_RemoteException_Handle) of the exception is disposed right after the event has been +dispatched. Call [Move()](/api/PuppeteerSharp/IJSHandle/#PuppeteerSharp_IJSHandle_Move) on it synchronously inside the handler to keep it alive. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L119) @@ -529,7 +532,7 @@ Raised when a frame is attached. **Value:** [EventHandler<FrameEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L87) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L89) @@ -545,7 +548,7 @@ Raised when a frame is detached. **Value:** [EventHandler<FrameEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L90) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L92) @@ -561,7 +564,7 @@ Raised when a frame is navigated to a new url. **Value:** [EventHandler<FrameNavigatedEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L93) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L95) @@ -577,7 +580,7 @@ Raised when a DevTools issue is reported. **Value:** [EventHandler<IssueEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L111) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L113) @@ -593,7 +596,7 @@ Raised when the JavaScript `load` <a href="https://developer.mozilla.org/en-U **Value:** [EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L69) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L71) @@ -609,7 +612,7 @@ Raised when the JavaScript code makes a call to `console.timeStamp`. For the lis **Value:** [EventHandler<MetricEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L75) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L77) @@ -625,7 +628,10 @@ Raised when an uncaught exception happens within the page. **Value:** [EventHandler<PageErrorEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L114) +Prefer [ExceptionThrown](/api/PuppeteerSharp/IPage/#PuppeteerSharp_IPage_ExceptionThrown), which exposes the exception as a [RemoteException](/api/PuppeteerSharp/RemoteException/) +(text, name, stack trace, location and a live handle to the thrown value) instead of a reconstructed error. + +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L116) @@ -641,7 +647,7 @@ Raised when the page opens a new tab or window. **Value:** [EventHandler<PopupEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L126) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L131) @@ -658,7 +664,7 @@ In order to intercept and mutate requests, see [SetRequestInterceptionAsync(bool **Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L99) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L101) @@ -674,7 +680,7 @@ Raised when a request fails, for example by timing out. **Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L105) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L107) @@ -690,7 +696,7 @@ Raised when a request finishes successfully. **Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L102) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L104) @@ -706,7 +712,7 @@ Raised when a request ended up loading from cache. **Value:** [EventHandler<RequestEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L108) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L110) @@ -743,7 +749,7 @@ await Task.WhenAll( Console.WriteLine(await tcs.Task); ``` -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L96) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L98) @@ -759,7 +765,7 @@ Emitted when a dedicated WebWorker (<a href="https://developer.mozilla.org/en **Value:** [EventHandler<WorkerEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L117) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L122) @@ -775,7 +781,7 @@ Emitted when a dedicated WebWorker (<a href="https://developer.mozilla.org/en **Value:** [EventHandler<WorkerEventArgs>](https://learn.microsoft.com/dotnet/api/system.eventhandler-1) -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L120) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L125) ## Methods @@ -800,7 +806,7 @@ The interception is resolved to the highest-priority resolution. | --- | --- | --- | | `interceptionTask` | [Func<IRequest, Task>](https://learn.microsoft.com/dotnet/api/system.func-2) | Interception task. | -[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L1126) +[View source](https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Page.cs#L1138) @@ -825,7 +831,7 @@ Adds a `