From 77b598110fe6ba786e0ea62792ade9ceb95cbf86 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Fri, 10 Feb 2023 15:14:28 -0800 Subject: [PATCH] fix(docs): inline java, js and csharp overrides (#20833) This fixes the order of arguments as well as many incorrect arguments around `WaitFor()` methods. --- docs/src/api/class-browsercontext.md | 6 ++ docs/src/api/class-electronapplication.md | 6 ++ docs/src/api/class-elementhandle.md | 6 ++ docs/src/api/class-frame.md | 21 ++++ docs/src/api/class-jshandle.md | 6 ++ docs/src/api/class-locator.md | 9 ++ docs/src/api/class-page.md | 116 +++++++++++++++++++++ docs/src/api/class-playwright.md | 29 ++++++ docs/src/api/class-request.md | 16 +++ docs/src/api/class-response.md | 5 + docs/src/api/class-websocket.md | 6 ++ docs/src/api/class-worker.md | 9 ++ docs/src/api/csharp.md | 30 ------ docs/src/api/java.md | 119 ---------------------- docs/src/api/javascript.md | 53 ---------- docs/src/api/params.md | 4 +- 16 files changed, 237 insertions(+), 204 deletions(-) delete mode 100644 docs/src/api/csharp.md delete mode 100644 docs/src/api/java.md delete mode 100644 docs/src/api/javascript.md diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 4c72fd83fc..bb7a6c8aa2 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -1395,6 +1395,12 @@ Will throw an error if the context closes before new [Page] is created. * langs: python - returns: <[EventContextManager]<[Page]>> +### param: BrowserContext.waitForPage.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: BrowserContext.waitForPage.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: BrowserContext.waitForPage.predicate * since: v1.9 * langs: csharp, java, python diff --git a/docs/src/api/class-electronapplication.md b/docs/src/api/class-electronapplication.md index c6f3ad38a0..6881bfee83 100644 --- a/docs/src/api/class-electronapplication.md +++ b/docs/src/api/class-electronapplication.md @@ -87,6 +87,9 @@ some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infini ### param: ElectronApplication.evaluate.expression = %%-evaluate-expression-%% * since: v1.9 +### param: ElectronApplication.evaluate.expression = %%-js-electron-evaluate-workerfunction-%% +* since: v1.9 + ### param: ElectronApplication.evaluate.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -107,6 +110,9 @@ If the function passed to the [`method: ElectronApplication.evaluateHandle`] ret ### param: ElectronApplication.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.9 +### param: ElectronApplication.evaluateHandle.expression = %%-js-electron-evaluate-workerfunction-%% +* since: v1.9 + ### param: ElectronApplication.evaluateHandle.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index 403bb63e86..3d23e618d8 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -422,6 +422,9 @@ Assert.AreEqual("10", await tweetHandle.EvalOnSelectorAsync(".retweets", "node = ### param: ElementHandle.evalOnSelector.expression = %%-evaluate-expression-%% * since: v1.9 +### param: ElementHandle.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% +* since: v1.9 + ### param: ElementHandle.evalOnSelector.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -483,6 +486,9 @@ Assert.AreEqual(new [] { "Hello!", "Hi!" }, await feedHandle.EvalOnSelectorAllAs ### param: ElementHandle.evalOnSelectorAll.expression = %%-evaluate-expression-%% * since: v1.9 +### param: ElementHandle.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% +* since: v1.9 + ### param: ElementHandle.evalOnSelectorAll.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index e5be5dc965..2c7e5ace47 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -523,6 +523,9 @@ var html = await frame.EvalOnSelectorAsync(".main-container", "(e, suffix) => e. ### param: Frame.evalOnSelector.expression = %%-evaluate-expression-%% * since: v1.9 +### param: Frame.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% +* since: v1.9 + ### param: Frame.evalOnSelector.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -577,6 +580,9 @@ var divsCount = await frame.EvalOnSelectorAllAsync("div", "(divs, min) => ### param: Frame.evalOnSelectorAll.expression = %%-evaluate-expression-%% * since: v1.9 +### param: Frame.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% +* since: v1.9 + ### param: Frame.evalOnSelectorAll.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -688,6 +694,9 @@ await bodyHandle.DisposeAsync(); ### param: Frame.evaluate.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Frame.evaluate.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Frame.evaluate.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -795,6 +804,9 @@ await resultHandle.DisposeAsync(); ### param: Frame.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Frame.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Frame.evaluateHandle.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -1864,6 +1876,9 @@ await page.MainFrame.WaitForFunctionAsync("selector => !!document.querySelector( ### param: Frame.waitForFunction.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Frame.waitForFunction.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Frame.waitForFunction.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -1983,6 +1998,12 @@ a navigation. * langs: python - returns: <[EventContextManager]<[Response]>> +### param: Frame.waitForNavigation.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Frame.waitForNavigation.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Frame.waitForNavigation.url = %%-wait-for-navigation-url-%% * since: v1.8 diff --git a/docs/src/api/class-jshandle.md b/docs/src/api/class-jshandle.md index f3bc9b19a1..4229f739cc 100644 --- a/docs/src/api/class-jshandle.md +++ b/docs/src/api/class-jshandle.md @@ -87,6 +87,9 @@ Assert.AreEqual("10 retweets", await tweetHandle.EvaluateAsync("node => node.inn ### param: JSHandle.evaluate.expression = %%-evaluate-expression-%% * since: v1.8 +### param: JSHandle.evaluate.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: JSHandle.evaluate.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -111,6 +114,9 @@ See [`method: Page.evaluateHandle`] for more details. ### param: JSHandle.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.8 +### param: JSHandle.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: JSHandle.evaluateHandle.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 9c2e64492b..176011a1b5 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -702,6 +702,9 @@ Assert.AreEqual("10 retweets", await tweets.EvaluateAsync("node => node.innerTex ### param: Locator.evaluate.expression = %%-evaluate-expression-%% * since: v1.14 +### param: Locator.evaluate.expression = %%-js-evaluate-pagefunction-%% +* since: v1.14 + ### param: Locator.evaluate.arg * since: v1.14 - `arg` ?<[EvaluationArgument]> @@ -755,6 +758,9 @@ var moreThanTen = await locator.EvaluateAllAsync("(divs, min) => divs.leng ### param: Locator.evaluateAll.expression = %%-evaluate-expression-%% * since: v1.14 +### param: Locator.evaluateAll.expression = %%-js-evaluate-pagefunction-%% +* since: v1.14 + ### param: Locator.evaluateAll.arg * since: v1.14 - `arg` ?<[EvaluationArgument]> @@ -782,6 +788,9 @@ See [`method: Page.evaluateHandle`] for more details. ### param: Locator.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.14 +### param: Locator.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% +* since: v1.14 + ### param: Locator.evaluateHandle.arg * since: v1.14 - `arg` ?<[EvaluationArgument]> diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index 98b4341d83..6e40e4c0ab 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -1342,6 +1342,9 @@ var html = await page.EvalOnSelectorAsync(".main-container", "(e, suffix) => e.o ### param: Page.evalOnSelector.expression = %%-evaluate-expression-%% * since: v1.9 +### param: Page.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% +* since: v1.9 + ### param: Page.evalOnSelector.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -1394,6 +1397,9 @@ var divsCount = await page.EvalOnSelectorAllAsync("div", "(divs, min) => d ### param: Page.evalOnSelectorAll.expression = %%-evaluate-expression-%% * since: v1.9 +### param: Page.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% +* since: v1.9 + ### param: Page.evalOnSelectorAll.arg * since: v1.9 - `arg` ?<[EvaluationArgument]> @@ -1509,6 +1515,9 @@ await bodyHandle.DisposeAsync(); ### param: Page.evaluate.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Page.evaluate.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Page.evaluate.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -1615,6 +1624,9 @@ await resultHandle.DisposeAsync(); ### param: Page.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Page.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Page.evaluateHandle.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -2625,6 +2637,50 @@ The page's main frame. Page is guaranteed to have a main frame which persists du * since: v1.8 - type: <[Mouse]> +## method: Page.onceDialog +* since: v1.10 +* langs: java + +Adds one-off [Dialog] handler. The handler will be removed immediately after next [Dialog] is created. +```java +page.onceDialog(dialog -> { + dialog.accept("foo"); +}); + +// prints 'foo' +System.out.println(page.evaluate("prompt('Enter string:')")); + +// prints 'null' as the dialog will be auto-dismissed because there are no handlers. +System.out.println(page.evaluate("prompt('Enter string:')")); +``` + +This code above is equivalent to: +```java +Consumer handler = new Consumer() { + @Override + public void accept(Dialog dialog) { + dialog.accept("foo"); + page.offDialog(this); + } +}; +page.onDialog(handler); + +// prints 'foo' +System.out.println(page.evaluate("prompt('Enter string:')")); + +// prints 'null' as the dialog will be auto-dismissed because there are no handlers. +System.out.println(page.evaluate("prompt('Enter string:')")); +``` + +### param: Page.onceDialog.handler +* since: v1.10 +- `handler` <[function]\([Dialog]\)> + +Receives the [Dialog] object, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise +the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, +and actions like click will never finish. + + ## async method: Page.opener * since: v1.8 - returns: <[null]|[Page]> @@ -3742,6 +3798,9 @@ Video object associated with this page. Performs action and waits for the Page to close. +### param: Page.waitForClose.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForClose.timeout = %%-wait-for-event-timeout-%% * since: v1.9 @@ -3761,6 +3820,12 @@ Will throw an error if the page is closed before the [`event: Page.console`] eve * langs: python - returns: <[EventContextManager]<[ConsoleMessage]>> +### param: Page.waitForConsoleMessage.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForConsoleMessage.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForConsoleMessage.predicate * since: v1.9 - `predicate` <[function]\([ConsoleMessage]\):[boolean]> @@ -3786,6 +3851,12 @@ Will throw an error if the page is closed before the download event is fired. * langs: python - returns: <[EventContextManager]<[Download]>> +### param: Page.waitForDownload.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForDownload.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForDownload.predicate * since: v1.9 - `predicate` <[function]\([Download]\):[boolean]> @@ -3865,6 +3936,12 @@ Will throw an error if the page is closed before the file chooser is opened. * langs: python - returns: <[EventContextManager]<[FileChooser]>> +### param: Page.waitForFileChooser.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForFileChooser.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForFileChooser.predicate * since: v1.9 - `predicate` <[function]\([FileChooser]\):[boolean]> @@ -3994,6 +4071,9 @@ await page.WaitForFunctionAsync("selector => !!document.querySelector(selector)" ### param: Page.waitForFunction.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Page.waitForFunction.expression = %%-js-evaluate-pagefunction-%% +* since: v1.8 + ### param: Page.waitForFunction.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -4162,6 +4242,12 @@ a navigation. * langs: python - returns: <[EventContextManager]<[Response]>> +### param: Page.waitForNavigation.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForNavigation.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForNavigation.url = %%-wait-for-navigation-url-%% * since: v1.8 @@ -4187,6 +4273,12 @@ Will throw an error if the page is closed before the popup event is fired. * langs: python - returns: <[EventContextManager]<[Page]>> +### param: Page.waitForPopup.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForPopup.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForPopup.predicate * since: v1.9 - `predicate` <[function]\([Page]\):[boolean]> @@ -4277,6 +4369,9 @@ await page.RunAndWaitForRequestAsync(async () => ### param: Page.waitForRequest.action = %%-csharp-wait-for-event-action-%% * since: v1.12 +### param: Page.waitForRequest.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### param: Page.waitForRequest.urlOrPredicate * since: v1.8 - `urlOrPredicate` <[string]|[RegExp]|[function]\([Request]\):[boolean]> @@ -4315,6 +4410,12 @@ Will throw an error if the page is closed before the [`event: Page.requestFinish * langs: python - returns: <[EventContextManager]<[Request]>> +### param: Page.waitForRequestFinished.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForRequestFinished.callback = %%-java-wait-for-event-callback-%% +* since: v1.12 + ### option: Page.waitForRequestFinished.predicate * since: v1.12 - `predicate` <[function]\([Request]\):[boolean]> @@ -4409,6 +4510,9 @@ await page.RunAndWaitForResponseAsync(async () => ### param: Page.waitForResponse.action = %%-csharp-wait-for-event-action-%% * since: v1.12 +### param: Page.waitForResponse.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### param: Page.waitForResponse.urlOrPredicate * since: v1.8 - `urlOrPredicate` <[string]|[RegExp]|[function]\([Response]\):[boolean]> @@ -4661,6 +4765,12 @@ Will throw an error if the page is closed before the WebSocket event is fired. * langs: python - returns: <[EventContextManager]<[WebSocket]>> +### param: Page.waitForWebSocket.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForWebSocket.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForWebSocket.predicate * since: v1.9 - `predicate` <[function]\([WebSocket]\):[boolean]> @@ -4686,6 +4796,12 @@ Will throw an error if the page is closed before the worker event is fired. * langs: python - returns: <[EventContextManager]<[Worker]>> +### param: Page.waitForWorker.action = %%-csharp-wait-for-event-action-%% +* since: v1.12 + +### param: Page.waitForWorker.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Page.waitForWorker.predicate * since: v1.9 - `predicate` <[function]\([Worker]\):[boolean]> diff --git a/docs/src/api/class-playwright.md b/docs/src/api/class-playwright.md index fff291cb08..e349f32f0b 100644 --- a/docs/src/api/class-playwright.md +++ b/docs/src/api/class-playwright.md @@ -241,6 +241,35 @@ Selectors can be used to install custom selector engines. See This object can be used to launch or connect to WebKit, returning instances of [Browser]. +## method: Playwright.close +* since: v1.9 +* langs: java + +Terminates this instance of Playwright, will also close all created browsers if they are still running. + +## method: Playwright.create +* since: v1.10 +* langs: java +- returns: <[Playwright]> + +Launches new Playwright driver process and connects to it. [`method: Playwright.close`] should be called when the instance is no longer needed. + +```java +Playwright playwright = Playwright.create(); +Browser browser = playwright.webkit().launch(); +Page page = browser.newPage(); +page.navigate("https://www.w3.org/"); +playwright.close(); +``` + +### option: Playwright.create.env +* since: v1.13 +* langs: java +- `env` <[Object]<[string], [string]>> + +Additional environment variables that will be passed to the driver process. By default driver +process inherits environment variables of the Playwright process. + ## async method: Playwright.stop * since: v1.8 * langs: python diff --git a/docs/src/api/class-request.md b/docs/src/api/class-request.md index b55b6e014c..cd52ffd3a2 100644 --- a/docs/src/api/class-request.md +++ b/docs/src/api/class-request.md @@ -56,6 +56,12 @@ page.RequestFailed += (_, request) => }; ``` +## method: Request.failure +* since: v1.8 +* langs: js +- returns: <[null]|[Object]> + - `errorText` <[string]> Human-readable error message, e.g. `'net::ERR_FAILED'`. + ## method: Request.frame * since: v1.8 - returns: <[Frame]> @@ -125,6 +131,16 @@ Returns parsed request's body for `form-urlencoded` and JSON as a fallback if an When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned. Otherwise it will be parsed as JSON. +## method: Request.postDataJSON +* since: v1.12 +* langs: csharp +- returns: <[null]|[JsonElement]> + +Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any. + +When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned. +Otherwise it will be parsed as JSON. + ## method: Request.redirectedFrom * since: v1.8 - returns: <[null]|[Request]> diff --git a/docs/src/api/class-response.md b/docs/src/api/class-response.md index e463f7f3e5..13ff68b85b 100644 --- a/docs/src/api/class-response.md +++ b/docs/src/api/class-response.md @@ -21,6 +21,11 @@ Returns the buffer with response body. Waits for this response to finish, returns always `null`. +## async method: Response.finished +* since: v1.8 +* langs: js +- returns: <[null]|[Error]> + ## method: Response.frame * since: v1.8 - returns: <[Frame]> diff --git a/docs/src/api/class-websocket.md b/docs/src/api/class-websocket.md index d0fa493b7e..7d9442ff20 100644 --- a/docs/src/api/class-websocket.md +++ b/docs/src/api/class-websocket.md @@ -95,6 +95,9 @@ Performs action and waits for a frame to be sent. If predicate is provided, it p [WebSocketFrame] value into the `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value. Will throw an error if the WebSocket or Page is closed before the frame is received. +### param: WebSocket.waitForFrameReceived.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: WebSocket.waitForFrameReceived.predicate * since: v1.9 - `predicate` <[function]\([WebSocketFrame]\):[boolean]> @@ -113,6 +116,9 @@ Performs action and waits for a frame to be sent. If predicate is provided, it p [WebSocketFrame] value into the `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value. Will throw an error if the WebSocket or Page is closed before the frame is sent. +### param: WebSocket.waitForFrameSent.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: WebSocket.waitForFrameSent.predicate * since: v1.9 - `predicate` <[function]\([WebSocketFrame]\):[boolean]> diff --git a/docs/src/api/class-worker.md b/docs/src/api/class-worker.md index 00c1f6194c..1a1eb953bd 100644 --- a/docs/src/api/class-worker.md +++ b/docs/src/api/class-worker.md @@ -73,6 +73,9 @@ additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, ### param: Worker.evaluate.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Worker.evaluate.expression = %%-js-worker-evaluate-workerfunction-%% +* since: v1.8 + ### param: Worker.evaluate.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -95,6 +98,9 @@ the promise to resolve and return its value. ### param: Worker.evaluateHandle.expression = %%-evaluate-expression-%% * since: v1.8 +### param: Worker.evaluateHandle.expression = %%-js-worker-evaluate-workerfunction-%% +* since: v1.8 + ### param: Worker.evaluateHandle.arg * since: v1.8 - `arg` ?<[EvaluationArgument]> @@ -112,5 +118,8 @@ Optional argument to pass to [`param: expression`]. Performs action and waits for the Worker to close. +### param: Worker.waitForClose.callback = %%-java-wait-for-event-callback-%% +* since: v1.9 + ### option: Worker.waitForClose.timeout = %%-wait-for-event-timeout-%% * since: v1.9 diff --git a/docs/src/api/csharp.md b/docs/src/api/csharp.md deleted file mode 100644 index c7f354bfbc..0000000000 --- a/docs/src/api/csharp.md +++ /dev/null @@ -1,30 +0,0 @@ -## method: Request.PostDataJSON -* since: v1.12 -* langs: csharp -- returns: <[null]|[JsonElement]> - -Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any. - -When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned. -Otherwise it will be parsed as JSON. - -### param: BrowserContext.waitForPage.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Frame.waitForNavigation.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForConsoleMessage.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForDownload.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForFileChooser.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForPopup.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForRequestFinished.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForNavigation.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForWebSocket.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 -### param: Page.waitForWorker.action = %%-csharp-wait-for-event-action-%% -* since: v1.12 diff --git a/docs/src/api/java.md b/docs/src/api/java.md deleted file mode 100644 index 51e43b8c78..0000000000 --- a/docs/src/api/java.md +++ /dev/null @@ -1,119 +0,0 @@ -## method: Page.onceDialog -* since: v1.10 -* langs: java - -Adds one-off [Dialog] handler. The handler will be removed immediately after next [Dialog] is created. -```java -page.onceDialog(dialog -> { - dialog.accept("foo"); -}); - -// prints 'foo' -System.out.println(page.evaluate("prompt('Enter string:')")); - -// prints 'null' as the dialog will be auto-dismissed because there are no handlers. -System.out.println(page.evaluate("prompt('Enter string:')")); -``` - -This code above is equivalent to: -```java -Consumer handler = new Consumer() { - @Override - public void accept(Dialog dialog) { - dialog.accept("foo"); - page.offDialog(this); - } -}; -page.onDialog(handler); - -// prints 'foo' -System.out.println(page.evaluate("prompt('Enter string:')")); - -// prints 'null' as the dialog will be auto-dismissed because there are no handlers. -System.out.println(page.evaluate("prompt('Enter string:')")); -``` - -### param: Page.onceDialog.handler -* since: v1.10 -- `handler` <[function]\([Dialog]\)> - -Receives the [Dialog] object, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise -the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, -and actions like click will never finish. - -## method: Playwright.close -* since: v1.9 -* langs: java - -Terminates this instance of Playwright, will also close all created browsers if they are still running. - -## method: Playwright.create -* since: v1.10 -* langs: java -- returns: <[Playwright]> - -Launches new Playwright driver process and connects to it. [`method: Playwright.close`] should be called when the instance is no longer needed. - -```java -Playwright playwright = Playwright.create(); -Browser browser = playwright.webkit().launch(); -Page page = browser.newPage(); -page.navigate("https://www.w3.org/"); -playwright.close(); -``` - -### option: Playwright.create.env -* since: v1.13 -* langs: java -- `env` <[Object]<[string], [string]>> - -Additional environment variables that will be passed to the driver process. By default driver -process inherits environment variables of the Playwright process. - -### param: BrowserContext.waitForPage.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Frame.waitForNavigation.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForClose.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForConsoleMessage.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForDownload.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForFileChooser.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForPopup.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForRequest.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForRequestFinished.callback = %%-java-wait-for-event-callback-%% -* since: v1.12 - -### param: Page.waitForResponse.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForNavigation.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForWebSocket.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Page.waitForWorker.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: WebSocket.waitForFrameReceived.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: WebSocket.waitForFrameSent.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 - -### param: Worker.waitForClose.callback = %%-java-wait-for-event-callback-%% -* since: v1.9 diff --git a/docs/src/api/javascript.md b/docs/src/api/javascript.md deleted file mode 100644 index 061d2bf9a6..0000000000 --- a/docs/src/api/javascript.md +++ /dev/null @@ -1,53 +0,0 @@ -## async method: Response.finished -* since: v1.8 -* langs: js -- returns: <[null]|[Error]> - -## method: Request.failure -* since: v1.8 -* langs: js -- returns: <[null]|[Object]> - - `errorText` <[string]> Human-readable error message, e.g. `'net::ERR_FAILED'`. - -### param: ElementHandle.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% -* since: v1.9 -### param: ElementHandle.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% -* since: v1.9 -### param: Frame.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% -* since: v1.9 -### param: Frame.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% -* since: v1.9 -### param: Frame.evaluate.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Frame.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Frame.waitForFunction.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: JSHandle.evaluate.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: JSHandle.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Page.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%% -* since: v1.9 -### param: Page.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%% -* since: v1.9 -### param: Page.evaluate.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Page.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Page.waitForFunction.expression = %%-js-evaluate-pagefunction-%% -* since: v1.8 -### param: Worker.evaluate.expression = %%-js-worker-evaluate-workerfunction-%% -* since: v1.8 -### param: Worker.evaluateHandle.expression = %%-js-worker-evaluate-workerfunction-%% -* since: v1.8 -### param: ElectronApplication.evaluate.expression = %%-js-electron-evaluate-workerfunction-%% -* since: v1.9 -### param: ElectronApplication.evaluateHandle.expression = %%-js-electron-evaluate-workerfunction-%% -* since: v1.9 -### param: Locator.evaluate.expression = %%-js-evaluate-pagefunction-%% -* since: v1.14 -### param: Locator.evaluateAll.expression = %%-js-evaluate-pagefunction-%% -* since: v1.14 -### param: Locator.evaluateHandle.expression = %%-js-evaluate-pagefunction-%% -* since: v1.14 diff --git a/docs/src/api/params.md b/docs/src/api/params.md index e11381a663..5ee285e0dd 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -430,13 +430,13 @@ Function to be evaluated in the page context. ## js-evalonselector-pagefunction * langs: js -- `pageFunction` <[function]\([Element]\)> +- `pageFunction` <[function]\([Element]\)|[string]> Function to be evaluated in the page context. ## js-evalonselectorall-pagefunction * langs: js -- `pageFunction` <[function]\([Array]<[Element]>\)> +- `pageFunction` <[function]\([Array]<[Element]>\)|[string]> Function to be evaluated in the page context.