mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-29 01:53:54 +03:00
chore: minor protocol fixes (#3226)
This commit is contained in:
parent
88938669e1
commit
1728a3df93
42
docs/api.md
42
docs/api.md
@ -1043,8 +1043,8 @@ Shortcut for [page.mainFrame().check(selector[, options])](#framecheckselector-o
|
||||
- `clickCount` <[number]> defaults to 1. See [UIEvent.detail].
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -1092,8 +1092,8 @@ Browser-specific Coverage implementation, only available for Chromium atm. See [
|
||||
- `button` <"left"|"right"|"middle"> Defaults to `left`.
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -1445,8 +1445,8 @@ Shortcut for [page.mainFrame().goto(url[, options])](#framegotourl-options)
|
||||
- `selector` <[string]> A selector to search for element to hover. If there are multiple elements satisfying the selector, the first will be hovered. See [working with selectors](#working-with-selectors) for more details.
|
||||
- `options` <[Object]>
|
||||
- `position` <[Object]> A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
|
||||
@ -2161,8 +2161,8 @@ If there's no element matching `selector`, the method waits until a matching ele
|
||||
- `clickCount` <[number]> defaults to 1. See [UIEvent.detail].
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -2183,8 +2183,8 @@ Gets the full HTML contents of the frame, including the doctype.
|
||||
- `button` <"left"|"right"|"middle"> Defaults to `left`.
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -2362,8 +2362,8 @@ Returns element attribute value.
|
||||
- `selector` <[string]> A selector to search for element to hover. If there are multiple elements satisfying the selector, the first will be hovered. See [working with selectors](#working-with-selectors) for more details.
|
||||
- `options` <[Object]>
|
||||
- `position` <[Object]> A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
|
||||
@ -2742,8 +2742,8 @@ expect(await feedHandle.$$eval('.tweet', nodes => nodes.map(n => n.innerText))).
|
||||
|
||||
#### elementHandle.boundingBox()
|
||||
- returns: <[Promise]<?[Object]>>
|
||||
- x <[number]> the x coordinate of the element in pixels.
|
||||
- y <[number]> the y coordinate of the element in pixels.
|
||||
- `x` <[number]> the x coordinate of the element in pixels.
|
||||
- `y` <[number]> the y coordinate of the element in pixels.
|
||||
- width <[number]> the width of the element in pixels.
|
||||
- height <[number]> the height of the element in pixels.
|
||||
|
||||
@ -2764,8 +2764,8 @@ If element is not already checked, it scrolls it into view if needed, and then u
|
||||
- `clickCount` <[number]> defaults to 1. See [UIEvent.detail].
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -2783,8 +2783,8 @@ If the element is detached from DOM, the method throws an error.
|
||||
- `button` <"left"|"right"|"middle"> Defaults to `left`.
|
||||
- `delay` <[number]> Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
|
||||
- `position` <[Object]> A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `noWaitAfter` <[boolean]> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to `false`.
|
||||
@ -2853,8 +2853,8 @@ Returns element attribute value.
|
||||
#### elementHandle.hover([options])
|
||||
- `options` <[Object]>
|
||||
- `position` <[Object]> A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
- x <[number]>
|
||||
- y <[number]>
|
||||
- `x` <[number]>
|
||||
- `y` <[number]>
|
||||
- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">> Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
- `force` <[boolean]> Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.
|
||||
- `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](#pagesetdefaulttimeouttimeout) methods.
|
||||
@ -4030,7 +4030,7 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
|
||||
> See [`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. [`This article`](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
|
||||
|
||||
#### browserType.launchPersistentContext(userDataDir, [options])
|
||||
- `userDataDir` <[string]> 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).
|
||||
- `userDataDir` <[string]> 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).
|
||||
- `options` <[Object]> Set of configurable options to set on the browser. Can have the following fields:
|
||||
- `headless` <[boolean]> Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.
|
||||
- `executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
|
||||
|
@ -2031,7 +2031,7 @@ export interface RouteChannel extends Channel {
|
||||
fulfill(params: RouteFulfillParams): Promise<RouteFulfillResult>;
|
||||
}
|
||||
export type RouteAbortParams = {
|
||||
errorCode: string,
|
||||
errorCode?: string,
|
||||
};
|
||||
export type RouteAbortOptions = {
|
||||
|
||||
|
@ -171,7 +171,7 @@ export class Route extends ChannelOwner<RouteChannel, RouteInitializer> {
|
||||
return Request.from(this._initializer.request);
|
||||
}
|
||||
|
||||
async abort(errorCode: string = 'failed') {
|
||||
async abort(errorCode?: string) {
|
||||
await this._channel.abort({ errorCode });
|
||||
}
|
||||
|
||||
|
@ -1678,7 +1678,7 @@ Route:
|
||||
|
||||
abort:
|
||||
parameters:
|
||||
errorCode: string
|
||||
errorCode: string?
|
||||
|
||||
continue:
|
||||
parameters:
|
||||
|
@ -98,7 +98,7 @@ export class RouteDispatcher extends Dispatcher<Route, RouteInitializer> impleme
|
||||
});
|
||||
}
|
||||
|
||||
async abort(params: { errorCode: string }): Promise<void> {
|
||||
await this._object.abort(params.errorCode);
|
||||
async abort(params: { errorCode?: string }): Promise<void> {
|
||||
await this._object.abort(params.errorCode || 'failed');
|
||||
}
|
||||
}
|
||||
|
@ -792,7 +792,7 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
|
||||
});
|
||||
scheme.RequestResponseParams = tOptional(tObject({}));
|
||||
scheme.RouteAbortParams = tObject({
|
||||
errorCode: tString,
|
||||
errorCode: tOptional(tString),
|
||||
});
|
||||
scheme.RouteContinueParams = tObject({
|
||||
method: tOptional(tString),
|
||||
|
Loading…
Reference in New Issue
Block a user