diff --git a/docs/api.md b/docs/api.md
index a4992686f14..1b22242e46f 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -131,6 +131,7 @@
* [page.goto(url[, options])](#pagegotourl-options)
* [page.hover(selector)](#pagehoverselector)
* [page.isClosed()](#pageisclosed)
+ * [page.isJavaScriptEnabled()](#pageisjavascriptenabled)
* [page.keyboard](#pagekeyboard)
* [page.mainFrame()](#pagemainframe)
* [page.metrics()](#pagemetrics)
@@ -1643,6 +1644,12 @@ Shortcut for [page.mainFrame().hover(selector)](#framehoverselector).
Indicates that the page has been closed.
+#### page.isJavaScriptEnabled()
+
+- returns: <[boolean]>
+
+Returns `true` if the page has JavaScript enabled, `false` otherwise.
+
#### page.keyboard
- returns: <[Keyboard]>
diff --git a/new-docs/puppeteer.page._accessibility.md b/new-docs/puppeteer.page._accessibility.md
deleted file mode 100644
index e10dfac430b..00000000000
--- a/new-docs/puppeteer.page._accessibility.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_accessibility](./puppeteer.page._accessibility.md)
-
-## Page.\_accessibility property
-
-Signature:
-
-```typescript
-_accessibility: Accessibility;
-```
diff --git a/new-docs/puppeteer.page._addconsolemessage.md b/new-docs/puppeteer.page._addconsolemessage.md
deleted file mode 100644
index 881cda41e02..00000000000
--- a/new-docs/puppeteer.page._addconsolemessage.md
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_addConsoleMessage](./puppeteer.page._addconsolemessage.md)
-
-## Page.\_addConsoleMessage() method
-
-Signature:
-
-```typescript
-_addConsoleMessage(type: string, args: JSHandle[], stackTrace?: Protocol.Runtime.StackTrace): void;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| type | string | |
-| args | [JSHandle](./puppeteer.jshandle.md)\[\] | |
-| stackTrace | Protocol.Runtime.StackTrace | |
-
-Returns:
-
-void
-
diff --git a/new-docs/puppeteer.page._buildmetricsobject.md b/new-docs/puppeteer.page._buildmetricsobject.md
deleted file mode 100644
index c74ff6b5dff..00000000000
--- a/new-docs/puppeteer.page._buildmetricsobject.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_buildMetricsObject](./puppeteer.page._buildmetricsobject.md)
-
-## Page.\_buildMetricsObject() method
-
-Signature:
-
-```typescript
-_buildMetricsObject(metrics?: Protocol.Performance.Metric[]): Metrics;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| metrics | Protocol.Performance.Metric\[\] | |
-
-Returns:
-
-Metrics
-
diff --git a/new-docs/puppeteer.page._client.md b/new-docs/puppeteer.page._client.md
deleted file mode 100644
index cca78381bf4..00000000000
--- a/new-docs/puppeteer.page._client.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_client](./puppeteer.page._client.md)
-
-## Page.\_client property
-
-Signature:
-
-```typescript
-_client: CDPSession;
-```
diff --git a/new-docs/puppeteer.page._closed.md b/new-docs/puppeteer.page._closed.md
deleted file mode 100644
index cb69546a024..00000000000
--- a/new-docs/puppeteer.page._closed.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_closed](./puppeteer.page._closed.md)
-
-## Page.\_closed property
-
-Signature:
-
-```typescript
-_closed: boolean;
-```
diff --git a/new-docs/puppeteer.page._coverage.md b/new-docs/puppeteer.page._coverage.md
deleted file mode 100644
index a07752a2dae..00000000000
--- a/new-docs/puppeteer.page._coverage.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_coverage](./puppeteer.page._coverage.md)
-
-## Page.\_coverage property
-
-Signature:
-
-```typescript
-_coverage: Coverage;
-```
diff --git a/new-docs/puppeteer.page._disconnectpromise.md b/new-docs/puppeteer.page._disconnectpromise.md
deleted file mode 100644
index 9f70c94ee45..00000000000
--- a/new-docs/puppeteer.page._disconnectpromise.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_disconnectPromise](./puppeteer.page._disconnectpromise.md)
-
-## Page.\_disconnectPromise property
-
-Signature:
-
-```typescript
-_disconnectPromise?: Promise;
-```
diff --git a/new-docs/puppeteer.page._emitmetrics.md b/new-docs/puppeteer.page._emitmetrics.md
deleted file mode 100644
index 16d4f04509f..00000000000
--- a/new-docs/puppeteer.page._emitmetrics.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_emitMetrics](./puppeteer.page._emitmetrics.md)
-
-## Page.\_emitMetrics() method
-
-Signature:
-
-```typescript
-_emitMetrics(event: Protocol.Performance.metricsPayload): void;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| event | Protocol.Performance.metricsPayload | |
-
-Returns:
-
-void
-
diff --git a/new-docs/puppeteer.page._emulationmanager.md b/new-docs/puppeteer.page._emulationmanager.md
deleted file mode 100644
index 8cb81a8eb9e..00000000000
--- a/new-docs/puppeteer.page._emulationmanager.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_emulationManager](./puppeteer.page._emulationmanager.md)
-
-## Page.\_emulationManager property
-
-Signature:
-
-```typescript
-_emulationManager: EmulationManager;
-```
diff --git a/new-docs/puppeteer.page._filechooserinterceptors.md b/new-docs/puppeteer.page._filechooserinterceptors.md
deleted file mode 100644
index 64cf4cbfe26..00000000000
--- a/new-docs/puppeteer.page._filechooserinterceptors.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_fileChooserInterceptors](./puppeteer.page._filechooserinterceptors.md)
-
-## Page.\_fileChooserInterceptors property
-
-Signature:
-
-```typescript
-_fileChooserInterceptors: Set;
-```
diff --git a/new-docs/puppeteer.page._framemanager.md b/new-docs/puppeteer.page._framemanager.md
deleted file mode 100644
index 774eaee6a23..00000000000
--- a/new-docs/puppeteer.page._framemanager.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_frameManager](./puppeteer.page._framemanager.md)
-
-## Page.\_frameManager property
-
-Signature:
-
-```typescript
-_frameManager: FrameManager;
-```
diff --git a/new-docs/puppeteer.page._handleexception.md b/new-docs/puppeteer.page._handleexception.md
deleted file mode 100644
index b64eac16c5f..00000000000
--- a/new-docs/puppeteer.page._handleexception.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_handleException](./puppeteer.page._handleexception.md)
-
-## Page.\_handleException() method
-
-Signature:
-
-```typescript
-_handleException(exceptionDetails: Protocol.Runtime.ExceptionDetails): void;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| exceptionDetails | Protocol.Runtime.ExceptionDetails | |
-
-Returns:
-
-void
-
diff --git a/new-docs/puppeteer.page._javascriptenabled.md b/new-docs/puppeteer.page._javascriptenabled.md
deleted file mode 100644
index d33dab13c41..00000000000
--- a/new-docs/puppeteer.page._javascriptenabled.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_javascriptEnabled](./puppeteer.page._javascriptenabled.md)
-
-## Page.\_javascriptEnabled property
-
-Signature:
-
-```typescript
-_javascriptEnabled: boolean;
-```
diff --git a/new-docs/puppeteer.page._keyboard.md b/new-docs/puppeteer.page._keyboard.md
deleted file mode 100644
index 145204f0099..00000000000
--- a/new-docs/puppeteer.page._keyboard.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_keyboard](./puppeteer.page._keyboard.md)
-
-## Page.\_keyboard property
-
-Signature:
-
-```typescript
-_keyboard: Keyboard;
-```
diff --git a/new-docs/puppeteer.page._mouse.md b/new-docs/puppeteer.page._mouse.md
deleted file mode 100644
index e6c6621f7d1..00000000000
--- a/new-docs/puppeteer.page._mouse.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_mouse](./puppeteer.page._mouse.md)
-
-## Page.\_mouse property
-
-Signature:
-
-```typescript
-_mouse: Mouse;
-```
diff --git a/new-docs/puppeteer.page._onbindingcalled.md b/new-docs/puppeteer.page._onbindingcalled.md
deleted file mode 100644
index be261b99843..00000000000
--- a/new-docs/puppeteer.page._onbindingcalled.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_onBindingCalled](./puppeteer.page._onbindingcalled.md)
-
-## Page.\_onBindingCalled() method
-
-Signature:
-
-```typescript
-_onBindingCalled(event: Protocol.Runtime.bindingCalledPayload): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| event | Protocol.Runtime.bindingCalledPayload | |
-
-Returns:
-
-Promise<void>
-
diff --git a/new-docs/puppeteer.page._onconsoleapi.md b/new-docs/puppeteer.page._onconsoleapi.md
deleted file mode 100644
index a5e608be188..00000000000
--- a/new-docs/puppeteer.page._onconsoleapi.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_onConsoleAPI](./puppeteer.page._onconsoleapi.md)
-
-## Page.\_onConsoleAPI() method
-
-Signature:
-
-```typescript
-_onConsoleAPI(event: Protocol.Runtime.consoleAPICalledPayload): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| event | Protocol.Runtime.consoleAPICalledPayload | |
-
-Returns:
-
-Promise<void>
-
diff --git a/new-docs/puppeteer.page._ondialog.md b/new-docs/puppeteer.page._ondialog.md
deleted file mode 100644
index a5586fea0d0..00000000000
--- a/new-docs/puppeteer.page._ondialog.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_onDialog](./puppeteer.page._ondialog.md)
-
-## Page.\_onDialog() method
-
-Signature:
-
-```typescript
-_onDialog(event: Protocol.Page.javascriptDialogOpeningPayload): void;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| event | Protocol.Page.javascriptDialogOpeningPayload | |
-
-Returns:
-
-void
-
diff --git a/new-docs/puppeteer.page._onfilechooser.md b/new-docs/puppeteer.page._onfilechooser.md
deleted file mode 100644
index 98bef7e6dcf..00000000000
--- a/new-docs/puppeteer.page._onfilechooser.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_onFileChooser](./puppeteer.page._onfilechooser.md)
-
-## Page.\_onFileChooser() method
-
-Signature:
-
-```typescript
-_onFileChooser(event: Protocol.Page.fileChooserOpenedPayload): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| event | Protocol.Page.fileChooserOpenedPayload | |
-
-Returns:
-
-Promise<void>
-
diff --git a/new-docs/puppeteer.page._pagebindings.md b/new-docs/puppeteer.page._pagebindings.md
deleted file mode 100644
index e86af9a813e..00000000000
--- a/new-docs/puppeteer.page._pagebindings.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_pageBindings](./puppeteer.page._pagebindings.md)
-
-## Page.\_pageBindings property
-
-Signature:
-
-```typescript
-_pageBindings: Map;
-```
diff --git a/new-docs/puppeteer.page._screenshottaskqueue.md b/new-docs/puppeteer.page._screenshottaskqueue.md
deleted file mode 100644
index f90cf45f20f..00000000000
--- a/new-docs/puppeteer.page._screenshottaskqueue.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_screenshotTaskQueue](./puppeteer.page._screenshottaskqueue.md)
-
-## Page.\_screenshotTaskQueue property
-
-Signature:
-
-```typescript
-_screenshotTaskQueue: ScreenshotTaskQueue;
-```
diff --git a/new-docs/puppeteer.page._sessionclosepromise.md b/new-docs/puppeteer.page._sessionclosepromise.md
deleted file mode 100644
index ae962beb9cb..00000000000
--- a/new-docs/puppeteer.page._sessionclosepromise.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_sessionClosePromise](./puppeteer.page._sessionclosepromise.md)
-
-## Page.\_sessionClosePromise() method
-
-Signature:
-
-```typescript
-_sessionClosePromise(): Promise;
-```
-Returns:
-
-Promise<Error>
-
diff --git a/new-docs/puppeteer.page._target.md b/new-docs/puppeteer.page._target.md
deleted file mode 100644
index f1afe833dda..00000000000
--- a/new-docs/puppeteer.page._target.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_target](./puppeteer.page._target.md)
-
-## Page.\_target property
-
-Signature:
-
-```typescript
-_target: Target;
-```
diff --git a/new-docs/puppeteer.page._timeoutsettings.md b/new-docs/puppeteer.page._timeoutsettings.md
deleted file mode 100644
index 5d2a310363e..00000000000
--- a/new-docs/puppeteer.page._timeoutsettings.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_timeoutSettings](./puppeteer.page._timeoutsettings.md)
-
-## Page.\_timeoutSettings property
-
-Signature:
-
-```typescript
-_timeoutSettings: TimeoutSettings;
-```
diff --git a/new-docs/puppeteer.page._touchscreen.md b/new-docs/puppeteer.page._touchscreen.md
deleted file mode 100644
index 438c92b85fd..00000000000
--- a/new-docs/puppeteer.page._touchscreen.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_touchscreen](./puppeteer.page._touchscreen.md)
-
-## Page.\_touchscreen property
-
-Signature:
-
-```typescript
-_touchscreen: Touchscreen;
-```
diff --git a/new-docs/puppeteer.page._tracing.md b/new-docs/puppeteer.page._tracing.md
deleted file mode 100644
index 84f21c3d7a1..00000000000
--- a/new-docs/puppeteer.page._tracing.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_tracing](./puppeteer.page._tracing.md)
-
-## Page.\_tracing property
-
-Signature:
-
-```typescript
-_tracing: Tracing;
-```
diff --git a/new-docs/puppeteer.page._viewport.md b/new-docs/puppeteer.page._viewport.md
deleted file mode 100644
index 09eed122b23..00000000000
--- a/new-docs/puppeteer.page._viewport.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_viewport](./puppeteer.page._viewport.md)
-
-## Page.\_viewport property
-
-Signature:
-
-```typescript
-_viewport: Viewport | null;
-```
diff --git a/new-docs/puppeteer.page._workers.md b/new-docs/puppeteer.page._workers.md
deleted file mode 100644
index ef919d619dd..00000000000
--- a/new-docs/puppeteer.page._workers.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_workers](./puppeteer.page._workers.md)
-
-## Page.\_workers property
-
-Signature:
-
-```typescript
-_workers: Map;
-```
diff --git a/new-docs/puppeteer.page._initialize.md b/new-docs/puppeteer.page.isjavascriptenabled.md
similarity index 52%
rename from new-docs/puppeteer.page._initialize.md
rename to new-docs/puppeteer.page.isjavascriptenabled.md
index a3c2b4559c0..8cc5a92c7b9 100644
--- a/new-docs/puppeteer.page._initialize.md
+++ b/new-docs/puppeteer.page.isjavascriptenabled.md
@@ -1,15 +1,15 @@
-[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [\_initialize](./puppeteer.page._initialize.md)
+[Home](./index.md) > [puppeteer](./puppeteer.md) > [Page](./puppeteer.page.md) > [isJavaScriptEnabled](./puppeteer.page.isjavascriptenabled.md)
-## Page.\_initialize() method
+## Page.isJavaScriptEnabled() method
Signature:
```typescript
-_initialize(): Promise;
+isJavaScriptEnabled(): boolean;
```
Returns:
-Promise<void>
+boolean
diff --git a/new-docs/puppeteer.page.md b/new-docs/puppeteer.page.md
index 759c3c60b78..7b13611700b 100644
--- a/new-docs/puppeteer.page.md
+++ b/new-docs/puppeteer.page.md
@@ -20,25 +20,6 @@ export declare class Page extends EventEmitter
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
-| [\_accessibility](./puppeteer.page._accessibility.md) | | [Accessibility](./puppeteer.accessibility.md) | |
-| [\_client](./puppeteer.page._client.md) | | [CDPSession](./puppeteer.cdpsession.md) | |
-| [\_closed](./puppeteer.page._closed.md) | | boolean | |
-| [\_coverage](./puppeteer.page._coverage.md) | | [Coverage](./puppeteer.coverage.md) | |
-| [\_disconnectPromise](./puppeteer.page._disconnectpromise.md) | | Promise<Error> | |
-| [\_emulationManager](./puppeteer.page._emulationmanager.md) | | EmulationManager | |
-| [\_fileChooserInterceptors](./puppeteer.page._filechooserinterceptors.md) | | Set<Function> | |
-| [\_frameManager](./puppeteer.page._framemanager.md) | | [FrameManager](./puppeteer.framemanager.md) | |
-| [\_javascriptEnabled](./puppeteer.page._javascriptenabled.md) | | boolean | |
-| [\_keyboard](./puppeteer.page._keyboard.md) | | [Keyboard](./puppeteer.keyboard.md) | |
-| [\_mouse](./puppeteer.page._mouse.md) | | [Mouse](./puppeteer.mouse.md) | |
-| [\_pageBindings](./puppeteer.page._pagebindings.md) | | Map<string, Function> | |
-| [\_screenshotTaskQueue](./puppeteer.page._screenshottaskqueue.md) | | ScreenshotTaskQueue | |
-| [\_target](./puppeteer.page._target.md) | | [Target](./puppeteer.target.md) | |
-| [\_timeoutSettings](./puppeteer.page._timeoutsettings.md) | | TimeoutSettings | |
-| [\_touchscreen](./puppeteer.page._touchscreen.md) | | [Touchscreen](./puppeteer.touchscreen.md) | |
-| [\_tracing](./puppeteer.page._tracing.md) | | [Tracing](./puppeteer.tracing.md) | |
-| [\_viewport](./puppeteer.page._viewport.md) | | Viewport \| null | |
-| [\_workers](./puppeteer.page._workers.md) | | Map<string, [WebWorker](./puppeteer.webworker.md)> | |
| [accessibility](./puppeteer.page.accessibility.md) | | [Accessibility](./puppeteer.accessibility.md) | |
| [coverage](./puppeteer.page.coverage.md) | | [Coverage](./puppeteer.coverage.md) | |
| [keyboard](./puppeteer.page.keyboard.md) | | [Keyboard](./puppeteer.keyboard.md) | |
@@ -50,20 +31,10 @@ export declare class Page extends EventEmitter
| Method | Modifiers | Description |
| --- | --- | --- |
-| [\_addConsoleMessage(type, args, stackTrace)](./puppeteer.page._addconsolemessage.md) | | |
-| [\_buildMetricsObject(metrics)](./puppeteer.page._buildmetricsobject.md) | | |
-| [\_emitMetrics(event)](./puppeteer.page._emitmetrics.md) | | |
| [\_go(delta, options)](./puppeteer.page._go.md) | | |
-| [\_handleException(exceptionDetails)](./puppeteer.page._handleexception.md) | | |
-| [\_initialize()](./puppeteer.page._initialize.md) | | |
-| [\_onBindingCalled(event)](./puppeteer.page._onbindingcalled.md) | | |
-| [\_onConsoleAPI(event)](./puppeteer.page._onconsoleapi.md) | | |
-| [\_onDialog(event)](./puppeteer.page._ondialog.md) | | |
-| [\_onFileChooser(event)](./puppeteer.page._onfilechooser.md) | | |
| [\_onLogEntryAdded(event)](./puppeteer.page._onlogentryadded.md) | | |
| [\_onTargetCrashed()](./puppeteer.page._ontargetcrashed.md) | | |
| [\_screenshotTask(format, options)](./puppeteer.page._screenshottask.md) | | |
-| [\_sessionClosePromise()](./puppeteer.page._sessionclosepromise.md) | | |
| [$(selector)](./puppeteer.page._.md) | | |
| [$$(selector)](./puppeteer.page.__.md) | | |
| [$$eval(selector, pageFunction, args)](./puppeteer.page.__eval.md) | | |
@@ -97,6 +68,7 @@ export declare class Page extends EventEmitter
| [goto(url, options)](./puppeteer.page.goto.md) | | |
| [hover(selector)](./puppeteer.page.hover.md) | | |
| [isClosed()](./puppeteer.page.isclosed.md) | | |
+| [isJavaScriptEnabled()](./puppeteer.page.isjavascriptenabled.md) | | |
| [mainFrame()](./puppeteer.page.mainframe.md) | | |
| [metrics()](./puppeteer.page.metrics.md) | | |
| [pdf(options)](./puppeteer.page.pdf.md) | | |
diff --git a/src/JSHandle.ts b/src/JSHandle.ts
index 39e66d6a344..867707a32c9 100644
--- a/src/JSHandle.ts
+++ b/src/JSHandle.ts
@@ -219,7 +219,7 @@ export class ElementHandle extends JSHandle {
}
return false;
},
- this._page._javascriptEnabled
+ this._page.isJavaScriptEnabled()
);
if (error) throw new Error(error);
diff --git a/src/Page.ts b/src/Page.ts
index 04270805ac3..d64c8f98876 100644
--- a/src/Page.ts
+++ b/src/Page.ts
@@ -166,27 +166,27 @@ export class Page extends EventEmitter {
return page;
}
- _closed = false;
- _client: CDPSession;
- _target: Target;
- _keyboard: Keyboard;
- _mouse: Mouse;
- _timeoutSettings = new TimeoutSettings();
- _touchscreen: Touchscreen;
- _accessibility: Accessibility;
- _frameManager: FrameManager;
- _emulationManager: EmulationManager;
- _tracing: Tracing;
- _pageBindings = new Map();
- _coverage: Coverage;
- _javascriptEnabled = true;
- _viewport: Viewport | null;
- _screenshotTaskQueue: ScreenshotTaskQueue;
- _workers = new Map();
+ private _closed = false;
+ private _client: CDPSession;
+ private _target: Target;
+ private _keyboard: Keyboard;
+ private _mouse: Mouse;
+ private _timeoutSettings = new TimeoutSettings();
+ private _touchscreen: Touchscreen;
+ private _accessibility: Accessibility;
+ private _frameManager: FrameManager;
+ private _emulationManager: EmulationManager;
+ private _tracing: Tracing;
+ private _pageBindings = new Map();
+ private _coverage: Coverage;
+ private _javascriptEnabled = true;
+ private _viewport: Viewport | null;
+ private _screenshotTaskQueue: ScreenshotTaskQueue;
+ private _workers = new Map();
// TODO: improve this typedef - it's a function that takes a file chooser or something?
- _fileChooserInterceptors = new Set();
+ private _fileChooserInterceptors = new Set();
- _disconnectPromise?: Promise;
+ private _disconnectPromise?: Promise;
constructor(client: CDPSession, target: Target, ignoreHTTPSErrors: boolean) {
super();
@@ -280,7 +280,7 @@ export class Page extends EventEmitter {
});
}
- async _initialize(): Promise {
+ private async _initialize(): Promise {
await Promise.all([
this._frameManager.initialize(),
this._client.send('Target.setAutoAttach', {
@@ -293,7 +293,7 @@ export class Page extends EventEmitter {
]);
}
- async _onFileChooser(
+ private async _onFileChooser(
event: Protocol.Page.fileChooserOpenedPayload
): Promise {
if (!this._fileChooserInterceptors.size) return;
@@ -306,6 +306,10 @@ export class Page extends EventEmitter {
for (const interceptor of interceptors) interceptor.call(null, fileChooser);
}
+ public isJavaScriptEnabled(): boolean {
+ return this._javascriptEnabled;
+ }
+
async waitForFileChooser(
options: { timeout?: number } = {}
): Promise {
@@ -597,14 +601,16 @@ export class Page extends EventEmitter {
return this._buildMetricsObject(response.metrics);
}
- _emitMetrics(event: Protocol.Performance.metricsPayload): void {
+ private _emitMetrics(event: Protocol.Performance.metricsPayload): void {
this.emit(Events.Page.Metrics, {
title: event.title,
metrics: this._buildMetricsObject(event.metrics),
});
}
- _buildMetricsObject(metrics?: Protocol.Performance.Metric[]): Metrics {
+ private _buildMetricsObject(
+ metrics?: Protocol.Performance.Metric[]
+ ): Metrics {
const result = {};
for (const metric of metrics || []) {
if (supportedMetrics.has(metric.name)) result[metric.name] = metric.value;
@@ -612,14 +618,16 @@ export class Page extends EventEmitter {
return result;
}
- _handleException(exceptionDetails: Protocol.Runtime.ExceptionDetails): void {
+ private _handleException(
+ exceptionDetails: Protocol.Runtime.ExceptionDetails
+ ): void {
const message = helper.getExceptionMessage(exceptionDetails);
const err = new Error(message);
err.stack = ''; // Don't report clientside error with a node stack attached
this.emit(Events.Page.PageError, err);
}
- async _onConsoleAPI(
+ private async _onConsoleAPI(
event: Protocol.Runtime.consoleAPICalledPayload
): Promise {
if (event.executionContextId === 0) {
@@ -645,7 +653,7 @@ export class Page extends EventEmitter {
this._addConsoleMessage(event.type, values, event.stackTrace);
}
- async _onBindingCalled(
+ private async _onBindingCalled(
event: Protocol.Runtime.bindingCalledPayload
): Promise {
const { name, seq, args } = JSON.parse(event.payload);
@@ -704,7 +712,7 @@ export class Page extends EventEmitter {
}
}
- _addConsoleMessage(
+ private _addConsoleMessage(
type: string,
args: JSHandle[],
stackTrace?: Protocol.Runtime.StackTrace
@@ -736,7 +744,7 @@ export class Page extends EventEmitter {
this.emit(Events.Page.Console, message);
}
- _onDialog(event: Protocol.Page.javascriptDialogOpeningPayload): void {
+ private _onDialog(event: Protocol.Page.javascriptDialogOpeningPayload): void {
let dialogType = null;
const validDialogTypes = new Set([
'alert',
@@ -793,7 +801,7 @@ export class Page extends EventEmitter {
return await this._frameManager.mainFrame().waitForNavigation(options);
}
- _sessionClosePromise(): Promise {
+ private _sessionClosePromise(): Promise {
if (!this._disconnectPromise)
this._disconnectPromise = new Promise((fulfill) =>
this._client.once(Events.CDPSession.Disconnected, () =>