Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(har): do not complain about a lot of listeners (#4675)

Pavel Feldmanf20518f252ce
diff --git a/docs-src/api-body.md b/docs-src/api-body.md
index da1f2209ba..abf23a1bbd 100644
--- a/docs-src/api-body.md
+++ b/docs-src/api-body.md
@@ -1405,7 +1405,7 @@ Shortcut for main frame's [frame.focus()]().
## method: Page.frame
- returns: <[null]|[Frame]>
-Returns frame matching the criteria. Returns `null` if no frame matches.
+Returns frame matching the specified criteria. Either `name` or `url` must be specified.
```js
const frame = page.frame('frame-name');
@@ -1415,8 +1415,6 @@ const frame = page.frame('frame-name');
const frame = page.frame({ url: /.*domain.*/ });
```
-Returns frame matching the specified criteria. Either `name` or `url` must be specified.
-
### param: Page.frame.frameSelector
- `frameSelector` <[string]|[Object]>
- `name` <[string]> frame name specified in the `iframe`'s `name` attribute
diff --git a/docs/api.md b/docs/api.md
index 81a6559e27..7d1419fa42 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -1608,7 +1608,7 @@ Shortcut for main frame's [frame.focus(selector[, options])](#framefocusselector
- `url` <[string]|[RegExp]|[Function]> A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object.
- returns: <[null]|[Frame]>
-Returns frame matching the criteria. Returns `null` if no frame matches.
+Returns frame matching the specified criteria. Either `name` or `url` must be specified.
```js
const frame = page.frame('frame-name');
@@ -1618,8 +1618,6 @@ const frame = page.frame('frame-name');
const frame = page.frame({ url: /.*domain.*/ });
```
-Returns frame matching the specified criteria. Either `name` or `url` must be specified.
-
#### page.frames()
- returns: <[Array]<[Frame]>>
diff --git a/src/server/page.ts b/src/server/page.ts
index 6163838a71..cad5db0979 100644
--- a/src/server/page.ts
+++ b/src/server/page.ts
@@ -149,6 +149,7 @@ export class Page extends EventEmitter {
constructor(delegate: PageDelegate, browserContext: BrowserContext) {
super();
+ this.setMaxListeners(0);
this._delegate = delegate;
this._closedCallback = () => {};
this._closedPromise = new Promise(f => this._closedCallback = f);