diff --git a/playwright/src/main/java/com/microsoft/playwright/Accessibility.java b/playwright/src/main/java/com/microsoft/playwright/Accessibility.java index 19399666..32e62199 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Accessibility.java +++ b/playwright/src/main/java/com/microsoft/playwright/Accessibility.java @@ -20,23 +20,17 @@ import java.util.*; /** * The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by - *

* assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or - *

* [switches](https://en.wikipedia.org/wiki/Switch_access). - *

- * Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might - *

+ * + *

Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might * have wildly different output. - *

- * Blink - Chromium's rendering engine - has a concept of "accessibility tree", which is then translated into different - *

+ * + *

Blink - Chromium's rendering engine - has a concept of "accessibility tree", which is then translated into different * platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree. - *

- * Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by - *

+ * + *

Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by * assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the - *

* "interesting" nodes of the tree. */ public interface Accessibility { @@ -64,17 +58,10 @@ public interface Accessibility { } /** * Captures the current state of the accessibility tree. The returned object represents the root accessible node of the - *

* page. - *

- * > NOTE The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. - *

+ * + *

> NOTE The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. * Playwright will discard them as well for an easier to process tree, unless {@code interestingOnly} is set to {@code false}. - *

- * - *

- * - *

*/ AccessibilityNode snapshot(SnapshotOptions options); } diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index 8a94604d..7ae9256e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -21,17 +21,12 @@ import java.util.*; /** * - extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) - *

- * A Browser is created when Playwright connects to a browser instance, either through [{@code method: BrowserType.launch}] or - *

+ * + *

A Browser is created when Playwright connects to a browser instance, either through [{@code method: BrowserType.launch}] or * [{@code method: BrowserType.connect}]. - *

- * - *

- * See {@code ChromiumBrowser}, [FirefoxBrowser] and [WebKitBrowser] for browser-specific features. Note that - *

+ * + *

See {@code ChromiumBrowser}, [FirefoxBrowser] and [WebKitBrowser] for browser-specific features. Note that * [{@code method: BrowserType.connect}] and [{@code method: BrowserType.launch}] always return a specific browser instance, based on - *

* the browser being connected to or launched. */ public interface Browser { @@ -639,21 +634,16 @@ public interface Browser { } /** * In case this browser is obtained using [{@code method: BrowserType.launch}], closes the browser and all of its pages (if any - *

* were opened). - *

- * In case this browser is obtained using [{@code method: BrowserType.connect}], clears all created contexts belonging to this - *

+ * + *

In case this browser is obtained using [{@code method: BrowserType.connect}], clears all created contexts belonging to this * browser and disconnects from the browser server. - *

- * The {@code Browser} object itself is considered to be disposed and cannot be used anymore. + * + *

The {@code Browser} object itself is considered to be disposed and cannot be used anymore. */ void close(); /** * Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts. - *

- * - *

*/ List contexts(); /** @@ -665,9 +655,6 @@ public interface Browser { } /** * Creates a new browser context. It won't share cookies/cache with other browser contexts. - *

- * - *

*/ BrowserContext newContext(NewContextOptions options); default Page newPage() { @@ -675,11 +662,9 @@ public interface Browser { } /** * Creates a new page in a new browser context. Closing this page will close the context as well. - *

- * This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and - *

+ * + *

This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and * testing frameworks should explicitly create [{@code method: Browser.newContext}] followed by the - *

* [{@code method: BrowserContext.newPage}] to control their exact life times. */ Page newPage(NewPageOptions options); diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index 70a29e9d..ab9d3280 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -24,19 +24,14 @@ import java.util.regex.Pattern; /** * - extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) - *

- * BrowserContexts provide a way to operate multiple independent browser sessions. - *

- * If a page opens another page, e.g. with a {@code window.open} call, the popup will belong to the parent page's browser - *

+ * + *

BrowserContexts provide a way to operate multiple independent browser sessions. + * + *

If a page opens another page, e.g. with a {@code window.open} call, the popup will belong to the parent page's browser * context. - *

- * Playwright allows creation of "incognito" browser contexts with {@code browser.newContext()} method. "Incognito" browser - *

+ * + *

Playwright allows creation of "incognito" browser contexts with {@code browser.newContext()} method. "Incognito" browser * contexts don't write any browsing data to disk. - *

- * - *

*/ public interface BrowserContext { enum SameSite { STRICT, LAX, NONE } @@ -270,11 +265,7 @@ public interface BrowserContext { } /** * Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be - *

* obtained via [{@code method: BrowserContext.cookies}]. - *

- * - *

*/ void addCookies(List cookies); default void addInitScript(String script) { @@ -282,24 +273,16 @@ public interface BrowserContext { } /** * Adds a script which would be evaluated in one of the following scenarios: - *

* - Whenever a page is created in the browser context or is navigated. - *

* - Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is - *

* evaluated in the context of the newly attached frame. - *

- * The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend - *

+ * + *

The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend * the JavaScript environment, e.g. to seed {@code Math.random}. - *

- * - *

- * - *

- * > NOTE The order of evaluation of multiple scripts installed via [{@code method: BrowserContext.addInitScript}] and - *

+ * + *

> NOTE The order of evaluation of multiple scripts installed via [{@code method: BrowserContext.addInitScript}] and * [{@code method: Page.addInitScript}] is not defined. + * * @param script Script to be evaluated in all pages in the browser context. * @param arg Optional argument to pass to {@code script} (only supported when passing a function). */ @@ -314,23 +297,20 @@ public interface BrowserContext { void clearCookies(); /** * Clears all permission overrides for the browser context. - *

- * - *

*/ void clearPermissions(); /** * Closes the browser context. All the pages that belong to the browser context will be closed. - *

- * > NOTE the default browser context cannot be closed. + * + *

> NOTE the default browser context cannot be closed. */ void close(); default List cookies() { return cookies((List) null); } default List cookies(String url) { return cookies(Arrays.asList(url)); } /** * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs - *

* are returned. + * * @param urls Optional list of URLs. */ List cookies(List urls); @@ -339,38 +319,28 @@ public interface BrowserContext { } /** * The method adds a function called {@code name} on the {@code window} object of every frame in every page in the context. When - *

* called, the function executes {@code callback} and returns a [Promise] which resolves to the return value of {@code callback}. If - *

* the {@code callback} returns a [Promise], it will be awaited. - *

- * The first argument of the {@code callback} function contains information about the caller: `{ browserContext: BrowserContext, - *

+ * + *

The first argument of the {@code callback} function contains information about the caller: `{ browserContext: BrowserContext, * page: Page, frame: Frame }`. - *

- * See [{@code method: Page.exposeBinding}] for page-only version. - *

- * - *

- * - *

- * + * + *

See [{@code method: Page.exposeBinding}] for page-only version. + * + * * @param name Name of the function on the window object. * @param callback Callback function that will be called in the Playwright's context. */ void exposeBinding(String name, Page.Binding callback, ExposeBindingOptions options); /** * The method adds a function called {@code name} on the {@code window} object of every frame in every page in the context. When - *

* called, the function executes {@code callback} and returns a [Promise] which resolves to the return value of {@code callback}. - *

- * If the {@code callback} returns a [Promise], it will be awaited. - *

- * See [{@code method: Page.exposeFunction}] for page-only version. - *

- * - *

- * + * + *

If the {@code callback} returns a [Promise], it will be awaited. + * + *

See [{@code method: Page.exposeFunction}] for page-only version. + * + * * @param name Name of the function on the window object. * @param callback Callback function that will be called in the Playwright's context. */ @@ -380,8 +350,8 @@ public interface BrowserContext { } /** * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if - *

* specified. + * * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values: * - {@code 'geolocation'} * - {@code 'midi'} @@ -407,7 +377,6 @@ public interface BrowserContext { Page newPage(); /** * Returns all open pages in the context. Non visible pages, such as {@code "background_page"}, will not be listed here. You can - *

* find them using [{@code method: ChromiumBrowserContext.backgroundPages}]. */ List pages(); @@ -415,77 +384,63 @@ public interface BrowserContext { void route(Pattern url, Consumer handler); /** * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - *

* is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. - *

- * - *

- * or the same snippet using a regex pattern instead: - *

- * - *

- * Page routes (set up with [{@code method: Page.route}]) take precedence over browser context routes when request matches both - *

+ * + *

or the same snippet using a regex pattern instead: + * + *

Page routes (set up with [{@code method: Page.route}]) take precedence over browser context routes when request matches both * handlers. - *

- * > NOTE Enabling routing disables http cache. + * + *

> NOTE Enabling routing disables http cache. + * * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing. * @param handler handler function to route the request. */ void route(Predicate url, Consumer handler); /** * This setting will change the default maximum navigation time for the following methods and related shortcuts: - *

* - [{@code method: Page.goBack}] - *

* - [{@code method: Page.goForward}] - *

* - [{@code method: Page.goto}] - *

* - [{@code method: Page.reload}] - *

* - [{@code method: Page.setContent}] - *

* - [{@code method: Page.waitForNavigation}] - *

- * > NOTE [{@code method: Page.setDefaultNavigationTimeout}] and [{@code method: Page.setDefaultTimeout}] take priority over - *

+ * + *

> NOTE [{@code method: Page.setDefaultNavigationTimeout}] and [{@code method: Page.setDefaultTimeout}] take priority over * [{@code method: BrowserContext.setDefaultNavigationTimeout}]. + * * @param timeout Maximum navigation time in milliseconds */ void setDefaultNavigationTimeout(double timeout); /** * This setting will change the default maximum time for all the methods accepting {@code timeout} option. - *

- * > NOTE [{@code method: Page.setDefaultNavigationTimeout}], [{@code method: Page.setDefaultTimeout}] and - *

+ * + *

> NOTE [{@code method: Page.setDefaultNavigationTimeout}], [{@code method: Page.setDefaultTimeout}] and * [{@code method: BrowserContext.setDefaultNavigationTimeout}] take priority over [{@code method: BrowserContext.setDefaultTimeout}]. + * * @param timeout Maximum time in milliseconds */ void setDefaultTimeout(double timeout); /** * The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged - *

* with page-specific extra HTTP headers set with [{@code method: Page.setExtraHTTPHeaders}]. If page overrides a particular - *

* header, page-specific header value will be used instead of the browser context header value. - *

- * > NOTE {@code browserContext.setExtraHTTPHeaders} does not guarantee the order of headers in the outgoing requests. + * + *

> NOTE {@code browserContext.setExtraHTTPHeaders} does not guarantee the order of headers in the outgoing requests. + * * @param headers An object containing additional HTTP headers to be sent with every request. All header values must be strings. */ void setExtraHTTPHeaders(Map headers); /** * Sets the context's geolocation. Passing {@code null} or {@code undefined} emulates position unavailable. - *

- * - *

- * > NOTE Consider using [{@code method: BrowserContext.grantPermissions}] to grant permissions for the browser context pages - *

+ * + *

> NOTE Consider using [{@code method: BrowserContext.grantPermissions}] to grant permissions for the browser context pages * to read its geolocation. */ void setGeolocation(Geolocation geolocation); /** - * + * + * * @param offline Whether to emulate network being offline for the browser context. */ void setOffline(boolean offline); @@ -503,8 +458,8 @@ public interface BrowserContext { void unroute(Pattern url, Consumer handler); /** * Removes a route created with [{@code method: BrowserContext.route}]. When {@code handler} is not specified, removes all routes for - *

* the {@code url}. + * * @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with * [{@code method: BrowserContext.route}]. * @param handler Optional handler function used to register a routing with [{@code method: BrowserContext.route}]. @@ -520,12 +475,9 @@ public interface BrowserContext { } /** * Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy - *

* value. Will throw an error if the context closes before the event is fired. Returns the event data value. - *

- * - *

- * + * + * * @param event Event name, same one would pass into {@code browserContext.on(event)}. */ Deferred> futureEvent(EventType event, FutureEventOptions options); diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java index 01fff422..88c7e1c8 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java @@ -21,11 +21,7 @@ import java.util.*; /** * BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a - *

* typical example of using Playwright to drive automation: - *

- * - *

*/ public interface BrowserType { class LaunchOptions { @@ -625,37 +621,22 @@ public interface BrowserType { } /** * Returns the browser instance. - *

- * You can use {@code ignoreDefaultArgs} to filter out {@code --mute-audio} from default arguments: - *

- * - *

- * > **Chromium-only** Playwright can also be used to control the Chrome browser, but it works best with the version of - *

+ * + *

You can use {@code ignoreDefaultArgs} to filter out {@code --mute-audio} from default arguments: + * + *

> **Chromium-only** Playwright can also be used to control the Chrome browser, but it works best with the version of * Chromium it is bundled with. There is no guarantee it will work with any other version. Use {@code executablePath} option with - *

* extreme caution. - *

* > - *

* > If Google Chrome (rather than Chromium) is preferred, a - *

* [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or - *

* [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested. - *

* > - *

* > In [{@code method: BrowserType.launch}] above, any mention of Chromium also applies to Chrome. - *

* > - *

* > See [{@code this article}](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for - *

* a description of the differences between Chromium and Chrome. - *

* [{@code This article}](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) - *

* describes some differences for Linux users. */ Browser launch(LaunchOptions options); @@ -664,10 +645,10 @@ public interface BrowserType { } /** * Returns the persistent browser context instance. - *

- * Launches browser that uses persistent storage located at {@code userDataDir} and returns the only context. Closing this - *

+ * + *

Launches browser that uses persistent storage located at {@code userDataDir} and returns the only context. Closing this * context will automatically close the browser. + * * @param userDataDir Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for * [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) and * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). diff --git a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java index f40854a2..03bf13a6 100644 --- a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java +++ b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java @@ -51,9 +51,7 @@ public interface ConsoleMessage { String text(); /** * One of the following values: {@code 'log'}, {@code 'debug'}, {@code 'info'}, {@code 'error'}, {@code 'warning'}, {@code 'dir'}, {@code 'dirxml'}, {@code 'table'}, - *

* {@code 'trace'}, {@code 'clear'}, {@code 'startGroup'}, {@code 'startGroupCollapsed'}, {@code 'endGroup'}, {@code 'assert'}, {@code 'profile'}, {@code 'profileEnd'}, - *

* {@code 'count'}, {@code 'timeEnd'}. */ String type(); diff --git a/playwright/src/main/java/com/microsoft/playwright/Dialog.java b/playwright/src/main/java/com/microsoft/playwright/Dialog.java index 80475710..f8d0eb44 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Dialog.java +++ b/playwright/src/main/java/com/microsoft/playwright/Dialog.java @@ -20,9 +20,6 @@ import java.util.*; /** * {@code Dialog} objects are dispatched by page via the [{@code event: Page.dialog}] event. - *

- * - *

*/ public interface Dialog { enum Type { ALERT, BEFOREUNLOAD, CONFIRM, PROMPT } @@ -32,6 +29,7 @@ public interface Dialog { } /** * Returns when the dialog has been accepted. + * * @param promptText A text to enter in prompt. Does not cause any effects if the dialog's {@code type} is not prompt. Optional. */ void accept(String promptText); diff --git a/playwright/src/main/java/com/microsoft/playwright/Download.java b/playwright/src/main/java/com/microsoft/playwright/Download.java index 1682e6e5..52605b66 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Download.java +++ b/playwright/src/main/java/com/microsoft/playwright/Download.java @@ -22,19 +22,14 @@ import java.util.*; /** * {@code Download} objects are dispatched by page via the [{@code event: Page.download}] event. - *

- * All the downloaded files belonging to the browser context are deleted when the browser context is closed. All downloaded - *

+ * + *

All the downloaded files belonging to the browser context are deleted when the browser context is closed. All downloaded * files are deleted when the browser closes. - *

- * Download event is emitted once the download starts. Download path becomes available once download completes: - *

- * - *

- * > NOTE Browser context **must** be created with the {@code acceptDownloads} set to {@code true} when user needs access to the - *

+ * + *

Download event is emitted once the download starts. Download path becomes available once download completes: + * + *

> NOTE Browser context **must** be created with the {@code acceptDownloads} set to {@code true} when user needs access to the * downloaded content. If {@code acceptDownloads} is not set or set to {@code false}, download events are emitted, but the actual - *

* download is not performed and user has no access to the downloaded files. */ public interface Download { @@ -56,16 +51,14 @@ public interface Download { Path path(); /** * Saves the download to a user-specified path. + * * @param path Path where the download should be saved. */ void saveAs(Path path); /** * Returns suggested filename for this download. It is typically computed by the browser from the - *

* [{@code Content-Disposition}](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response header - *

* or the {@code download} attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources). Different - *

* browsers can use different logic for computing it. */ String suggestedFilename(); diff --git a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java index 2f496236..d7c1deb7 100644 --- a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java +++ b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java @@ -21,16 +21,13 @@ import java.util.*; /** * - extends: {@code JSHandle} - *

- * ElementHandle represents an in-page DOM element. ElementHandles can be created with the [{@code method: Page.$}] method. - *

- * - *

- * ElementHandle prevents DOM element from garbage collection unless the handle is disposed with - *

+ * + *

ElementHandle represents an in-page DOM element. ElementHandles can be created with the [{@code method: Page.$}] method. + * + *

ElementHandle prevents DOM element from garbage collection unless the handle is disposed with * [{@code method: JSHandle.dispose}]. ElementHandles are auto-disposed when their origin frame gets navigated. - *

- * ElementHandle instances can be used as an argument in [{@code method: Page.$eval}] and [{@code method: Page.evaluate}] methods. + * + *

ElementHandle instances can be used as an argument in [{@code method: Page.$eval}] and [{@code method: Page.evaluate}] methods. */ public interface ElementHandle extends JSHandle { class BoundingBox { @@ -609,19 +606,17 @@ public interface ElementHandle extends JSHandle { } /** * The method finds an element matching the specified selector in the {@code ElementHandle}'s subtree. See - *

* [Working with selectors](./selectors.md#working-with-selectors) for more details. If no elements match the selector, - *

* returns {@code null}. + * * @param selector A selector to query for. See [working with selectors](./selectors.md#working-with-selectors) for more details. */ ElementHandle querySelector(String selector); /** * The method finds all elements matching the specified selector in the {@code ElementHandle}s subtree. See - *

* [Working with selectors](./selectors.md#working-with-selectors) for more details. If no elements match the selector, - *

* returns empty array. + * * @param selector A selector to query for. See [working with selectors](./selectors.md#working-with-selectors) for more details. */ List querySelectorAll(String selector); @@ -630,20 +625,14 @@ public interface ElementHandle extends JSHandle { } /** * Returns the return value of {@code pageFunction} - *

- * The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a first - *

+ * + *

The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a first * argument to {@code pageFunction}. See [Working with selectors](./selectors.md#working-with-selectors) for more details. If no - *

* elements match the selector, the method throws an error. - *

- * If {@code pageFunction} returns a [Promise], then {@code frame.$eval} would wait for the promise to resolve and return its value. - *

- * Examples: - *

- * - *

- * + * + *

If {@code pageFunction} returns a [Promise], then {@code frame.$eval} would wait for the promise to resolve and return its value. + * + * * @param selector A selector to query for. See [working with selectors](./selectors.md#working-with-selectors) for more details. * @param pageFunction Function to be evaluated in browser context * @param arg Optional argument to pass to {@code pageFunction} @@ -654,22 +643,14 @@ public interface ElementHandle extends JSHandle { } /** * Returns the return value of {@code pageFunction} - *

- * The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array of - *

+ * + *

The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array of * matched elements as a first argument to {@code pageFunction}. See - *

* [Working with selectors](./selectors.md#working-with-selectors) for more details. - *

- * If {@code pageFunction} returns a [Promise], then {@code frame.$$eval} would wait for the promise to resolve and return its value. - *

- * Examples: - *

- * - *

- * - *

- * + * + *

If {@code pageFunction} returns a [Promise], then {@code frame.$$eval} would wait for the promise to resolve and return its value. + * + * * @param selector A selector to query for. See [working with selectors](./selectors.md#working-with-selectors) for more details. * @param pageFunction Function to be evaluated in browser context * @param arg Optional argument to pass to {@code pageFunction} @@ -677,25 +658,17 @@ public interface ElementHandle extends JSHandle { Object evalOnSelectorAll(String selector, String pageFunction, Object arg); /** * This method returns the bounding box of the element, or {@code null} if the element is not visible. The bounding box is - *

* calculated relative to the main frame viewport - which is usually the same as the browser window. - *

- * Scrolling affects the returned bonding box, similarly to - *

+ * + *

Scrolling affects the returned bonding box, similarly to * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That - *

* means {@code x} and/or {@code y} may be negative. - *

- * Elements from child frames return the bounding box relative to the main frame, unlike the - *

+ * + *

Elements from child frames return the bounding box relative to the main frame, unlike the * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). - *

- * Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following - *

+ * + *

Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following * snippet should click the center of the element. - *

- * - *

*/ BoundingBox boundingBox(); default void check() { @@ -703,25 +676,17 @@ public interface ElementHandle extends JSHandle { } /** * This method checks the element by performing the following steps: - *

* 1. Ensure that element is a checkbox or a radio input. If not, this method rejects. If the element is already - *

* checked, this method returns immediately. - *

* 1. Wait for [actionability](./actionability.md) checks on the element, unless {@code force} option is set. - *

* 1. Scroll the element into view if needed. - *

* 1. Use [{@code property: Page.mouse}] to click in the center of the element. - *

* 1. Wait for initiated navigations to either succeed or fail, unless {@code noWaitAfter} option is set. - *

* 1. Ensure that the element is now checked. If not, this method rejects. - *

- * If the element is detached from the DOM at any moment during the action, this method rejects. - *

- * When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. - *

+ * + *

If the element is detached from the DOM at any moment during the action, this method rejects. + * + *

When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. * Passing zero timeout disables this. */ void check(CheckOptions options); @@ -730,19 +695,14 @@ public interface ElementHandle extends JSHandle { } /** * This method clicks the element by performing the following steps: - *

* 1. Wait for [actionability](./actionability.md) checks on the element, unless {@code force} option is set. - *

* 1. Scroll the element into view if needed. - *

* 1. Use [{@code property: Page.mouse}] to click in the center of the element, or the specified {@code position}. - *

* 1. Wait for initiated navigations to either succeed or fail, unless {@code noWaitAfter} option is set. - *

- * If the element is detached from the DOM at any moment during the action, this method rejects. - *

- * When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. - *

+ * + *

If the element is detached from the DOM at any moment during the action, this method rejects. + * + *

When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. * Passing zero timeout disables this. */ void click(ClickOptions options); @@ -755,24 +715,18 @@ public interface ElementHandle extends JSHandle { } /** * This method double clicks the element by performing the following steps: - *

* 1. Wait for [actionability](./actionability.md) checks on the element, unless {@code force} option is set. - *

* 1. Scroll the element into view if needed. - *

* 1. Use [{@code property: Page.mouse}] to double click in the center of the element, or the specified {@code position}. - *

* 1. Wait for initiated navigations to either succeed or fail, unless {@code noWaitAfter} option is set. Note that if the - *

* first click of the {@code dblclick()} triggers a navigation event, this method will reject. - *

- * If the element is detached from the DOM at any moment during the action, this method rejects. - *

- * When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. - *

+ * + *

If the element is detached from the DOM at any moment during the action, this method rejects. + * + *

When all steps combined have not finished during the specified {@code timeout}, this method rejects with a {@code TimeoutError}. * Passing zero timeout disables this. - *

- * > NOTE {@code elementHandle.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event. + * + *

> NOTE {@code elementHandle.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event. */ void dblclick(DblclickOptions options); default void dispatchEvent(String type) { @@ -780,38 +734,24 @@ public interface ElementHandle extends JSHandle { } /** * The snippet below dispatches the {@code click} event on the element. Regardless of the visibility state of the elment, {@code click} - *

* is dispatched. This is equivalend to calling - *

* [element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click). - *

- * - *

- * Under the hood, it creates an instance of an event based on the given {@code type}, initializes it with {@code eventInit} properties - *

+ * + *

Under the hood, it creates an instance of an event based on the given {@code type}, initializes it with {@code eventInit} properties * and dispatches it on the element. Events are {@code composed}, {@code cancelable} and bubble by default. - *

- * Since {@code eventInit} is event-specific, please refer to the events documentation for the lists of initial properties: - *

+ * + *

Since {@code eventInit} is event-specific, please refer to the events documentation for the lists of initial properties: * - [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent) - *

* - [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent) - *

* - [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent) - *

* - [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent) - *

* - [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent) - *

* - [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent) - *

* - [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event) - *

- * You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event: - *

- * - *

- * + * + *

You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event: + * + * * @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc. * @param eventInit Optional event-specific initialization properties. */ @@ -821,10 +761,9 @@ public interface ElementHandle extends JSHandle { } /** * This method waits for [actionability](./actionability.md) checks, focuses the element, fills it and triggers an {@code input} - *

* event after filling. If the element is not an {@code }, {@code