chrome-devtools-frontend 1.0.1040337 → 1.0.1070764
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +4 -1
- package/README.md +4 -10
- package/config/gni/devtools_grd_files.gni +41 -25
- package/config/gni/devtools_image_files.gni +4 -0
- package/docs/README.md +81 -0
- package/{ARCHITECTURE.md → docs/architecture_of_devtools.md} +5 -6
- package/docs/{images/architecture-lazy-loading-features.png → architecture_of_devtools_lazy_loading_features.png} +0 -0
- package/docs/{images/module-visibility-rules.png → architecture_of_devtools_module_visibility_rules.png} +0 -0
- package/docs/design_guidelines.md +3 -1
- package/docs/{images/DevToolsDesignGuidelines.png → design_guidelines.png} +0 -0
- package/docs/l10n.md +293 -0
- package/docs/navbar.md +13 -0
- package/docs/third_party_guidelines.md +78 -0
- package/docs/workflows.md +6 -1
- package/extension-api/ExtensionAPI.d.ts +1 -0
- package/front_end/Images/src/edit-icon.svg +3 -0
- package/front_end/Images/src/frame-embedded-icon.svg +61 -0
- package/front_end/Images/src/frame-icon.svg +54 -0
- package/front_end/Images/src/trash_bin_material_icon.svg +1 -0
- package/front_end/Images/src/triangle-expanded.svg +1 -1
- package/front_end/Tests.js +0 -25
- package/front_end/core/common/ResourceType.ts +7 -1
- package/front_end/core/common/Revealer.ts +3 -0
- package/front_end/core/common/common.ts +2 -0
- package/front_end/core/dom_extension/DOMExtension.ts +1 -138
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +15 -5
- package/front_end/core/host/UserMetrics.ts +43 -10
- package/front_end/core/i18n/locales/af.json +194 -110
- package/front_end/core/i18n/locales/am.json +205 -121
- package/front_end/core/i18n/locales/ar.json +196 -112
- package/front_end/core/i18n/locales/as.json +195 -111
- package/front_end/core/i18n/locales/az.json +196 -112
- package/front_end/core/i18n/locales/be.json +193 -109
- package/front_end/core/i18n/locales/bg.json +193 -109
- package/front_end/core/i18n/locales/bn.json +197 -113
- package/front_end/core/i18n/locales/bs.json +194 -110
- package/front_end/core/i18n/locales/ca.json +197 -113
- package/front_end/core/i18n/locales/cs.json +192 -108
- package/front_end/core/i18n/locales/cy.json +193 -109
- package/front_end/core/i18n/locales/da.json +194 -110
- package/front_end/core/i18n/locales/de.json +199 -115
- package/front_end/core/i18n/locales/el.json +191 -107
- package/front_end/core/i18n/locales/en-GB.json +193 -109
- package/front_end/core/i18n/locales/en-US.json +323 -233
- package/front_end/core/i18n/locales/en-XL.json +323 -233
- package/front_end/core/i18n/locales/es-419.json +195 -111
- package/front_end/core/i18n/locales/es.json +192 -108
- package/front_end/core/i18n/locales/et.json +195 -111
- package/front_end/core/i18n/locales/eu.json +197 -113
- package/front_end/core/i18n/locales/fa.json +243 -159
- package/front_end/core/i18n/locales/fi.json +192 -108
- package/front_end/core/i18n/locales/fil.json +193 -109
- package/front_end/core/i18n/locales/fr-CA.json +198 -114
- package/front_end/core/i18n/locales/fr.json +220 -136
- package/front_end/core/i18n/locales/gl.json +196 -112
- package/front_end/core/i18n/locales/gu.json +196 -112
- package/front_end/core/i18n/locales/he.json +201 -117
- package/front_end/core/i18n/locales/hi.json +200 -116
- package/front_end/core/i18n/locales/hr.json +192 -108
- package/front_end/core/i18n/locales/hu.json +195 -111
- package/front_end/core/i18n/locales/hy.json +193 -109
- package/front_end/core/i18n/locales/id.json +198 -114
- package/front_end/core/i18n/locales/is.json +193 -109
- package/front_end/core/i18n/locales/it.json +194 -110
- package/front_end/core/i18n/locales/ja.json +192 -108
- package/front_end/core/i18n/locales/ka.json +194 -110
- package/front_end/core/i18n/locales/kk.json +194 -110
- package/front_end/core/i18n/locales/km.json +196 -112
- package/front_end/core/i18n/locales/kn.json +193 -109
- package/front_end/core/i18n/locales/ko.json +196 -112
- package/front_end/core/i18n/locales/ky.json +196 -112
- package/front_end/core/i18n/locales/lo.json +196 -112
- package/front_end/core/i18n/locales/lt.json +192 -108
- package/front_end/core/i18n/locales/lv.json +194 -110
- package/front_end/core/i18n/locales/mk.json +194 -110
- package/front_end/core/i18n/locales/ml.json +194 -110
- package/front_end/core/i18n/locales/mn.json +194 -110
- package/front_end/core/i18n/locales/mr.json +193 -109
- package/front_end/core/i18n/locales/ms.json +193 -109
- package/front_end/core/i18n/locales/my.json +198 -114
- package/front_end/core/i18n/locales/ne.json +197 -113
- package/front_end/core/i18n/locales/nl.json +193 -109
- package/front_end/core/i18n/locales/no.json +195 -111
- package/front_end/core/i18n/locales/or.json +197 -113
- package/front_end/core/i18n/locales/pa.json +195 -111
- package/front_end/core/i18n/locales/pl.json +195 -111
- package/front_end/core/i18n/locales/pt-PT.json +195 -111
- package/front_end/core/i18n/locales/pt.json +194 -110
- package/front_end/core/i18n/locales/ro.json +189 -105
- package/front_end/core/i18n/locales/ru.json +191 -107
- package/front_end/core/i18n/locales/si.json +194 -110
- package/front_end/core/i18n/locales/sk.json +192 -108
- package/front_end/core/i18n/locales/sl.json +193 -109
- package/front_end/core/i18n/locales/sq.json +193 -109
- package/front_end/core/i18n/locales/sr-Latn.json +192 -108
- package/front_end/core/i18n/locales/sr.json +192 -108
- package/front_end/core/i18n/locales/sv.json +191 -107
- package/front_end/core/i18n/locales/sw.json +195 -111
- package/front_end/core/i18n/locales/ta.json +193 -109
- package/front_end/core/i18n/locales/te.json +198 -114
- package/front_end/core/i18n/locales/th.json +194 -110
- package/front_end/core/i18n/locales/tr.json +192 -108
- package/front_end/core/i18n/locales/uk.json +192 -108
- package/front_end/core/i18n/locales/ur.json +194 -110
- package/front_end/core/i18n/locales/uz.json +190 -106
- package/front_end/core/i18n/locales/vi.json +195 -111
- package/front_end/core/i18n/locales/zh-HK.json +193 -109
- package/front_end/core/i18n/locales/zh-TW.json +195 -111
- package/front_end/core/i18n/locales/zh.json +194 -110
- package/front_end/core/i18n/locales/zu.json +193 -109
- package/front_end/core/platform/dom-utilities.ts +107 -0
- package/front_end/core/platform/keyboard-utilities.ts +8 -0
- package/front_end/core/platform/string-utilities.ts +10 -0
- package/front_end/core/root/Runtime.ts +0 -2
- package/front_end/core/sdk/CPUProfileDataModel.ts +11 -4
- package/front_end/core/sdk/CPUThrottlingManager.ts +1 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +11 -12
- package/front_end/core/sdk/ChildTargetManager.ts +1 -1
- package/front_end/core/sdk/ConsoleModel.ts +3 -3
- package/front_end/core/sdk/DOMModel.ts +0 -1
- package/front_end/core/sdk/DebuggerModel.ts +4 -36
- package/front_end/core/sdk/FrameManager.ts +12 -33
- package/front_end/core/sdk/NetworkManager.ts +50 -16
- package/front_end/core/sdk/NetworkRequest.ts +49 -0
- package/front_end/core/sdk/ProfileTreeModel.ts +19 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +31 -32
- package/front_end/core/sdk/RuntimeModel.ts +1 -1
- package/front_end/core/sdk/ScreenCaptureModel.ts +27 -3
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMap.ts +14 -8
- package/front_end/core/sdk/SourceMapManager.ts +8 -6
- package/front_end/core/sdk/Target.ts +3 -3
- package/front_end/core/sdk/TargetManager.ts +12 -1
- package/front_end/core/sdk/sdk-legacy.ts +3 -0
- package/front_end/core/sdk/sdk-meta.ts +21 -0
- package/front_end/devtools_compatibility.js +17 -13
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -3
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -53
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +1 -0
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +0 -9
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +0 -4
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +5 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +35 -0
- package/front_end/entrypoints/js_app/js_app.ts +1 -0
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +17 -9
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +31 -38
- package/front_end/entrypoints/main/main-meta.ts +0 -2
- package/front_end/entrypoints/node_app/node_app.ts +2 -1
- package/front_end/entrypoints/shell/shell.ts +1 -2
- package/front_end/generated/ARIAProperties.js +8 -0
- package/front_end/generated/InspectorBackendCommands.js +32 -23
- package/front_end/generated/SupportedCSSProperties.js +97 -48
- package/front_end/generated/protocol-mapping.d.ts +67 -34
- package/front_end/generated/protocol-proxy-api.d.ts +52 -29
- package/front_end/generated/protocol.ts +344 -89
- package/front_end/legacy/legacy-defs.d.ts +1 -3
- package/front_end/legacy_test_runner/network_test_runner/network_test_runner.js +1 -1
- package/front_end/legacy_test_runner/performance_test_runner/TimelineTestRunner.js +10 -18
- package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +3 -3
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +24 -0
- package/front_end/legacy_test_runner/test_runner/test_runner.js +15 -13
- package/front_end/models/bindings/BreakpointManager.ts +38 -21
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +19 -18
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +32 -37
- package/front_end/models/bindings/FileUtils.ts +3 -3
- package/front_end/models/bindings/IgnoreListManager.ts +14 -3
- package/front_end/models/bindings/ResourceMapping.ts +5 -28
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -13
- package/front_end/models/bindings/ResourceUtils.ts +1 -2
- package/front_end/models/emulation/DeviceModeModel.ts +11 -13
- package/front_end/models/extensions/ExtensionAPI.ts +22 -5
- package/front_end/models/extensions/ExtensionServer.ts +31 -14
- package/front_end/models/formatter/FormatterWorkerPool.ts +0 -31
- package/front_end/models/har/HARFormat.ts +68 -5
- package/front_end/models/har/Importer.ts +3 -5
- package/front_end/models/har/Log.ts +3 -0
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +24 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +113 -33
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +0 -10
- package/front_end/models/issues_manager/IssuesManager.ts +3 -12
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +5 -6
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyNotDelegated.md +11 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +121 -97
- package/front_end/models/logs/NetworkLog.ts +11 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +5 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +13 -5
- package/front_end/models/persistence/PersistenceImpl.ts +2 -1
- package/front_end/models/source_map_scopes/NamesResolver.ts +99 -56
- package/front_end/models/text_utils/TextUtils.ts +18 -34
- package/front_end/models/text_utils/text_utils-legacy.ts +0 -3
- package/front_end/models/timeline_model/TimelineModel.ts +2 -2
- package/front_end/models/timeline_model/timeline_model-legacy.ts +0 -9
- package/front_end/models/timeline_model/timeline_model.ts +0 -3
- package/front_end/models/workspace/UISourceCode.ts +12 -6
- package/front_end/panels/accessibility/ARIAAttributesView.ts +2 -1
- package/front_end/panels/application/AppManifestView.ts +15 -7
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +2 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +15 -9
- package/front_end/panels/application/DOMStorageModel.ts +16 -18
- package/front_end/panels/application/IndexedDBModel.ts +97 -134
- package/front_end/panels/application/IndexedDBViews.ts +1 -3
- package/front_end/panels/application/InterestGroupStorageModel.ts +3 -0
- package/front_end/panels/application/InterestGroupTreeElement.ts +1 -1
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -1
- package/front_end/panels/application/ReportingApiView.ts +5 -4
- package/front_end/panels/application/StorageView.ts +30 -26
- package/front_end/panels/application/TrustTokensTreeElement.ts +5 -4
- package/front_end/panels/application/application.ts +6 -0
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +6 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +149 -92
- package/front_end/panels/application/components/FrameDetailsView.ts +66 -7
- package/front_end/panels/application/components/OriginTrialTreeView.ts +0 -5
- package/front_end/panels/application/components/Prerender2.ts +74 -14
- package/front_end/panels/application/components/ProtocolHandlersView.ts +6 -1
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +184 -0
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +173 -0
- package/front_end/panels/application/components/backForwardCacheView.css +2 -3
- package/front_end/panels/application/components/components.ts +4 -0
- package/front_end/panels/application/components/frameDetailsReportView.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/components/protocolHandlersView.css +5 -1
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +26 -0
- package/front_end/panels/application/components/sharedStorageMetadataView.css +11 -0
- package/front_end/panels/application/components/stackTraceLinkButton.css +1 -1
- package/front_end/panels/application/components/stackTraceRow.css +1 -1
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -1
- package/front_end/panels/console/ConsoleFormat.ts +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +1 -1
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +1 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/consoleView.css +5 -0
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +6 -24
- package/front_end/panels/developer_resources/developer_resources-meta.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +147 -65
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +32 -2
- package/front_end/panels/elements/ClassesPaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +19 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +3 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +9 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +46 -19
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +1 -2
- package/front_end/panels/elements/components/CSSPropertyIconResolver.ts +2 -3
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +19 -2
- package/front_end/panels/elements/components/computedStyleProperty.css +3 -3
- package/front_end/panels/elements/components/computedStyleTrace.css +8 -4
- package/front_end/panels/elements/components/cssHintDetailsView.css +2 -8
- package/front_end/panels/elements/elements-meta.ts +28 -0
- package/front_end/panels/elements/stylesSectionTree.css +2 -1
- package/front_end/panels/elements/stylesSidebarPane.css +7 -0
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -0
- package/front_end/panels/issues/IssueView.ts +5 -4
- package/front_end/panels/js_profiler/js_profiler-meta.ts +139 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -9
- package/front_end/panels/lighthouse/LighthousePanel.ts +38 -32
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +16 -15
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +3 -3
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +6 -1
- package/front_end/panels/lighthouse/LighthouseReporterTypes.ts +3 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +162 -89
- package/front_end/panels/lighthouse/lighthouseStartView.css +7 -36
- package/front_end/panels/media/TickingFlameChart.ts +9 -3
- package/front_end/panels/network/NetworkDataGridNode.ts +79 -9
- package/front_end/panels/network/NetworkItemView.ts +4 -3
- package/front_end/panels/network/NetworkLogView.ts +40 -42
- package/front_end/panels/network/NetworkLogViewColumns.ts +2 -1
- package/front_end/panels/network/RequestCookiesView.ts +28 -0
- package/front_end/panels/network/components/HeaderSectionRow.css +176 -0
- package/front_end/panels/network/components/HeaderSectionRow.ts +477 -0
- package/front_end/panels/network/components/RequestHeaderSection.css +59 -0
- package/front_end/panels/network/components/RequestHeaderSection.ts +133 -0
- package/front_end/panels/network/components/RequestHeadersView.css +1 -59
- package/front_end/panels/network/components/RequestHeadersView.ts +43 -417
- package/front_end/panels/network/components/ResponseHeaderSection.css +21 -0
- package/front_end/panels/network/components/ResponseHeaderSection.ts +635 -0
- package/front_end/panels/network/components/components.ts +6 -0
- package/front_end/panels/network/network-meta.ts +0 -16
- package/front_end/panels/network/requestPayloadTree.css +0 -1
- package/front_end/panels/profiler/HeapProfileView.ts +7 -6
- package/front_end/panels/profiler/LiveHeapProfileView.ts +2 -2
- package/front_end/panels/sensors/sensors-meta.ts +0 -10
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +61 -43
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -3
- package/front_end/panels/settings/components/syncSection.css +1 -1
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +38 -35
- package/front_end/panels/sources/BreakpointsSidebarPane.ts +433 -14
- package/front_end/panels/sources/CallStackSidebarPane.ts +10 -1
- package/front_end/panels/sources/CoveragePlugin.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +316 -109
- package/front_end/panels/sources/GoToLineQuickOpen.ts +22 -49
- package/front_end/panels/sources/NavigatorView.ts +2 -10
- package/front_end/panels/sources/OpenFileQuickOpen.ts +0 -13
- package/front_end/panels/sources/OutlineQuickOpen.ts +274 -45
- package/front_end/panels/sources/SourcesNavigator.ts +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +13 -9
- package/front_end/panels/sources/SourcesView.ts +8 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +8 -0
- package/front_end/panels/sources/UISourceCodeFrame.ts +81 -34
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -2
- package/front_end/panels/sources/components/BreakpointsView.ts +472 -28
- package/front_end/panels/sources/components/BreakpointsViewUtils.ts +195 -0
- package/front_end/panels/sources/components/HeadersView.css +5 -1
- package/front_end/panels/sources/components/HeadersView.ts +18 -11
- package/front_end/panels/sources/components/breakpointsView.css +136 -11
- package/front_end/panels/sources/sources-legacy.ts +0 -5
- package/front_end/panels/sources/sources-meta.ts +114 -5
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +10 -6
- package/front_end/panels/timeline/PerformanceModel.ts +65 -18
- package/front_end/panels/timeline/TimelineController.ts +11 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -49
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineLoader.ts +41 -24
- package/front_end/panels/timeline/TimelinePanel.ts +155 -57
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -263
- package/front_end/panels/webauthn/WebauthnPane.ts +2 -2
- package/front_end/panels/webauthn/webauthnPane.css +1 -0
- package/front_end/services/puppeteer/PuppeteerConnection.ts +51 -42
- package/front_end/third_party/additional_readme_paths.json +0 -1
- package/front_end/third_party/chromium/client-variations/ClientVariations.js +1 -1
- package/front_end/third_party/codemirror.next/bundle.ts +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +7 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -2
- package/front_end/third_party/i18n/localized-string-set.ts +9 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +431 -434
- package/front_end/third_party/lighthouse/locales/en-US.json +144 -186
- package/front_end/third_party/lighthouse/locales/en-XL.json +144 -186
- package/front_end/third_party/puppeteer/README.chromium +14 -6
- package/front_end/third_party/puppeteer/package/README.md +134 -316
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +337 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +248 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +148 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js +135 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +2100 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +536 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +39 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +17 -199
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +112 -202
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +5 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Configuration.d.ts +133 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Configuration.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/{esm/puppeteer/initializePuppeteer.d.ts → cjs/puppeteer/common/Configuration.js} +4 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Configuration.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +24 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +67 -28
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +11 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js +7 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +52 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{DeviceDescriptors.js → Device.js} +17 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts +29 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js +69 -46
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +27 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +47 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +2 -36
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js +20 -59
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts +47 -21
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js +155 -43
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +7 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +47 -97
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameTree.d.ts +39 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameTree.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameTree.js +120 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameTree.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.d.ts +13 -67
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.js +124 -511
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +5 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +7 -9
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{esm/puppeteer/node/install.d.ts → cjs/puppeteer/common/LazyArg.d.ts} +7 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LazyArg.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LazyArg.js +45 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LazyArg.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +12 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{esm/puppeteer/node → cjs/puppeteer/common}/NodeWebSocketTransport.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NodeWebSocketTransport.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/{node → common}/NodeWebSocketTransport.js +1 -15
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NodeWebSocketTransport.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +35 -496
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +287 -414
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{esm/puppeteer/common/NetworkConditions.d.ts → cjs/puppeteer/common/PredefinedNetworkConditions.d.ts} +13 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PredefinedNetworkConditions.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{NetworkConditions.js → PredefinedNetworkConditions.js} +12 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PredefinedNetworkConditions.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +36 -61
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js +32 -66
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +26 -34
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js +57 -94
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts +52 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js +204 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js +23 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Browser.d.ts +45 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Browser.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Browser.js +75 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Browser.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/BrowserContext.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/BrowserContext.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/BrowserContext.js +52 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/BrowserContext.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/{esm/puppeteer/puppeteer.js → cjs/puppeteer/common/bidi/Connection.d.ts} +20 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Connection.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Connection.js +133 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Connection.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Page.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Page.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Page.js +61 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/bidi/Page.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/types.d.ts +11 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +25 -59
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +8 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/PierceQuerySelector.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/PierceQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/PierceQuerySelector.js +71 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/PierceQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts +32 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js +30 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextContent.d.ts +39 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextContent.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextContent.js +133 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextContent.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextQuerySelector.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextQuerySelector.js +80 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/TextQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.d.ts +24 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js +42 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/XPathQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +44 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js +52 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/util.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/util.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/util.js +58 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/util.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts +50 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js +137 -154
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +6 -18
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +88 -28
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.d.ts +4 -18
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js +40 -33
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js +1 -16
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ProductLauncher.d.ts +24 -22
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ProductLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ProductLauncher.js +94 -130
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ProductLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/{Puppeteer.d.ts → PuppeteerNode.d.ts} +74 -43
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +271 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer-core.d.ts +21 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer-core.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer-core.js +22 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer-core.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts +24 -18
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js +25 -22
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DebuggableDeferredPromise.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DebuggableDeferredPromise.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DebuggableDeferredPromise.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DebuggableDeferredPromise.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts +12 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js +17 -44
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/mitt/index.d.ts +23 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/mitt/index.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +337 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +244 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +148 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js +131 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2100 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +532 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +39 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +17 -199
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +108 -198
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Configuration.d.ts +133 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Configuration.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/{cjs/puppeteer/initializePuppeteer.d.ts → esm/puppeteer/common/Configuration.js} +3 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Configuration.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +24 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +63 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +11 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +7 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +52 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{DeviceDescriptors.js → Device.js} +16 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts +29 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js +69 -46
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +27 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +47 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +2 -36
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +20 -59
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts +47 -21
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js +132 -43
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +7 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +47 -97
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameTree.d.ts +39 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameTree.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameTree.js +116 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameTree.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.d.ts +13 -67
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.js +124 -487
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +5 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +7 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{cjs/puppeteer/node/install.d.ts → esm/puppeteer/common/LazyArg.d.ts} +7 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LazyArg.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LazyArg.js +41 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LazyArg.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +12 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{cjs/puppeteer/node → esm/puppeteer/common}/NodeWebSocketTransport.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NodeWebSocketTransport.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/{node → common}/NodeWebSocketTransport.js +1 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NodeWebSocketTransport.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +35 -496
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +287 -414
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/{cjs/puppeteer/common/NetworkConditions.d.ts → esm/puppeteer/common/PredefinedNetworkConditions.d.ts} +13 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PredefinedNetworkConditions.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{NetworkConditions.js → PredefinedNetworkConditions.js} +11 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PredefinedNetworkConditions.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +36 -61
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +33 -67
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +26 -34
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +57 -94
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts +52 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js +199 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +23 -27
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Browser.d.ts +45 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Browser.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Browser.js +71 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Browser.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/BrowserContext.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/BrowserContext.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/BrowserContext.js +48 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/BrowserContext.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Connection.d.ts +37 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Connection.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Connection.js +129 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Connection.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Page.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Page.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Page.js +57 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/bidi/Page.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/types.d.ts +11 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts +0 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +24 -57
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +8 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/PierceQuerySelector.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/PierceQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/PierceQuerySelector.js +66 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/PierceQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts +32 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js +30 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextContent.d.ts +39 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextContent.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextContent.js +128 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextContent.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextQuerySelector.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextQuerySelector.js +75 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/TextQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.d.ts +24 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js +37 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/XPathQuerySelector.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +44 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js +41 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/util.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/util.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/util.js +53 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/util.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +50 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +137 -154
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +14 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +6 -18
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +89 -29
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.d.ts +4 -18
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js +41 -34
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -16
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ProductLauncher.d.ts +24 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ProductLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ProductLauncher.js +70 -124
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ProductLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/{Puppeteer.d.ts → PuppeteerNode.d.ts} +74 -43
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +267 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core.d.ts +21 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core.js +22 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts +24 -18
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js +25 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DebuggableDeferredPromise.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DebuggableDeferredPromise.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DebuggableDeferredPromise.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DebuggableDeferredPromise.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts +12 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js +16 -42
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt/index.d.ts +23 -0
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt/index.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +548 -513
- package/front_end/third_party/puppeteer/package/package.json +125 -104
- package/front_end/third_party/puppeteer/puppeteer.ts +3 -3
- package/front_end/ui/components/buttons/Button.ts +30 -1
- package/front_end/ui/components/buttons/button.css +21 -0
- package/front_end/ui/components/chrome_link/ChromeLink.ts +3 -2
- package/front_end/ui/components/chrome_link/chromeLink.css +1 -1
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +21 -2
- package/front_end/ui/components/docs/button/basic.ts +43 -10
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +2 -0
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +10 -3
- package/front_end/ui/components/docs/two_states_counter/basic.html +27 -0
- package/front_end/ui/components/docs/two_states_counter/basic.ts +45 -0
- package/front_end/ui/components/expandable_list/expandableList.css +1 -1
- package/front_end/ui/components/helpers/scheduled-render.ts +5 -2
- package/front_end/ui/components/icon_button/iconButton.css +2 -0
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +23 -12
- package/front_end/ui/components/linkifier/linkifierImpl.css +1 -0
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +0 -4
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +4 -0
- package/front_end/ui/components/markdown_view/MarkdownView.ts +39 -38
- package/front_end/ui/components/markdown_view/markdownLink.css +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +12 -6
- package/front_end/ui/components/survey_link/surveyLink.css +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +75 -9
- package/front_end/ui/components/text_editor/config.ts +58 -2
- package/front_end/ui/components/text_editor/position.ts +2 -0
- package/front_end/ui/components/text_editor/theme.ts +10 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +4 -0
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -8
- package/front_end/ui/components/tree_outline/treeOutline.css +20 -0
- package/front_end/ui/components/two_states_counter/TwoStatesCounter.ts +103 -0
- package/front_end/ui/components/two_states_counter/twoStatesCounter.css +37 -0
- package/front_end/ui/components/two_states_counter/two_states_counter.ts +9 -0
- package/front_end/ui/legacy/ARIAUtils.ts +4 -1
- package/front_end/ui/legacy/Context.ts +5 -1
- package/front_end/ui/legacy/DockController.ts +19 -0
- package/front_end/ui/legacy/FilterBar.ts +3 -1
- package/front_end/ui/legacy/InspectorView.ts +6 -2
- package/front_end/ui/legacy/ListWidget.ts +5 -1
- package/front_end/ui/legacy/SearchableView.ts +6 -19
- package/front_end/ui/legacy/SoftContextMenu.ts +20 -6
- package/front_end/ui/legacy/TabbedPane.ts +7 -5
- package/front_end/ui/legacy/TextPrompt.ts +1 -2
- package/front_end/ui/legacy/Toolbar.ts +6 -4
- package/front_end/ui/legacy/UIUtils.ts +8 -8
- package/front_end/ui/legacy/XLink.ts +3 -3
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +9 -10
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +7 -6
- package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +9 -2
- package/front_end/ui/legacy/components/inline_editor/CSSLength.ts +10 -2
- package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +22 -9
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +3 -2
- package/front_end/ui/legacy/components/inline_editor/cssLength.css +4 -0
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +15 -9
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +9 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +75 -377
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +3 -14
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +2 -14
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +9 -41
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -2
- package/front_end/ui/legacy/inspectorCommon.css +23 -0
- package/front_end/ui/legacy/inspectorSyntaxHighlight.css +1 -0
- package/front_end/ui/legacy/reportView.css +10 -0
- package/front_end/ui/legacy/softContextMenu.css +11 -1
- package/front_end/ui/legacy/splitWidget.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +26 -4
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +3 -5
- package/front_end/ui/legacy/toolbar.css +7 -1
- package/package.json +2 -1
- package/scripts/eslint_rules/lib/no_only.js +27 -0
- package/scripts/eslint_rules/tests/no_only_test.js +95 -0
- package/docs/localization/README.md +0 -6
- package/docs/localization/adding_strings.md +0 -133
- package/docs/localization/descriptions.md +0 -30
- package/docs/localization/localization_apis.md +0 -80
- package/docs/localization/locked_terms.md +0 -38
- package/docs/testing_guidelines.md +0 -4
- package/docs/triage_guidelines.md +0 -3
- package/front_end/entrypoints/formatter_worker/HTMLOutline.ts +0 -53
- package/front_end/entrypoints/formatter_worker/JavaScriptOutline.ts +0 -153
- package/front_end/legacy_test_runner/lighthouse_test_runner/lighthouse_test_runner.js +0 -155
- package/front_end/models/timeline_model/TimelineIRModel.ts +0 -317
- package/front_end/panels/application/components/originTrialTreeView.css +0 -9
- package/front_end/panels/input/InputModel.ts +0 -213
- package/front_end/panels/input/InputTimeline.ts +0 -407
- package/front_end/panels/input/input-legacy.ts +0 -32
- package/front_end/panels/input/input-meta.ts +0 -130
- package/front_end/panels/input/input.ts +0 -11
- package/front_end/panels/input/inputTimeline.css +0 -16
- package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +0 -179
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +0 -145
- package/front_end/third_party/acorn-loose/README.chromium +0 -22
- package/front_end/third_party/acorn-loose/acorn-loose-tsconfig.json +0 -8
- package/front_end/third_party/acorn-loose/acorn-loose.ts +0 -9
- package/front_end/third_party/acorn-loose/package/CHANGELOG.md +0 -123
- package/front_end/third_party/acorn-loose/package/LICENSE +0 -21
- package/front_end/third_party/acorn-loose/package/README.md +0 -66
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.d.ts +0 -16
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +0 -1538
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js.map +0 -1
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +0 -1528
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs.d.ts +0 -10
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs.map +0 -1
- package/front_end/third_party/acorn-loose/package/package.json +0 -47
- package/front_end/third_party/puppeteer/package/LICENSE +0 -202
- package/front_end/third_party/puppeteer/package/install.js +0 -89
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts +0 -60
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DeviceDescriptors.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkConditions.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkConditions.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.js +0 -21
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/compat.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.d.ts +0 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.js +0 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/constants.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js +0 -47
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +0 -213
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js +0 -198
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/install.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/util.d.ts +0 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/util.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/util.js +0 -40
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/util.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.d.ts +0 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.js +0 -44
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/puppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js +0 -19
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/vendor/mitt/src/index.d.ts +0 -27
- package/front_end/third_party/puppeteer/package/lib/cjs/vendor/mitt/src/index.js +0 -56
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +0 -60
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkConditions.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkConditions.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/compat.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.d.ts +0 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.js +0 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/constants.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js +0 -43
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +0 -209
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +0 -190
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/util.d.ts +0 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/util.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/util.js +0 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/util.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.d.ts +0 -27
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js +0 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts +0 -27
- package/front_end/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.js +0 -53
- package/front_end/third_party/puppeteer/package/typescript-if-required.js +0 -70
- package/scripts/eslint_rules/lib/render_coordinator_write.js +0 -58
- package/scripts/eslint_rules/tests/render_coordinator_write_test.js +0 -55
@@ -0,0 +1,2100 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2017 Google Inc. All rights reserved.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
/// <reference types="node" />
|
17
|
+
/// <reference types="node" />
|
18
|
+
import { Protocol } from 'devtools-protocol';
|
19
|
+
import type { Readable } from 'stream';
|
20
|
+
import type { Accessibility } from '../common/Accessibility.js';
|
21
|
+
import type { ConsoleMessage } from '../common/ConsoleMessage.js';
|
22
|
+
import type { Coverage } from '../common/Coverage.js';
|
23
|
+
import { Device } from '../common/Device.js';
|
24
|
+
import type { Dialog } from '../common/Dialog.js';
|
25
|
+
import type { ElementHandle } from '../common/ElementHandle.js';
|
26
|
+
import { EventEmitter } from '../common/EventEmitter.js';
|
27
|
+
import type { FileChooser } from '../common/FileChooser.js';
|
28
|
+
import type { Frame, FrameAddScriptTagOptions, FrameAddStyleTagOptions, FrameWaitForFunctionOptions } from '../common/Frame.js';
|
29
|
+
import type { HTTPRequest } from '../common/HTTPRequest.js';
|
30
|
+
import type { HTTPResponse } from '../common/HTTPResponse.js';
|
31
|
+
import type { Keyboard, Mouse, MouseButton, Touchscreen } from '../common/Input.js';
|
32
|
+
import type { WaitForSelectorOptions } from '../common/IsolatedWorld.js';
|
33
|
+
import type { JSHandle } from '../common/JSHandle.js';
|
34
|
+
import type { PuppeteerLifeCycleEvent } from '../common/LifecycleWatcher.js';
|
35
|
+
import type { Credentials, NetworkConditions } from '../common/NetworkManager.js';
|
36
|
+
import type { PDFOptions } from '../common/PDFOptions.js';
|
37
|
+
import type { Viewport } from '../common/PuppeteerViewport.js';
|
38
|
+
import type { Target } from '../common/Target.js';
|
39
|
+
import type { Tracing } from '../common/Tracing.js';
|
40
|
+
import type { EvaluateFunc, HandleFor, NodeFor } from '../common/types.js';
|
41
|
+
import type { WebWorker } from '../common/WebWorker.js';
|
42
|
+
import type { Browser } from './Browser.js';
|
43
|
+
import type { BrowserContext } from './BrowserContext.js';
|
44
|
+
/**
|
45
|
+
* @public
|
46
|
+
*/
|
47
|
+
export interface Metrics {
|
48
|
+
Timestamp?: number;
|
49
|
+
Documents?: number;
|
50
|
+
Frames?: number;
|
51
|
+
JSEventListeners?: number;
|
52
|
+
Nodes?: number;
|
53
|
+
LayoutCount?: number;
|
54
|
+
RecalcStyleCount?: number;
|
55
|
+
LayoutDuration?: number;
|
56
|
+
RecalcStyleDuration?: number;
|
57
|
+
ScriptDuration?: number;
|
58
|
+
TaskDuration?: number;
|
59
|
+
JSHeapUsedSize?: number;
|
60
|
+
JSHeapTotalSize?: number;
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* @public
|
64
|
+
*/
|
65
|
+
export interface WaitTimeoutOptions {
|
66
|
+
/**
|
67
|
+
* Maximum wait time in milliseconds. Pass 0 to disable the timeout.
|
68
|
+
*
|
69
|
+
* The default value can be changed by using the
|
70
|
+
* {@link Page.setDefaultTimeout} method.
|
71
|
+
*
|
72
|
+
* @defaultValue `30000`
|
73
|
+
*/
|
74
|
+
timeout?: number;
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* @public
|
78
|
+
*/
|
79
|
+
export interface WaitForOptions {
|
80
|
+
/**
|
81
|
+
* Maximum wait time in milliseconds. Pass 0 to disable the timeout.
|
82
|
+
*
|
83
|
+
* The default value can be changed by using the
|
84
|
+
* {@link Page.setDefaultTimeout} or {@link Page.setDefaultNavigationTimeout}
|
85
|
+
* methods.
|
86
|
+
*
|
87
|
+
* @defaultValue `30000`
|
88
|
+
*/
|
89
|
+
timeout?: number;
|
90
|
+
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* @public
|
94
|
+
*/
|
95
|
+
export interface GeolocationOptions {
|
96
|
+
/**
|
97
|
+
* Latitude between `-90` and `90`.
|
98
|
+
*/
|
99
|
+
longitude: number;
|
100
|
+
/**
|
101
|
+
* Longitude between `-180` and `180`.
|
102
|
+
*/
|
103
|
+
latitude: number;
|
104
|
+
/**
|
105
|
+
* Optional non-negative accuracy value.
|
106
|
+
*/
|
107
|
+
accuracy?: number;
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* @public
|
111
|
+
*/
|
112
|
+
export interface MediaFeature {
|
113
|
+
name: string;
|
114
|
+
value: string;
|
115
|
+
}
|
116
|
+
/**
|
117
|
+
* @public
|
118
|
+
*/
|
119
|
+
export interface ScreenshotClip {
|
120
|
+
x: number;
|
121
|
+
y: number;
|
122
|
+
width: number;
|
123
|
+
height: number;
|
124
|
+
/**
|
125
|
+
* @defaultValue 1
|
126
|
+
*/
|
127
|
+
scale?: number;
|
128
|
+
}
|
129
|
+
/**
|
130
|
+
* @public
|
131
|
+
*/
|
132
|
+
export interface ScreenshotOptions {
|
133
|
+
/**
|
134
|
+
* @defaultValue `png`
|
135
|
+
*/
|
136
|
+
type?: 'png' | 'jpeg' | 'webp';
|
137
|
+
/**
|
138
|
+
* The file path to save the image to. The screenshot type will be inferred
|
139
|
+
* from file extension. If path is a relative path, then it is resolved
|
140
|
+
* relative to current working directory. If no path is provided, the image
|
141
|
+
* won't be saved to the disk.
|
142
|
+
*/
|
143
|
+
path?: string;
|
144
|
+
/**
|
145
|
+
* When `true`, takes a screenshot of the full page.
|
146
|
+
* @defaultValue `false`
|
147
|
+
*/
|
148
|
+
fullPage?: boolean;
|
149
|
+
/**
|
150
|
+
* An object which specifies the clipping region of the page.
|
151
|
+
*/
|
152
|
+
clip?: ScreenshotClip;
|
153
|
+
/**
|
154
|
+
* Quality of the image, between 0-100. Not applicable to `png` images.
|
155
|
+
*/
|
156
|
+
quality?: number;
|
157
|
+
/**
|
158
|
+
* Hides default white background and allows capturing screenshots with transparency.
|
159
|
+
* @defaultValue `false`
|
160
|
+
*/
|
161
|
+
omitBackground?: boolean;
|
162
|
+
/**
|
163
|
+
* Encoding of the image.
|
164
|
+
* @defaultValue `binary`
|
165
|
+
*/
|
166
|
+
encoding?: 'base64' | 'binary';
|
167
|
+
/**
|
168
|
+
* Capture the screenshot beyond the viewport.
|
169
|
+
* @defaultValue `true`
|
170
|
+
*/
|
171
|
+
captureBeyondViewport?: boolean;
|
172
|
+
/**
|
173
|
+
* Capture the screenshot from the surface, rather than the view.
|
174
|
+
* @defaultValue `true`
|
175
|
+
*/
|
176
|
+
fromSurface?: boolean;
|
177
|
+
}
|
178
|
+
/**
|
179
|
+
* All the events that a page instance may emit.
|
180
|
+
*
|
181
|
+
* @public
|
182
|
+
*/
|
183
|
+
export declare const enum PageEmittedEvents {
|
184
|
+
/**
|
185
|
+
* Emitted when the page closes.
|
186
|
+
* @eventProperty
|
187
|
+
*/
|
188
|
+
Close = "close",
|
189
|
+
/**
|
190
|
+
* Emitted when JavaScript within the page calls one of console API methods,
|
191
|
+
* e.g. `console.log` or `console.dir`. Also emitted if the page throws an
|
192
|
+
* error or a warning.
|
193
|
+
*
|
194
|
+
* @remarks
|
195
|
+
* A `console` event provides a {@link ConsoleMessage} representing the
|
196
|
+
* console message that was logged.
|
197
|
+
*
|
198
|
+
* @example
|
199
|
+
* An example of handling `console` event:
|
200
|
+
*
|
201
|
+
* ```ts
|
202
|
+
* page.on('console', msg => {
|
203
|
+
* for (let i = 0; i < msg.args().length; ++i)
|
204
|
+
* console.log(`${i}: ${msg.args()[i]}`);
|
205
|
+
* });
|
206
|
+
* page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
207
|
+
* ```
|
208
|
+
*/
|
209
|
+
Console = "console",
|
210
|
+
/**
|
211
|
+
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`,
|
212
|
+
* `confirm` or `beforeunload`. Puppeteer can respond to the dialog via
|
213
|
+
* {@link Dialog.accept} or {@link Dialog.dismiss}.
|
214
|
+
*/
|
215
|
+
Dialog = "dialog",
|
216
|
+
/**
|
217
|
+
* Emitted when the JavaScript
|
218
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded | DOMContentLoaded }
|
219
|
+
* event is dispatched.
|
220
|
+
*/
|
221
|
+
DOMContentLoaded = "domcontentloaded",
|
222
|
+
/**
|
223
|
+
* Emitted when the page crashes. Will contain an `Error`.
|
224
|
+
*/
|
225
|
+
Error = "error",
|
226
|
+
/** Emitted when a frame is attached. Will contain a {@link Frame}. */
|
227
|
+
FrameAttached = "frameattached",
|
228
|
+
/** Emitted when a frame is detached. Will contain a {@link Frame}. */
|
229
|
+
FrameDetached = "framedetached",
|
230
|
+
/**
|
231
|
+
* Emitted when a frame is navigated to a new URL. Will contain a
|
232
|
+
* {@link Frame}.
|
233
|
+
*/
|
234
|
+
FrameNavigated = "framenavigated",
|
235
|
+
/**
|
236
|
+
* Emitted when the JavaScript
|
237
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/Events/load | load}
|
238
|
+
* event is dispatched.
|
239
|
+
*/
|
240
|
+
Load = "load",
|
241
|
+
/**
|
242
|
+
* Emitted when the JavaScript code makes a call to `console.timeStamp`. For
|
243
|
+
* the list of metrics see {@link Page.metrics | page.metrics}.
|
244
|
+
*
|
245
|
+
* @remarks
|
246
|
+
* Contains an object with two properties:
|
247
|
+
*
|
248
|
+
* - `title`: the title passed to `console.timeStamp`
|
249
|
+
* - `metrics`: objec containing metrics as key/value pairs. The values will
|
250
|
+
* be `number`s.
|
251
|
+
*/
|
252
|
+
Metrics = "metrics",
|
253
|
+
/**
|
254
|
+
* Emitted when an uncaught exception happens within the page. Contains an
|
255
|
+
* `Error`.
|
256
|
+
*/
|
257
|
+
PageError = "pageerror",
|
258
|
+
/**
|
259
|
+
* Emitted when the page opens a new tab or window.
|
260
|
+
*
|
261
|
+
* Contains a {@link Page} corresponding to the popup window.
|
262
|
+
*
|
263
|
+
* @example
|
264
|
+
*
|
265
|
+
* ```ts
|
266
|
+
* const [popup] = await Promise.all([
|
267
|
+
* new Promise(resolve => page.once('popup', resolve)),
|
268
|
+
* page.click('a[target=_blank]'),
|
269
|
+
* ]);
|
270
|
+
* ```
|
271
|
+
*
|
272
|
+
* ```ts
|
273
|
+
* const [popup] = await Promise.all([
|
274
|
+
* new Promise(resolve => page.once('popup', resolve)),
|
275
|
+
* page.evaluate(() => window.open('https://example.com')),
|
276
|
+
* ]);
|
277
|
+
* ```
|
278
|
+
*/
|
279
|
+
Popup = "popup",
|
280
|
+
/**
|
281
|
+
* Emitted when a page issues a request and contains a {@link HTTPRequest}.
|
282
|
+
*
|
283
|
+
* @remarks
|
284
|
+
* The object is readonly. See {@link Page.setRequestInterception} for
|
285
|
+
* intercepting and mutating requests.
|
286
|
+
*/
|
287
|
+
Request = "request",
|
288
|
+
/**
|
289
|
+
* Emitted when a request ended up loading from cache. Contains a
|
290
|
+
* {@link HTTPRequest}.
|
291
|
+
*
|
292
|
+
* @remarks
|
293
|
+
* For certain requests, might contain undefined.
|
294
|
+
* {@link https://crbug.com/750469}
|
295
|
+
*/
|
296
|
+
RequestServedFromCache = "requestservedfromcache",
|
297
|
+
/**
|
298
|
+
* Emitted when a request fails, for example by timing out.
|
299
|
+
*
|
300
|
+
* Contains a {@link HTTPRequest}.
|
301
|
+
*
|
302
|
+
* @remarks
|
303
|
+
* HTTP Error responses, such as 404 or 503, are still successful responses
|
304
|
+
* from HTTP standpoint, so request will complete with `requestfinished` event
|
305
|
+
* and not with `requestfailed`.
|
306
|
+
*/
|
307
|
+
RequestFailed = "requestfailed",
|
308
|
+
/**
|
309
|
+
* Emitted when a request finishes successfully. Contains a
|
310
|
+
* {@link HTTPRequest}.
|
311
|
+
*/
|
312
|
+
RequestFinished = "requestfinished",
|
313
|
+
/**
|
314
|
+
* Emitted when a response is received. Contains a {@link HTTPResponse}.
|
315
|
+
*/
|
316
|
+
Response = "response",
|
317
|
+
/**
|
318
|
+
* Emitted when a dedicated
|
319
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker}
|
320
|
+
* is spawned by the page.
|
321
|
+
*/
|
322
|
+
WorkerCreated = "workercreated",
|
323
|
+
/**
|
324
|
+
* Emitted when a dedicated
|
325
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker}
|
326
|
+
* is destroyed by the page.
|
327
|
+
*/
|
328
|
+
WorkerDestroyed = "workerdestroyed"
|
329
|
+
}
|
330
|
+
/**
|
331
|
+
* Denotes the objects received by callback functions for page events.
|
332
|
+
*
|
333
|
+
* See {@link PageEmittedEvents} for more detail on the events and when they are
|
334
|
+
* emitted.
|
335
|
+
*
|
336
|
+
* @public
|
337
|
+
*/
|
338
|
+
export interface PageEventObject {
|
339
|
+
close: never;
|
340
|
+
console: ConsoleMessage;
|
341
|
+
dialog: Dialog;
|
342
|
+
domcontentloaded: never;
|
343
|
+
error: Error;
|
344
|
+
frameattached: Frame;
|
345
|
+
framedetached: Frame;
|
346
|
+
framenavigated: Frame;
|
347
|
+
load: never;
|
348
|
+
metrics: {
|
349
|
+
title: string;
|
350
|
+
metrics: Metrics;
|
351
|
+
};
|
352
|
+
pageerror: Error;
|
353
|
+
popup: Page;
|
354
|
+
request: HTTPRequest;
|
355
|
+
response: HTTPResponse;
|
356
|
+
requestfailed: HTTPRequest;
|
357
|
+
requestfinished: HTTPRequest;
|
358
|
+
requestservedfromcache: HTTPRequest;
|
359
|
+
workercreated: WebWorker;
|
360
|
+
workerdestroyed: WebWorker;
|
361
|
+
}
|
362
|
+
/**
|
363
|
+
* Page provides methods to interact with a single tab or
|
364
|
+
* {@link https://developer.chrome.com/extensions/background_pages | extension background page}
|
365
|
+
* in Chromium.
|
366
|
+
*
|
367
|
+
* :::note
|
368
|
+
*
|
369
|
+
* One Browser instance might have multiple Page instances.
|
370
|
+
*
|
371
|
+
* :::
|
372
|
+
*
|
373
|
+
* @example
|
374
|
+
* This example creates a page, navigates it to a URL, and then saves a screenshot:
|
375
|
+
*
|
376
|
+
* ```ts
|
377
|
+
* const puppeteer = require('puppeteer');
|
378
|
+
*
|
379
|
+
* (async () => {
|
380
|
+
* const browser = await puppeteer.launch();
|
381
|
+
* const page = await browser.newPage();
|
382
|
+
* await page.goto('https://example.com');
|
383
|
+
* await page.screenshot({path: 'screenshot.png'});
|
384
|
+
* await browser.close();
|
385
|
+
* })();
|
386
|
+
* ```
|
387
|
+
*
|
388
|
+
* The Page class extends from Puppeteer's {@link EventEmitter} class and will
|
389
|
+
* emit various events which are documented in the {@link PageEmittedEvents} enum.
|
390
|
+
*
|
391
|
+
* @example
|
392
|
+
* This example logs a message for a single page `load` event:
|
393
|
+
*
|
394
|
+
* ```ts
|
395
|
+
* page.once('load', () => console.log('Page loaded!'));
|
396
|
+
* ```
|
397
|
+
*
|
398
|
+
* To unsubscribe from events use the {@link Page.off} method:
|
399
|
+
*
|
400
|
+
* ```ts
|
401
|
+
* function logRequest(interceptedRequest) {
|
402
|
+
* console.log('A request was made:', interceptedRequest.url());
|
403
|
+
* }
|
404
|
+
* page.on('request', logRequest);
|
405
|
+
* // Sometime later...
|
406
|
+
* page.off('request', logRequest);
|
407
|
+
* ```
|
408
|
+
*
|
409
|
+
* @public
|
410
|
+
*/
|
411
|
+
export declare class Page extends EventEmitter {
|
412
|
+
#private;
|
413
|
+
/**
|
414
|
+
* @internal
|
415
|
+
*/
|
416
|
+
constructor();
|
417
|
+
/**
|
418
|
+
* @returns `true` if drag events are being intercepted, `false` otherwise.
|
419
|
+
*/
|
420
|
+
isDragInterceptionEnabled(): boolean;
|
421
|
+
/**
|
422
|
+
* @returns `true` if the page has JavaScript enabled, `false` otherwise.
|
423
|
+
*/
|
424
|
+
isJavaScriptEnabled(): boolean;
|
425
|
+
/**
|
426
|
+
* Listen to page events.
|
427
|
+
*
|
428
|
+
* :::note
|
429
|
+
*
|
430
|
+
* This method exists to define event typings and handle proper wireup of
|
431
|
+
* cooperative request interception. Actual event listening and dispatching is
|
432
|
+
* delegated to {@link EventEmitter}.
|
433
|
+
*
|
434
|
+
* :::
|
435
|
+
*/
|
436
|
+
on<K extends keyof PageEventObject>(eventName: K, handler: (event: PageEventObject[K]) => void): EventEmitter;
|
437
|
+
once<K extends keyof PageEventObject>(eventName: K, handler: (event: PageEventObject[K]) => void): EventEmitter;
|
438
|
+
off<K extends keyof PageEventObject>(eventName: K, handler: (event: PageEventObject[K]) => void): EventEmitter;
|
439
|
+
/**
|
440
|
+
* This method is typically coupled with an action that triggers file
|
441
|
+
* choosing.
|
442
|
+
*
|
443
|
+
* :::caution
|
444
|
+
*
|
445
|
+
* This must be called before the file chooser is launched. It will not return
|
446
|
+
* a currently active file chooser.
|
447
|
+
*
|
448
|
+
* :::
|
449
|
+
*
|
450
|
+
* @remarks
|
451
|
+
* In non-headless Chromium, this method results in the native file picker
|
452
|
+
* dialog `not showing up` for the user.
|
453
|
+
*
|
454
|
+
* @example
|
455
|
+
* The following example clicks a button that issues a file chooser
|
456
|
+
* and then responds with `/tmp/myfile.pdf` as if a user has selected this file.
|
457
|
+
*
|
458
|
+
* ```ts
|
459
|
+
* const [fileChooser] = await Promise.all([
|
460
|
+
* page.waitForFileChooser(),
|
461
|
+
* page.click('#upload-file-button'),
|
462
|
+
* // some button that triggers file selection
|
463
|
+
* ]);
|
464
|
+
* await fileChooser.accept(['/tmp/myfile.pdf']);
|
465
|
+
* ```
|
466
|
+
*/
|
467
|
+
waitForFileChooser(options?: WaitTimeoutOptions): Promise<FileChooser>;
|
468
|
+
/**
|
469
|
+
* Sets the page's geolocation.
|
470
|
+
*
|
471
|
+
* @remarks
|
472
|
+
* Consider using {@link BrowserContext.overridePermissions} to grant
|
473
|
+
* permissions for the page to read its geolocation.
|
474
|
+
*
|
475
|
+
* @example
|
476
|
+
*
|
477
|
+
* ```ts
|
478
|
+
* await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
|
479
|
+
* ```
|
480
|
+
*/
|
481
|
+
setGeolocation(options: GeolocationOptions): Promise<void>;
|
482
|
+
/**
|
483
|
+
* @returns A target this page was created from.
|
484
|
+
*/
|
485
|
+
target(): Target;
|
486
|
+
/**
|
487
|
+
* Get the browser the page belongs to.
|
488
|
+
*/
|
489
|
+
browser(): Browser;
|
490
|
+
/**
|
491
|
+
* Get the browser context that the page belongs to.
|
492
|
+
*/
|
493
|
+
browserContext(): BrowserContext;
|
494
|
+
/**
|
495
|
+
* @returns The page's main frame.
|
496
|
+
*
|
497
|
+
* @remarks
|
498
|
+
* Page is guaranteed to have a main frame which persists during navigations.
|
499
|
+
*/
|
500
|
+
mainFrame(): Frame;
|
501
|
+
get keyboard(): Keyboard;
|
502
|
+
get touchscreen(): Touchscreen;
|
503
|
+
get coverage(): Coverage;
|
504
|
+
get tracing(): Tracing;
|
505
|
+
get accessibility(): Accessibility;
|
506
|
+
/**
|
507
|
+
* @returns An array of all frames attached to the page.
|
508
|
+
*/
|
509
|
+
frames(): Frame[];
|
510
|
+
/**
|
511
|
+
* @returns all of the dedicated {@link
|
512
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API |
|
513
|
+
* WebWorkers} associated with the page.
|
514
|
+
*
|
515
|
+
* @remarks
|
516
|
+
* This does not contain ServiceWorkers
|
517
|
+
*/
|
518
|
+
workers(): WebWorker[];
|
519
|
+
/**
|
520
|
+
* Activating request interception enables {@link HTTPRequest.abort},
|
521
|
+
* {@link HTTPRequest.continue} and {@link HTTPRequest.respond} methods. This
|
522
|
+
* provides the capability to modify network requests that are made by a page.
|
523
|
+
*
|
524
|
+
* Once request interception is enabled, every request will stall unless it's
|
525
|
+
* continued, responded or aborted; or completed using the browser cache.
|
526
|
+
*
|
527
|
+
* Enabling request interception disables page caching.
|
528
|
+
*
|
529
|
+
* See the
|
530
|
+
* {@link https://pptr.dev/next/guides/request-interception|Request interception guide}
|
531
|
+
* for more details.
|
532
|
+
*
|
533
|
+
* @example
|
534
|
+
* An example of a naïve request interceptor that aborts all image requests:
|
535
|
+
*
|
536
|
+
* ```ts
|
537
|
+
* const puppeteer = require('puppeteer');
|
538
|
+
* (async () => {
|
539
|
+
* const browser = await puppeteer.launch();
|
540
|
+
* const page = await browser.newPage();
|
541
|
+
* await page.setRequestInterception(true);
|
542
|
+
* page.on('request', interceptedRequest => {
|
543
|
+
* if (
|
544
|
+
* interceptedRequest.url().endsWith('.png') ||
|
545
|
+
* interceptedRequest.url().endsWith('.jpg')
|
546
|
+
* )
|
547
|
+
* interceptedRequest.abort();
|
548
|
+
* else interceptedRequest.continue();
|
549
|
+
* });
|
550
|
+
* await page.goto('https://example.com');
|
551
|
+
* await browser.close();
|
552
|
+
* })();
|
553
|
+
* ```
|
554
|
+
*
|
555
|
+
* @param value - Whether to enable request interception.
|
556
|
+
*/
|
557
|
+
setRequestInterception(value: boolean): Promise<void>;
|
558
|
+
/**
|
559
|
+
* @param enabled - Whether to enable drag interception.
|
560
|
+
*
|
561
|
+
* @remarks
|
562
|
+
* Activating drag interception enables the `Input.drag`,
|
563
|
+
* methods This provides the capability to capture drag events emitted
|
564
|
+
* on the page, which can then be used to simulate drag-and-drop.
|
565
|
+
*/
|
566
|
+
setDragInterception(enabled: boolean): Promise<void>;
|
567
|
+
/**
|
568
|
+
* Sets the network connection to offline.
|
569
|
+
*
|
570
|
+
* It does not change the parameters used in {@link Page.emulateNetworkConditions}
|
571
|
+
*
|
572
|
+
* @param enabled - When `true`, enables offline mode for the page.
|
573
|
+
*/
|
574
|
+
setOfflineMode(enabled: boolean): Promise<void>;
|
575
|
+
/**
|
576
|
+
* This does not affect WebSockets and WebRTC PeerConnections (see
|
577
|
+
* https://crbug.com/563644). To set the page offline, you can use
|
578
|
+
* {@link Page.setOfflineMode}.
|
579
|
+
*
|
580
|
+
* A list of predefined network conditions can be used by importing
|
581
|
+
* {@link PredefinedNetworkConditions}.
|
582
|
+
*
|
583
|
+
* @example
|
584
|
+
*
|
585
|
+
* ```ts
|
586
|
+
* import {PredefinedNetworkConditions} from 'puppeteer';
|
587
|
+
* const slow3G = PredefinedNetworkConditions['Slow 3G'];
|
588
|
+
*
|
589
|
+
* (async () => {
|
590
|
+
* const browser = await puppeteer.launch();
|
591
|
+
* const page = await browser.newPage();
|
592
|
+
* await page.emulateNetworkConditions(slow3G);
|
593
|
+
* await page.goto('https://www.google.com');
|
594
|
+
* // other actions...
|
595
|
+
* await browser.close();
|
596
|
+
* })();
|
597
|
+
* ```
|
598
|
+
*
|
599
|
+
* @param networkConditions - Passing `null` disables network condition
|
600
|
+
* emulation.
|
601
|
+
*/
|
602
|
+
emulateNetworkConditions(networkConditions: NetworkConditions | null): Promise<void>;
|
603
|
+
/**
|
604
|
+
* This setting will change the default maximum navigation time for the
|
605
|
+
* following methods and related shortcuts:
|
606
|
+
*
|
607
|
+
* - {@link Page.goBack | page.goBack(options)}
|
608
|
+
*
|
609
|
+
* - {@link Page.goForward | page.goForward(options)}
|
610
|
+
*
|
611
|
+
* - {@link Page.goto | page.goto(url,options)}
|
612
|
+
*
|
613
|
+
* - {@link Page.reload | page.reload(options)}
|
614
|
+
*
|
615
|
+
* - {@link Page.setContent | page.setContent(html,options)}
|
616
|
+
*
|
617
|
+
* - {@link Page.waitForNavigation | page.waitForNavigation(options)}
|
618
|
+
* @param timeout - Maximum navigation time in milliseconds.
|
619
|
+
*/
|
620
|
+
setDefaultNavigationTimeout(timeout: number): void;
|
621
|
+
/**
|
622
|
+
* @param timeout - Maximum time in milliseconds.
|
623
|
+
*/
|
624
|
+
setDefaultTimeout(timeout: number): void;
|
625
|
+
/**
|
626
|
+
* @returns Maximum time in milliseconds.
|
627
|
+
*/
|
628
|
+
getDefaultTimeout(): number;
|
629
|
+
/**
|
630
|
+
* Runs `document.querySelector` within the page. If no element matches the
|
631
|
+
* selector, the return value resolves to `null`.
|
632
|
+
*
|
633
|
+
* @param selector - A `selector` to query page for
|
634
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
635
|
+
* to query page for.
|
636
|
+
*/
|
637
|
+
$<Selector extends string>(selector: Selector): Promise<ElementHandle<NodeFor<Selector>> | null>;
|
638
|
+
/**
|
639
|
+
* The method runs `document.querySelectorAll` within the page. If no elements
|
640
|
+
* match the selector, the return value resolves to `[]`.
|
641
|
+
* @remarks
|
642
|
+
* Shortcut for {@link Frame.$$ | Page.mainFrame().$$(selector) }.
|
643
|
+
* @param selector - A `selector` to query page for
|
644
|
+
*/
|
645
|
+
$$<Selector extends string>(selector: Selector): Promise<Array<ElementHandle<NodeFor<Selector>>>>;
|
646
|
+
/**
|
647
|
+
* @remarks
|
648
|
+
*
|
649
|
+
* The only difference between {@link Page.evaluate | page.evaluate} and
|
650
|
+
* `page.evaluateHandle` is that `evaluateHandle` will return the value
|
651
|
+
* wrapped in an in-page object.
|
652
|
+
*
|
653
|
+
* If the function passed to `page.evaluteHandle` returns a Promise, the
|
654
|
+
* function will wait for the promise to resolve and return its value.
|
655
|
+
*
|
656
|
+
* You can pass a string instead of a function (although functions are
|
657
|
+
* recommended as they are easier to debug and use with TypeScript):
|
658
|
+
*
|
659
|
+
* @example
|
660
|
+
*
|
661
|
+
* ```ts
|
662
|
+
* const aHandle = await page.evaluateHandle('document');
|
663
|
+
* ```
|
664
|
+
*
|
665
|
+
* @example
|
666
|
+
* {@link JSHandle} instances can be passed as arguments to the `pageFunction`:
|
667
|
+
*
|
668
|
+
* ```ts
|
669
|
+
* const aHandle = await page.evaluateHandle(() => document.body);
|
670
|
+
* const resultHandle = await page.evaluateHandle(
|
671
|
+
* body => body.innerHTML,
|
672
|
+
* aHandle
|
673
|
+
* );
|
674
|
+
* console.log(await resultHandle.jsonValue());
|
675
|
+
* await resultHandle.dispose();
|
676
|
+
* ```
|
677
|
+
*
|
678
|
+
* Most of the time this function returns a {@link JSHandle},
|
679
|
+
* but if `pageFunction` returns a reference to an element,
|
680
|
+
* you instead get an {@link ElementHandle} back:
|
681
|
+
*
|
682
|
+
* @example
|
683
|
+
*
|
684
|
+
* ```ts
|
685
|
+
* const button = await page.evaluateHandle(() =>
|
686
|
+
* document.querySelector('button')
|
687
|
+
* );
|
688
|
+
* // can call `click` because `button` is an `ElementHandle`
|
689
|
+
* await button.click();
|
690
|
+
* ```
|
691
|
+
*
|
692
|
+
* The TypeScript definitions assume that `evaluateHandle` returns
|
693
|
+
* a `JSHandle`, but if you know it's going to return an
|
694
|
+
* `ElementHandle`, pass it as the generic argument:
|
695
|
+
*
|
696
|
+
* ```ts
|
697
|
+
* const button = await page.evaluateHandle<ElementHandle>(...);
|
698
|
+
* ```
|
699
|
+
*
|
700
|
+
* @param pageFunction - a function that is run within the page
|
701
|
+
* @param args - arguments to be passed to the pageFunction
|
702
|
+
*/
|
703
|
+
evaluateHandle<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
|
704
|
+
/**
|
705
|
+
* This method iterates the JavaScript heap and finds all objects with the
|
706
|
+
* given prototype.
|
707
|
+
*
|
708
|
+
* @example
|
709
|
+
*
|
710
|
+
* ```ts
|
711
|
+
* // Create a Map object
|
712
|
+
* await page.evaluate(() => (window.map = new Map()));
|
713
|
+
* // Get a handle to the Map object prototype
|
714
|
+
* const mapPrototype = await page.evaluateHandle(() => Map.prototype);
|
715
|
+
* // Query all map instances into an array
|
716
|
+
* const mapInstances = await page.queryObjects(mapPrototype);
|
717
|
+
* // Count amount of map objects in heap
|
718
|
+
* const count = await page.evaluate(maps => maps.length, mapInstances);
|
719
|
+
* await mapInstances.dispose();
|
720
|
+
* await mapPrototype.dispose();
|
721
|
+
* ```
|
722
|
+
*
|
723
|
+
* @param prototypeHandle - a handle to the object prototype.
|
724
|
+
* @returns Promise which resolves to a handle to an array of objects with
|
725
|
+
* this prototype.
|
726
|
+
*/
|
727
|
+
queryObjects<Prototype>(prototypeHandle: JSHandle<Prototype>): Promise<JSHandle<Prototype[]>>;
|
728
|
+
/**
|
729
|
+
* This method runs `document.querySelector` within the page and passes the
|
730
|
+
* result as the first argument to the `pageFunction`.
|
731
|
+
*
|
732
|
+
* @remarks
|
733
|
+
*
|
734
|
+
* If no element is found matching `selector`, the method will throw an error.
|
735
|
+
*
|
736
|
+
* If `pageFunction` returns a promise `$eval` will wait for the promise to
|
737
|
+
* resolve and then return its value.
|
738
|
+
*
|
739
|
+
* @example
|
740
|
+
*
|
741
|
+
* ```ts
|
742
|
+
* const searchValue = await page.$eval('#search', el => el.value);
|
743
|
+
* const preloadHref = await page.$eval('link[rel=preload]', el => el.href);
|
744
|
+
* const html = await page.$eval('.main-container', el => el.outerHTML);
|
745
|
+
* ```
|
746
|
+
*
|
747
|
+
* If you are using TypeScript, you may have to provide an explicit type to the
|
748
|
+
* first argument of the `pageFunction`.
|
749
|
+
* By default it is typed as `Element`, but you may need to provide a more
|
750
|
+
* specific sub-type:
|
751
|
+
*
|
752
|
+
* @example
|
753
|
+
*
|
754
|
+
* ```ts
|
755
|
+
* // if you don't provide HTMLInputElement here, TS will error
|
756
|
+
* // as `value` is not on `Element`
|
757
|
+
* const searchValue = await page.$eval(
|
758
|
+
* '#search',
|
759
|
+
* (el: HTMLInputElement) => el.value
|
760
|
+
* );
|
761
|
+
* ```
|
762
|
+
*
|
763
|
+
* The compiler should be able to infer the return type
|
764
|
+
* from the `pageFunction` you provide. If it is unable to, you can use the generic
|
765
|
+
* type to tell the compiler what return type you expect from `$eval`:
|
766
|
+
*
|
767
|
+
* @example
|
768
|
+
*
|
769
|
+
* ```ts
|
770
|
+
* // The compiler can infer the return type in this case, but if it can't
|
771
|
+
* // or if you want to be more explicit, provide it as the generic type.
|
772
|
+
* const searchValue = await page.$eval<string>(
|
773
|
+
* '#search',
|
774
|
+
* (el: HTMLInputElement) => el.value
|
775
|
+
* );
|
776
|
+
* ```
|
777
|
+
*
|
778
|
+
* @param selector - the
|
779
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
780
|
+
* to query for
|
781
|
+
* @param pageFunction - the function to be evaluated in the page context.
|
782
|
+
* Will be passed the result of `document.querySelector(selector)` as its
|
783
|
+
* first argument.
|
784
|
+
* @param args - any additional arguments to pass through to `pageFunction`.
|
785
|
+
*
|
786
|
+
* @returns The result of calling `pageFunction`. If it returns an element it
|
787
|
+
* is wrapped in an {@link ElementHandle}, else the raw value itself is
|
788
|
+
* returned.
|
789
|
+
*/
|
790
|
+
$eval<Selector extends string, Params extends unknown[], Func extends EvaluateFunc<[
|
791
|
+
ElementHandle<NodeFor<Selector>>,
|
792
|
+
...Params
|
793
|
+
]> = EvaluateFunc<[ElementHandle<NodeFor<Selector>>, ...Params]>>(selector: Selector, pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;
|
794
|
+
/**
|
795
|
+
* This method runs `Array.from(document.querySelectorAll(selector))` within
|
796
|
+
* the page and passes the result as the first argument to the `pageFunction`.
|
797
|
+
*
|
798
|
+
* @remarks
|
799
|
+
* If `pageFunction` returns a promise `$$eval` will wait for the promise to
|
800
|
+
* resolve and then return its value.
|
801
|
+
*
|
802
|
+
* @example
|
803
|
+
*
|
804
|
+
* ```ts
|
805
|
+
* // get the amount of divs on the page
|
806
|
+
* const divCount = await page.$$eval('div', divs => divs.length);
|
807
|
+
*
|
808
|
+
* // get the text content of all the `.options` elements:
|
809
|
+
* const options = await page.$$eval('div > span.options', options => {
|
810
|
+
* return options.map(option => option.textContent);
|
811
|
+
* });
|
812
|
+
* ```
|
813
|
+
*
|
814
|
+
* If you are using TypeScript, you may have to provide an explicit type to the
|
815
|
+
* first argument of the `pageFunction`.
|
816
|
+
* By default it is typed as `Element[]`, but you may need to provide a more
|
817
|
+
* specific sub-type:
|
818
|
+
*
|
819
|
+
* @example
|
820
|
+
*
|
821
|
+
* ```ts
|
822
|
+
* // if you don't provide HTMLInputElement here, TS will error
|
823
|
+
* // as `value` is not on `Element`
|
824
|
+
* await page.$$eval('input', (elements: HTMLInputElement[]) => {
|
825
|
+
* return elements.map(e => e.value);
|
826
|
+
* });
|
827
|
+
* ```
|
828
|
+
*
|
829
|
+
* The compiler should be able to infer the return type
|
830
|
+
* from the `pageFunction` you provide. If it is unable to, you can use the generic
|
831
|
+
* type to tell the compiler what return type you expect from `$$eval`:
|
832
|
+
*
|
833
|
+
* @example
|
834
|
+
*
|
835
|
+
* ```ts
|
836
|
+
* // The compiler can infer the return type in this case, but if it can't
|
837
|
+
* // or if you want to be more explicit, provide it as the generic type.
|
838
|
+
* const allInputValues = await page.$$eval<string[]>(
|
839
|
+
* 'input',
|
840
|
+
* (elements: HTMLInputElement[]) => elements.map(e => e.textContent)
|
841
|
+
* );
|
842
|
+
* ```
|
843
|
+
*
|
844
|
+
* @param selector - the
|
845
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
846
|
+
* to query for
|
847
|
+
* @param pageFunction - the function to be evaluated in the page context.
|
848
|
+
* Will be passed the result of
|
849
|
+
* `Array.from(document.querySelectorAll(selector))` as its first argument.
|
850
|
+
* @param args - any additional arguments to pass through to `pageFunction`.
|
851
|
+
*
|
852
|
+
* @returns The result of calling `pageFunction`. If it returns an element it
|
853
|
+
* is wrapped in an {@link ElementHandle}, else the raw value itself is
|
854
|
+
* returned.
|
855
|
+
*/
|
856
|
+
$$eval<Selector extends string, Params extends unknown[], Func extends EvaluateFunc<[
|
857
|
+
Array<NodeFor<Selector>>,
|
858
|
+
...Params
|
859
|
+
]> = EvaluateFunc<[Array<NodeFor<Selector>>, ...Params]>>(selector: Selector, pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;
|
860
|
+
/**
|
861
|
+
* The method evaluates the XPath expression relative to the page document as
|
862
|
+
* its context node. If there are no such elements, the method resolves to an
|
863
|
+
* empty array.
|
864
|
+
*
|
865
|
+
* @remarks
|
866
|
+
* Shortcut for {@link Frame.$x | Page.mainFrame().$x(expression) }.
|
867
|
+
*
|
868
|
+
* @param expression - Expression to evaluate
|
869
|
+
*/
|
870
|
+
$x(expression: string): Promise<Array<ElementHandle<Node>>>;
|
871
|
+
/**
|
872
|
+
* If no URLs are specified, this method returns cookies for the current page
|
873
|
+
* URL. If URLs are specified, only cookies for those URLs are returned.
|
874
|
+
*/
|
875
|
+
cookies(...urls: string[]): Promise<Protocol.Network.Cookie[]>;
|
876
|
+
deleteCookie(...cookies: Protocol.Network.DeleteCookiesRequest[]): Promise<void>;
|
877
|
+
/**
|
878
|
+
* @example
|
879
|
+
*
|
880
|
+
* ```ts
|
881
|
+
* await page.setCookie(cookieObject1, cookieObject2);
|
882
|
+
* ```
|
883
|
+
*/
|
884
|
+
setCookie(...cookies: Protocol.Network.CookieParam[]): Promise<void>;
|
885
|
+
/**
|
886
|
+
* Adds a `<script>` tag into the page with the desired URL or content.
|
887
|
+
*
|
888
|
+
* @remarks
|
889
|
+
* Shortcut for
|
890
|
+
* {@link Frame.addScriptTag | page.mainFrame().addScriptTag(options)}.
|
891
|
+
*
|
892
|
+
* @param options - Options for the script.
|
893
|
+
* @returns An {@link ElementHandle | element handle} to the injected
|
894
|
+
* `<script>` element.
|
895
|
+
*/
|
896
|
+
addScriptTag(options: FrameAddScriptTagOptions): Promise<ElementHandle<HTMLScriptElement>>;
|
897
|
+
/**
|
898
|
+
* Adds a `<link rel="stylesheet">` tag into the page with the desired URL or
|
899
|
+
* a `<style type="text/css">` tag with the content.
|
900
|
+
*
|
901
|
+
* Shortcut for
|
902
|
+
* {@link Frame.addStyleTag | page.mainFrame().addStyleTag(options)}.
|
903
|
+
*
|
904
|
+
* @returns An {@link ElementHandle | element handle} to the injected `<link>`
|
905
|
+
* or `<style>` element.
|
906
|
+
*/
|
907
|
+
addStyleTag(options: Omit<FrameAddStyleTagOptions, 'url'>): Promise<ElementHandle<HTMLStyleElement>>;
|
908
|
+
addStyleTag(options: FrameAddStyleTagOptions): Promise<ElementHandle<HTMLLinkElement>>;
|
909
|
+
addStyleTag(options: FrameAddStyleTagOptions): Promise<ElementHandle<HTMLStyleElement | HTMLLinkElement>>;
|
910
|
+
/**
|
911
|
+
* The method adds a function called `name` on the page's `window` object.
|
912
|
+
* When called, the function executes `puppeteerFunction` in node.js and
|
913
|
+
* returns a `Promise` which resolves to the return value of
|
914
|
+
* `puppeteerFunction`.
|
915
|
+
*
|
916
|
+
* If the puppeteerFunction returns a `Promise`, it will be awaited.
|
917
|
+
*
|
918
|
+
* :::note
|
919
|
+
*
|
920
|
+
* Functions installed via `page.exposeFunction` survive navigations.
|
921
|
+
*
|
922
|
+
* :::note
|
923
|
+
*
|
924
|
+
* @example
|
925
|
+
* An example of adding an `md5` function into the page:
|
926
|
+
*
|
927
|
+
* ```ts
|
928
|
+
* const puppeteer = require('puppeteer');
|
929
|
+
* const crypto = require('crypto');
|
930
|
+
*
|
931
|
+
* (async () => {
|
932
|
+
* const browser = await puppeteer.launch();
|
933
|
+
* const page = await browser.newPage();
|
934
|
+
* page.on('console', msg => console.log(msg.text()));
|
935
|
+
* await page.exposeFunction('md5', text =>
|
936
|
+
* crypto.createHash('md5').update(text).digest('hex')
|
937
|
+
* );
|
938
|
+
* await page.evaluate(async () => {
|
939
|
+
* // use window.md5 to compute hashes
|
940
|
+
* const myString = 'PUPPETEER';
|
941
|
+
* const myHash = await window.md5(myString);
|
942
|
+
* console.log(`md5 of ${myString} is ${myHash}`);
|
943
|
+
* });
|
944
|
+
* await browser.close();
|
945
|
+
* })();
|
946
|
+
* ```
|
947
|
+
*
|
948
|
+
* @example
|
949
|
+
* An example of adding a `window.readfile` function into the page:
|
950
|
+
*
|
951
|
+
* ```ts
|
952
|
+
* const puppeteer = require('puppeteer');
|
953
|
+
* const fs = require('fs');
|
954
|
+
*
|
955
|
+
* (async () => {
|
956
|
+
* const browser = await puppeteer.launch();
|
957
|
+
* const page = await browser.newPage();
|
958
|
+
* page.on('console', msg => console.log(msg.text()));
|
959
|
+
* await page.exposeFunction('readfile', async filePath => {
|
960
|
+
* return new Promise((resolve, reject) => {
|
961
|
+
* fs.readFile(filePath, 'utf8', (err, text) => {
|
962
|
+
* if (err) reject(err);
|
963
|
+
* else resolve(text);
|
964
|
+
* });
|
965
|
+
* });
|
966
|
+
* });
|
967
|
+
* await page.evaluate(async () => {
|
968
|
+
* // use window.readfile to read contents of a file
|
969
|
+
* const content = await window.readfile('/etc/hosts');
|
970
|
+
* console.log(content);
|
971
|
+
* });
|
972
|
+
* await browser.close();
|
973
|
+
* })();
|
974
|
+
* ```
|
975
|
+
*
|
976
|
+
* @param name - Name of the function on the window object
|
977
|
+
* @param pptrFunction - Callback function which will be called in Puppeteer's
|
978
|
+
* context.
|
979
|
+
*/
|
980
|
+
exposeFunction(name: string, pptrFunction: Function | {
|
981
|
+
default: Function;
|
982
|
+
}): Promise<void>;
|
983
|
+
/**
|
984
|
+
* Provide credentials for `HTTP authentication`.
|
985
|
+
*
|
986
|
+
* @remarks
|
987
|
+
* To disable authentication, pass `null`.
|
988
|
+
*/
|
989
|
+
authenticate(credentials: Credentials): Promise<void>;
|
990
|
+
/**
|
991
|
+
* The extra HTTP headers will be sent with every request the page initiates.
|
992
|
+
*
|
993
|
+
* :::tip
|
994
|
+
*
|
995
|
+
* All HTTP header names are lowercased. (HTTP headers are
|
996
|
+
* case-insensitive, so this shouldn’t impact your server code.)
|
997
|
+
*
|
998
|
+
* :::
|
999
|
+
*
|
1000
|
+
* :::note
|
1001
|
+
*
|
1002
|
+
* page.setExtraHTTPHeaders does not guarantee the order of headers in
|
1003
|
+
* the outgoing requests.
|
1004
|
+
*
|
1005
|
+
* :::
|
1006
|
+
*
|
1007
|
+
* @param headers - An object containing additional HTTP headers to be sent
|
1008
|
+
* with every request. All header values must be strings.
|
1009
|
+
*/
|
1010
|
+
setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
|
1011
|
+
/**
|
1012
|
+
* @param userAgent - Specific user agent to use in this page
|
1013
|
+
* @param userAgentData - Specific user agent client hint data to use in this
|
1014
|
+
* page
|
1015
|
+
* @returns Promise which resolves when the user agent is set.
|
1016
|
+
*/
|
1017
|
+
setUserAgent(userAgent: string, userAgentMetadata?: Protocol.Emulation.UserAgentMetadata): Promise<void>;
|
1018
|
+
/**
|
1019
|
+
* @returns Object containing metrics as key/value pairs.
|
1020
|
+
*
|
1021
|
+
* - `Timestamp` : The timestamp when the metrics sample was taken.
|
1022
|
+
*
|
1023
|
+
* - `Documents` : Number of documents in the page.
|
1024
|
+
*
|
1025
|
+
* - `Frames` : Number of frames in the page.
|
1026
|
+
*
|
1027
|
+
* - `JSEventListeners` : Number of events in the page.
|
1028
|
+
*
|
1029
|
+
* - `Nodes` : Number of DOM nodes in the page.
|
1030
|
+
*
|
1031
|
+
* - `LayoutCount` : Total number of full or partial page layout.
|
1032
|
+
*
|
1033
|
+
* - `RecalcStyleCount` : Total number of page style recalculations.
|
1034
|
+
*
|
1035
|
+
* - `LayoutDuration` : Combined durations of all page layouts.
|
1036
|
+
*
|
1037
|
+
* - `RecalcStyleDuration` : Combined duration of all page style
|
1038
|
+
* recalculations.
|
1039
|
+
*
|
1040
|
+
* - `ScriptDuration` : Combined duration of JavaScript execution.
|
1041
|
+
*
|
1042
|
+
* - `TaskDuration` : Combined duration of all tasks performed by the browser.
|
1043
|
+
*
|
1044
|
+
* - `JSHeapUsedSize` : Used JavaScript heap size.
|
1045
|
+
*
|
1046
|
+
* - `JSHeapTotalSize` : Total JavaScript heap size.
|
1047
|
+
*
|
1048
|
+
* @remarks
|
1049
|
+
* All timestamps are in monotonic time: monotonically increasing time
|
1050
|
+
* in seconds since an arbitrary point in the past.
|
1051
|
+
*/
|
1052
|
+
metrics(): Promise<Metrics>;
|
1053
|
+
/**
|
1054
|
+
*
|
1055
|
+
* @returns
|
1056
|
+
* @remarks Shortcut for
|
1057
|
+
* {@link Frame.url | page.mainFrame().url()}.
|
1058
|
+
*/
|
1059
|
+
url(): string;
|
1060
|
+
content(): Promise<string>;
|
1061
|
+
/**
|
1062
|
+
* @param html - HTML markup to assign to the page.
|
1063
|
+
* @param options - Parameters that has some properties.
|
1064
|
+
* @remarks
|
1065
|
+
* The parameter `options` might have the following options.
|
1066
|
+
*
|
1067
|
+
* - `timeout` : Maximum time in milliseconds for resources to load, defaults
|
1068
|
+
* to 30 seconds, pass `0` to disable timeout. The default value can be
|
1069
|
+
* changed by using the {@link Page.setDefaultNavigationTimeout} or
|
1070
|
+
* {@link Page.setDefaultTimeout} methods.
|
1071
|
+
*
|
1072
|
+
* - `waitUntil`: When to consider setting markup succeeded, defaults to
|
1073
|
+
* `load`. Given an array of event strings, setting content is considered
|
1074
|
+
* to be successful after all events have been fired. Events can be
|
1075
|
+
* either:<br/>
|
1076
|
+
* - `load` : consider setting content to be finished when the `load` event
|
1077
|
+
* is fired.<br/>
|
1078
|
+
* - `domcontentloaded` : consider setting content to be finished when the
|
1079
|
+
* `DOMContentLoaded` event is fired.<br/>
|
1080
|
+
* - `networkidle0` : consider setting content to be finished when there are
|
1081
|
+
* no more than 0 network connections for at least `500` ms.<br/>
|
1082
|
+
* - `networkidle2` : consider setting content to be finished when there are
|
1083
|
+
* no more than 2 network connections for at least `500` ms.
|
1084
|
+
*/
|
1085
|
+
setContent(html: string, options?: WaitForOptions): Promise<void>;
|
1086
|
+
/**
|
1087
|
+
* @param url - URL to navigate page to. The URL should include scheme, e.g.
|
1088
|
+
* `https://`
|
1089
|
+
* @param options - Navigation Parameter
|
1090
|
+
* @returns Promise which resolves to the main resource response. In case of
|
1091
|
+
* multiple redirects, the navigation will resolve with the response of the
|
1092
|
+
* last redirect.
|
1093
|
+
* @remarks
|
1094
|
+
* The argument `options` might have the following properties:
|
1095
|
+
*
|
1096
|
+
* - `timeout` : Maximum navigation time in milliseconds, defaults to 30
|
1097
|
+
* seconds, pass 0 to disable timeout. The default value can be changed by
|
1098
|
+
* using the {@link Page.setDefaultNavigationTimeout} or
|
1099
|
+
* {@link Page.setDefaultTimeout} methods.
|
1100
|
+
*
|
1101
|
+
* - `waitUntil`:When to consider navigation succeeded, defaults to `load`.
|
1102
|
+
* Given an array of event strings, navigation is considered to be
|
1103
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1104
|
+
* - `load` : consider navigation to be finished when the load event is
|
1105
|
+
* fired.<br/>
|
1106
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1107
|
+
* DOMContentLoaded event is fired.<br/>
|
1108
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1109
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1110
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1111
|
+
* more than 2 network connections for at least `500` ms.
|
1112
|
+
*
|
1113
|
+
* - `referer` : Referer header value. If provided it will take preference
|
1114
|
+
* over the referer header value set by
|
1115
|
+
* {@link Page.setExtraHTTPHeaders |page.setExtraHTTPHeaders()}.
|
1116
|
+
*
|
1117
|
+
* `page.goto` will throw an error if:
|
1118
|
+
*
|
1119
|
+
* - there's an SSL error (e.g. in case of self-signed certificates).
|
1120
|
+
* - target URL is invalid.
|
1121
|
+
* - the timeout is exceeded during navigation.
|
1122
|
+
* - the remote server does not respond or is unreachable.
|
1123
|
+
* - the main resource failed to load.
|
1124
|
+
*
|
1125
|
+
* `page.goto` will not throw an error when any valid HTTP status code is
|
1126
|
+
* returned by the remote server, including 404 "Not Found" and 500
|
1127
|
+
* "Internal Server Error". The status code for such responses can be
|
1128
|
+
* retrieved by calling response.status().
|
1129
|
+
*
|
1130
|
+
* NOTE: `page.goto` either throws an error or returns a main resource
|
1131
|
+
* response. The only exceptions are navigation to about:blank or navigation
|
1132
|
+
* to the same URL with a different hash, which would succeed and return null.
|
1133
|
+
*
|
1134
|
+
* NOTE: Headless mode doesn't support navigation to a PDF document. See the
|
1135
|
+
* {@link https://bugs.chromium.org/p/chromium/issues/detail?id=761295 |
|
1136
|
+
* upstream issue}.
|
1137
|
+
*
|
1138
|
+
* Shortcut for {@link Frame.goto | page.mainFrame().goto(url, options)}.
|
1139
|
+
*/
|
1140
|
+
goto(url: string, options?: WaitForOptions & {
|
1141
|
+
referer?: string;
|
1142
|
+
}): Promise<HTTPResponse | null>;
|
1143
|
+
/**
|
1144
|
+
* @param options - Navigation parameters which might have the following
|
1145
|
+
* properties:
|
1146
|
+
* @returns Promise which resolves to the main resource response. In case of
|
1147
|
+
* multiple redirects, the navigation will resolve with the response of the
|
1148
|
+
* last redirect.
|
1149
|
+
* @remarks
|
1150
|
+
* The argument `options` might have the following properties:
|
1151
|
+
*
|
1152
|
+
* - `timeout` : Maximum navigation time in milliseconds, defaults to 30
|
1153
|
+
* seconds, pass 0 to disable timeout. The default value can be changed by
|
1154
|
+
* using the {@link Page.setDefaultNavigationTimeout} or
|
1155
|
+
* {@link Page.setDefaultTimeout} methods.
|
1156
|
+
*
|
1157
|
+
* - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
|
1158
|
+
* Given an array of event strings, navigation is considered to be
|
1159
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1160
|
+
* - `load` : consider navigation to be finished when the load event is
|
1161
|
+
* fired.<br/>
|
1162
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1163
|
+
* DOMContentLoaded event is fired.<br/>
|
1164
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1165
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1166
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1167
|
+
* more than 2 network connections for at least `500` ms.
|
1168
|
+
*/
|
1169
|
+
reload(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1170
|
+
/**
|
1171
|
+
* Waits for the page to navigate to a new URL or to reload. It is useful when
|
1172
|
+
* you run code that will indirectly cause the page to navigate.
|
1173
|
+
*
|
1174
|
+
* @example
|
1175
|
+
*
|
1176
|
+
* ```ts
|
1177
|
+
* const [response] = await Promise.all([
|
1178
|
+
* page.waitForNavigation(), // The promise resolves after navigation has finished
|
1179
|
+
* page.click('a.my-link'), // Clicking the link will indirectly cause a navigation
|
1180
|
+
* ]);
|
1181
|
+
* ```
|
1182
|
+
*
|
1183
|
+
* @remarks
|
1184
|
+
* Usage of the
|
1185
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/History_API | History API}
|
1186
|
+
* to change the URL is considered a navigation.
|
1187
|
+
*
|
1188
|
+
* @param options - Navigation parameters which might have the following
|
1189
|
+
* properties:
|
1190
|
+
* @returns A `Promise` which resolves to the main resource response.
|
1191
|
+
*
|
1192
|
+
* - In case of multiple redirects, the navigation will resolve with the
|
1193
|
+
* response of the last redirect.
|
1194
|
+
* - In case of navigation to a different anchor or navigation due to History
|
1195
|
+
* API usage, the navigation will resolve with `null`.
|
1196
|
+
*/
|
1197
|
+
waitForNavigation(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1198
|
+
/**
|
1199
|
+
* @param urlOrPredicate - A URL or predicate to wait for
|
1200
|
+
* @param options - Optional waiting parameters
|
1201
|
+
* @returns Promise which resolves to the matched request
|
1202
|
+
* @example
|
1203
|
+
*
|
1204
|
+
* ```ts
|
1205
|
+
* const firstRequest = await page.waitForRequest(
|
1206
|
+
* 'https://example.com/resource'
|
1207
|
+
* );
|
1208
|
+
* const finalRequest = await page.waitForRequest(
|
1209
|
+
* request => request.url() === 'https://example.com'
|
1210
|
+
* );
|
1211
|
+
* return finalRequest.response()?.ok();
|
1212
|
+
* ```
|
1213
|
+
*
|
1214
|
+
* @remarks
|
1215
|
+
* Optional Waiting Parameters have:
|
1216
|
+
*
|
1217
|
+
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass
|
1218
|
+
* `0` to disable the timeout. The default value can be changed by using the
|
1219
|
+
* {@link Page.setDefaultTimeout} method.
|
1220
|
+
*/
|
1221
|
+
waitForRequest(urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>), options?: {
|
1222
|
+
timeout?: number;
|
1223
|
+
}): Promise<HTTPRequest>;
|
1224
|
+
/**
|
1225
|
+
* @param urlOrPredicate - A URL or predicate to wait for.
|
1226
|
+
* @param options - Optional waiting parameters
|
1227
|
+
* @returns Promise which resolves to the matched response.
|
1228
|
+
* @example
|
1229
|
+
*
|
1230
|
+
* ```ts
|
1231
|
+
* const firstResponse = await page.waitForResponse(
|
1232
|
+
* 'https://example.com/resource'
|
1233
|
+
* );
|
1234
|
+
* const finalResponse = await page.waitForResponse(
|
1235
|
+
* response =>
|
1236
|
+
* response.url() === 'https://example.com' && response.status() === 200
|
1237
|
+
* );
|
1238
|
+
* const finalResponse = await page.waitForResponse(async response => {
|
1239
|
+
* return (await response.text()).includes('<html>');
|
1240
|
+
* });
|
1241
|
+
* return finalResponse.ok();
|
1242
|
+
* ```
|
1243
|
+
*
|
1244
|
+
* @remarks
|
1245
|
+
* Optional Parameter have:
|
1246
|
+
*
|
1247
|
+
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds,
|
1248
|
+
* pass `0` to disable the timeout. The default value can be changed by using
|
1249
|
+
* the {@link Page.setDefaultTimeout} method.
|
1250
|
+
*/
|
1251
|
+
waitForResponse(urlOrPredicate: string | ((res: HTTPResponse) => boolean | Promise<boolean>), options?: {
|
1252
|
+
timeout?: number;
|
1253
|
+
}): Promise<HTTPResponse>;
|
1254
|
+
/**
|
1255
|
+
* @param options - Optional waiting parameters
|
1256
|
+
* @returns Promise which resolves when network is idle
|
1257
|
+
*/
|
1258
|
+
waitForNetworkIdle(options?: {
|
1259
|
+
idleTime?: number;
|
1260
|
+
timeout?: number;
|
1261
|
+
}): Promise<void>;
|
1262
|
+
/**
|
1263
|
+
* @param urlOrPredicate - A URL or predicate to wait for.
|
1264
|
+
* @param options - Optional waiting parameters
|
1265
|
+
* @returns Promise which resolves to the matched frame.
|
1266
|
+
* @example
|
1267
|
+
*
|
1268
|
+
* ```ts
|
1269
|
+
* const frame = await page.waitForFrame(async frame => {
|
1270
|
+
* return frame.name() === 'Test';
|
1271
|
+
* });
|
1272
|
+
* ```
|
1273
|
+
*
|
1274
|
+
* @remarks
|
1275
|
+
* Optional Parameter have:
|
1276
|
+
*
|
1277
|
+
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds,
|
1278
|
+
* pass `0` to disable the timeout. The default value can be changed by using
|
1279
|
+
* the {@link Page.setDefaultTimeout} method.
|
1280
|
+
*/
|
1281
|
+
waitForFrame(urlOrPredicate: string | ((frame: Frame) => boolean | Promise<boolean>), options?: {
|
1282
|
+
timeout?: number;
|
1283
|
+
}): Promise<Frame>;
|
1284
|
+
/**
|
1285
|
+
* This method navigate to the previous page in history.
|
1286
|
+
* @param options - Navigation parameters
|
1287
|
+
* @returns Promise which resolves to the main resource response. In case of
|
1288
|
+
* multiple redirects, the navigation will resolve with the response of the
|
1289
|
+
* last redirect. If can not go back, resolves to `null`.
|
1290
|
+
* @remarks
|
1291
|
+
* The argument `options` might have the following properties:
|
1292
|
+
*
|
1293
|
+
* - `timeout` : Maximum navigation time in milliseconds, defaults to 30
|
1294
|
+
* seconds, pass 0 to disable timeout. The default value can be changed by
|
1295
|
+
* using the {@link Page.setDefaultNavigationTimeout} or
|
1296
|
+
* {@link Page.setDefaultTimeout} methods.
|
1297
|
+
*
|
1298
|
+
* - `waitUntil` : When to consider navigation succeeded, defaults to `load`.
|
1299
|
+
* Given an array of event strings, navigation is considered to be
|
1300
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1301
|
+
* - `load` : consider navigation to be finished when the load event is
|
1302
|
+
* fired.<br/>
|
1303
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1304
|
+
* DOMContentLoaded event is fired.<br/>
|
1305
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1306
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1307
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1308
|
+
* more than 2 network connections for at least `500` ms.
|
1309
|
+
*/
|
1310
|
+
goBack(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1311
|
+
/**
|
1312
|
+
* This method navigate to the next page in history.
|
1313
|
+
* @param options - Navigation Parameter
|
1314
|
+
* @returns Promise which resolves to the main resource response. In case of
|
1315
|
+
* multiple redirects, the navigation will resolve with the response of the
|
1316
|
+
* last redirect. If can not go forward, resolves to `null`.
|
1317
|
+
* @remarks
|
1318
|
+
* The argument `options` might have the following properties:
|
1319
|
+
*
|
1320
|
+
* - `timeout` : Maximum navigation time in milliseconds, defaults to 30
|
1321
|
+
* seconds, pass 0 to disable timeout. The default value can be changed by
|
1322
|
+
* using the {@link Page.setDefaultNavigationTimeout} or
|
1323
|
+
* {@link Page.setDefaultTimeout} methods.
|
1324
|
+
*
|
1325
|
+
* - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
|
1326
|
+
* Given an array of event strings, navigation is considered to be
|
1327
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1328
|
+
* - `load` : consider navigation to be finished when the load event is
|
1329
|
+
* fired.<br/>
|
1330
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1331
|
+
* DOMContentLoaded event is fired.<br/>
|
1332
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1333
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1334
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1335
|
+
* more than 2 network connections for at least `500` ms.
|
1336
|
+
*/
|
1337
|
+
goForward(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1338
|
+
/**
|
1339
|
+
* Brings page to front (activates tab).
|
1340
|
+
*/
|
1341
|
+
bringToFront(): Promise<void>;
|
1342
|
+
/**
|
1343
|
+
* Emulates a given device's metrics and user agent.
|
1344
|
+
*
|
1345
|
+
* To aid emulation, Puppeteer provides a list of known devices that can be
|
1346
|
+
* via {@link KnownDevices}.
|
1347
|
+
*
|
1348
|
+
* @remarks
|
1349
|
+
* This method is a shortcut for calling two methods:
|
1350
|
+
* {@link Page.setUserAgent} and {@link Page.setViewport}.
|
1351
|
+
*
|
1352
|
+
* @remarks
|
1353
|
+
* This method will resize the page. A lot of websites don't expect phones to
|
1354
|
+
* change size, so you should emulate before navigating to the page.
|
1355
|
+
*
|
1356
|
+
* @example
|
1357
|
+
*
|
1358
|
+
* ```ts
|
1359
|
+
* import {KnownDevices} from 'puppeteer';
|
1360
|
+
* const iPhone = KnownDevices['iPhone 6'];
|
1361
|
+
*
|
1362
|
+
* (async () => {
|
1363
|
+
* const browser = await puppeteer.launch();
|
1364
|
+
* const page = await browser.newPage();
|
1365
|
+
* await page.emulate(iPhone);
|
1366
|
+
* await page.goto('https://www.google.com');
|
1367
|
+
* // other actions...
|
1368
|
+
* await browser.close();
|
1369
|
+
* })();
|
1370
|
+
* ```
|
1371
|
+
*/
|
1372
|
+
emulate(device: Device): Promise<void>;
|
1373
|
+
/**
|
1374
|
+
* @param enabled - Whether or not to enable JavaScript on the page.
|
1375
|
+
* @remarks
|
1376
|
+
* NOTE: changing this value won't affect scripts that have already been run.
|
1377
|
+
* It will take full effect on the next navigation.
|
1378
|
+
*/
|
1379
|
+
setJavaScriptEnabled(enabled: boolean): Promise<void>;
|
1380
|
+
/**
|
1381
|
+
* Toggles bypassing page's Content-Security-Policy.
|
1382
|
+
* @param enabled - sets bypassing of page's Content-Security-Policy.
|
1383
|
+
* @remarks
|
1384
|
+
* NOTE: CSP bypassing happens at the moment of CSP initialization rather than
|
1385
|
+
* evaluation. Usually, this means that `page.setBypassCSP` should be called
|
1386
|
+
* before navigating to the domain.
|
1387
|
+
*/
|
1388
|
+
setBypassCSP(enabled: boolean): Promise<void>;
|
1389
|
+
/**
|
1390
|
+
* @param type - Changes the CSS media type of the page. The only allowed
|
1391
|
+
* values are `screen`, `print` and `null`. Passing `null` disables CSS media
|
1392
|
+
* emulation.
|
1393
|
+
* @example
|
1394
|
+
*
|
1395
|
+
* ```ts
|
1396
|
+
* await page.evaluate(() => matchMedia('screen').matches);
|
1397
|
+
* // → true
|
1398
|
+
* await page.evaluate(() => matchMedia('print').matches);
|
1399
|
+
* // → false
|
1400
|
+
*
|
1401
|
+
* await page.emulateMediaType('print');
|
1402
|
+
* await page.evaluate(() => matchMedia('screen').matches);
|
1403
|
+
* // → false
|
1404
|
+
* await page.evaluate(() => matchMedia('print').matches);
|
1405
|
+
* // → true
|
1406
|
+
*
|
1407
|
+
* await page.emulateMediaType(null);
|
1408
|
+
* await page.evaluate(() => matchMedia('screen').matches);
|
1409
|
+
* // → true
|
1410
|
+
* await page.evaluate(() => matchMedia('print').matches);
|
1411
|
+
* // → false
|
1412
|
+
* ```
|
1413
|
+
*/
|
1414
|
+
emulateMediaType(type?: string): Promise<void>;
|
1415
|
+
/**
|
1416
|
+
* Enables CPU throttling to emulate slow CPUs.
|
1417
|
+
* @param factor - slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
|
1418
|
+
*/
|
1419
|
+
emulateCPUThrottling(factor: number | null): Promise<void>;
|
1420
|
+
/**
|
1421
|
+
* @param features - `<?Array<Object>>` Given an array of media feature
|
1422
|
+
* objects, emulates CSS media features on the page. Each media feature object
|
1423
|
+
* must have the following properties:
|
1424
|
+
* @example
|
1425
|
+
*
|
1426
|
+
* ```ts
|
1427
|
+
* await page.emulateMediaFeatures([
|
1428
|
+
* {name: 'prefers-color-scheme', value: 'dark'},
|
1429
|
+
* ]);
|
1430
|
+
* await page.evaluate(
|
1431
|
+
* () => matchMedia('(prefers-color-scheme: dark)').matches
|
1432
|
+
* );
|
1433
|
+
* // → true
|
1434
|
+
* await page.evaluate(
|
1435
|
+
* () => matchMedia('(prefers-color-scheme: light)').matches
|
1436
|
+
* );
|
1437
|
+
* // → false
|
1438
|
+
*
|
1439
|
+
* await page.emulateMediaFeatures([
|
1440
|
+
* {name: 'prefers-reduced-motion', value: 'reduce'},
|
1441
|
+
* ]);
|
1442
|
+
* await page.evaluate(
|
1443
|
+
* () => matchMedia('(prefers-reduced-motion: reduce)').matches
|
1444
|
+
* );
|
1445
|
+
* // → true
|
1446
|
+
* await page.evaluate(
|
1447
|
+
* () => matchMedia('(prefers-reduced-motion: no-preference)').matches
|
1448
|
+
* );
|
1449
|
+
* // → false
|
1450
|
+
*
|
1451
|
+
* await page.emulateMediaFeatures([
|
1452
|
+
* {name: 'prefers-color-scheme', value: 'dark'},
|
1453
|
+
* {name: 'prefers-reduced-motion', value: 'reduce'},
|
1454
|
+
* ]);
|
1455
|
+
* await page.evaluate(
|
1456
|
+
* () => matchMedia('(prefers-color-scheme: dark)').matches
|
1457
|
+
* );
|
1458
|
+
* // → true
|
1459
|
+
* await page.evaluate(
|
1460
|
+
* () => matchMedia('(prefers-color-scheme: light)').matches
|
1461
|
+
* );
|
1462
|
+
* // → false
|
1463
|
+
* await page.evaluate(
|
1464
|
+
* () => matchMedia('(prefers-reduced-motion: reduce)').matches
|
1465
|
+
* );
|
1466
|
+
* // → true
|
1467
|
+
* await page.evaluate(
|
1468
|
+
* () => matchMedia('(prefers-reduced-motion: no-preference)').matches
|
1469
|
+
* );
|
1470
|
+
* // → false
|
1471
|
+
*
|
1472
|
+
* await page.emulateMediaFeatures([{name: 'color-gamut', value: 'p3'}]);
|
1473
|
+
* await page.evaluate(() => matchMedia('(color-gamut: srgb)').matches);
|
1474
|
+
* // → true
|
1475
|
+
* await page.evaluate(() => matchMedia('(color-gamut: p3)').matches);
|
1476
|
+
* // → true
|
1477
|
+
* await page.evaluate(() => matchMedia('(color-gamut: rec2020)').matches);
|
1478
|
+
* // → false
|
1479
|
+
* ```
|
1480
|
+
*/
|
1481
|
+
emulateMediaFeatures(features?: MediaFeature[]): Promise<void>;
|
1482
|
+
/**
|
1483
|
+
* @param timezoneId - Changes the timezone of the page. See
|
1484
|
+
* {@link https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt | ICU’s metaZones.txt}
|
1485
|
+
* for a list of supported timezone IDs. Passing
|
1486
|
+
* `null` disables timezone emulation.
|
1487
|
+
*/
|
1488
|
+
emulateTimezone(timezoneId?: string): Promise<void>;
|
1489
|
+
/**
|
1490
|
+
* Emulates the idle state.
|
1491
|
+
* If no arguments set, clears idle state emulation.
|
1492
|
+
*
|
1493
|
+
* @example
|
1494
|
+
*
|
1495
|
+
* ```ts
|
1496
|
+
* // set idle emulation
|
1497
|
+
* await page.emulateIdleState({isUserActive: true, isScreenUnlocked: false});
|
1498
|
+
*
|
1499
|
+
* // do some checks here
|
1500
|
+
* ...
|
1501
|
+
*
|
1502
|
+
* // clear idle emulation
|
1503
|
+
* await page.emulateIdleState();
|
1504
|
+
* ```
|
1505
|
+
*
|
1506
|
+
* @param overrides - Mock idle state. If not set, clears idle overrides
|
1507
|
+
*/
|
1508
|
+
emulateIdleState(overrides?: {
|
1509
|
+
isUserActive: boolean;
|
1510
|
+
isScreenUnlocked: boolean;
|
1511
|
+
}): Promise<void>;
|
1512
|
+
/**
|
1513
|
+
* Simulates the given vision deficiency on the page.
|
1514
|
+
*
|
1515
|
+
* @example
|
1516
|
+
*
|
1517
|
+
* ```ts
|
1518
|
+
* const puppeteer = require('puppeteer');
|
1519
|
+
*
|
1520
|
+
* (async () => {
|
1521
|
+
* const browser = await puppeteer.launch();
|
1522
|
+
* const page = await browser.newPage();
|
1523
|
+
* await page.goto('https://v8.dev/blog/10-years');
|
1524
|
+
*
|
1525
|
+
* await page.emulateVisionDeficiency('achromatopsia');
|
1526
|
+
* await page.screenshot({path: 'achromatopsia.png'});
|
1527
|
+
*
|
1528
|
+
* await page.emulateVisionDeficiency('deuteranopia');
|
1529
|
+
* await page.screenshot({path: 'deuteranopia.png'});
|
1530
|
+
*
|
1531
|
+
* await page.emulateVisionDeficiency('blurredVision');
|
1532
|
+
* await page.screenshot({path: 'blurred-vision.png'});
|
1533
|
+
*
|
1534
|
+
* await browser.close();
|
1535
|
+
* })();
|
1536
|
+
* ```
|
1537
|
+
*
|
1538
|
+
* @param type - the type of deficiency to simulate, or `'none'` to reset.
|
1539
|
+
*/
|
1540
|
+
emulateVisionDeficiency(type?: Protocol.Emulation.SetEmulatedVisionDeficiencyRequest['type']): Promise<void>;
|
1541
|
+
/**
|
1542
|
+
* `page.setViewport` will resize the page. A lot of websites don't expect
|
1543
|
+
* phones to change size, so you should set the viewport before navigating to
|
1544
|
+
* the page.
|
1545
|
+
*
|
1546
|
+
* In the case of multiple pages in a single browser, each page can have its
|
1547
|
+
* own viewport size.
|
1548
|
+
* @example
|
1549
|
+
*
|
1550
|
+
* ```ts
|
1551
|
+
* const page = await browser.newPage();
|
1552
|
+
* await page.setViewport({
|
1553
|
+
* width: 640,
|
1554
|
+
* height: 480,
|
1555
|
+
* deviceScaleFactor: 1,
|
1556
|
+
* });
|
1557
|
+
* await page.goto('https://example.com');
|
1558
|
+
* ```
|
1559
|
+
*
|
1560
|
+
* @param viewport -
|
1561
|
+
* @remarks
|
1562
|
+
* Argument viewport have following properties:
|
1563
|
+
*
|
1564
|
+
* - `width`: page width in pixels. required
|
1565
|
+
*
|
1566
|
+
* - `height`: page height in pixels. required
|
1567
|
+
*
|
1568
|
+
* - `deviceScaleFactor`: Specify device scale factor (can be thought of as
|
1569
|
+
* DPR). Defaults to `1`.
|
1570
|
+
*
|
1571
|
+
* - `isMobile`: Whether the meta viewport tag is taken into account. Defaults
|
1572
|
+
* to `false`.
|
1573
|
+
*
|
1574
|
+
* - `hasTouch`: Specifies if viewport supports touch events. Defaults to `false`
|
1575
|
+
*
|
1576
|
+
* - `isLandScape`: Specifies if viewport is in landscape mode. Defaults to false.
|
1577
|
+
*
|
1578
|
+
* NOTE: in certain cases, setting viewport will reload the page in order to
|
1579
|
+
* set the isMobile or hasTouch properties.
|
1580
|
+
*/
|
1581
|
+
setViewport(viewport: Viewport): Promise<void>;
|
1582
|
+
/**
|
1583
|
+
* @returns
|
1584
|
+
*
|
1585
|
+
* - `width`: page's width in pixels
|
1586
|
+
*
|
1587
|
+
* - `height`: page's height in pixels
|
1588
|
+
*
|
1589
|
+
* - `deviceScalarFactor`: Specify device scale factor (can be though of as
|
1590
|
+
* dpr). Defaults to `1`.
|
1591
|
+
*
|
1592
|
+
* - `isMobile`: Whether the meta viewport tag is taken into account. Defaults
|
1593
|
+
* to `false`.
|
1594
|
+
*
|
1595
|
+
* - `hasTouch`: Specifies if viewport supports touch events. Defaults to
|
1596
|
+
* `false`.
|
1597
|
+
*
|
1598
|
+
* - `isLandScape`: Specifies if viewport is in landscape mode. Defaults to
|
1599
|
+
* `false`.
|
1600
|
+
*/
|
1601
|
+
viewport(): Viewport | null;
|
1602
|
+
/**
|
1603
|
+
* Evaluates a function in the page's context and returns the result.
|
1604
|
+
*
|
1605
|
+
* If the function passed to `page.evaluteHandle` returns a Promise, the
|
1606
|
+
* function will wait for the promise to resolve and return its value.
|
1607
|
+
*
|
1608
|
+
* @example
|
1609
|
+
*
|
1610
|
+
* ```ts
|
1611
|
+
* const result = await frame.evaluate(() => {
|
1612
|
+
* return Promise.resolve(8 * 7);
|
1613
|
+
* });
|
1614
|
+
* console.log(result); // prints "56"
|
1615
|
+
* ```
|
1616
|
+
*
|
1617
|
+
* You can pass a string instead of a function (although functions are
|
1618
|
+
* recommended as they are easier to debug and use with TypeScript):
|
1619
|
+
*
|
1620
|
+
* @example
|
1621
|
+
*
|
1622
|
+
* ```ts
|
1623
|
+
* const aHandle = await page.evaluate('1 + 2');
|
1624
|
+
* ```
|
1625
|
+
*
|
1626
|
+
* To get the best TypeScript experience, you should pass in as the
|
1627
|
+
* generic the type of `pageFunction`:
|
1628
|
+
*
|
1629
|
+
* ```ts
|
1630
|
+
* const aHandle = await page.evaluate(() => 2);
|
1631
|
+
* ```
|
1632
|
+
*
|
1633
|
+
* @example
|
1634
|
+
*
|
1635
|
+
* {@link ElementHandle} instances (including {@link JSHandle}s) can be passed
|
1636
|
+
* as arguments to the `pageFunction`:
|
1637
|
+
*
|
1638
|
+
* ```ts
|
1639
|
+
* const bodyHandle = await page.$('body');
|
1640
|
+
* const html = await page.evaluate(body => body.innerHTML, bodyHandle);
|
1641
|
+
* await bodyHandle.dispose();
|
1642
|
+
* ```
|
1643
|
+
*
|
1644
|
+
* @param pageFunction - a function that is run within the page
|
1645
|
+
* @param args - arguments to be passed to the pageFunction
|
1646
|
+
*
|
1647
|
+
* @returns the return value of `pageFunction`.
|
1648
|
+
*/
|
1649
|
+
evaluate<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>;
|
1650
|
+
/**
|
1651
|
+
* Adds a function which would be invoked in one of the following scenarios:
|
1652
|
+
*
|
1653
|
+
* - whenever the page is navigated
|
1654
|
+
*
|
1655
|
+
* - whenever the child frame is attached or navigated. In this case, the
|
1656
|
+
* function is invoked in the context of the newly attached frame.
|
1657
|
+
*
|
1658
|
+
* The function is invoked after the document was created but before any of
|
1659
|
+
* its scripts were run. This is useful to amend the JavaScript environment,
|
1660
|
+
* e.g. to seed `Math.random`.
|
1661
|
+
* @param pageFunction - Function to be evaluated in browser context
|
1662
|
+
* @param args - Arguments to pass to `pageFunction`
|
1663
|
+
* @example
|
1664
|
+
* An example of overriding the navigator.languages property before the page loads:
|
1665
|
+
*
|
1666
|
+
* ```ts
|
1667
|
+
* // preload.js
|
1668
|
+
*
|
1669
|
+
* // overwrite the `languages` property to use a custom getter
|
1670
|
+
* Object.defineProperty(navigator, 'languages', {
|
1671
|
+
* get: function () {
|
1672
|
+
* return ['en-US', 'en', 'bn'];
|
1673
|
+
* },
|
1674
|
+
* });
|
1675
|
+
*
|
1676
|
+
* // In your puppeteer script, assuming the preload.js file is
|
1677
|
+
* // in same folder of our script.
|
1678
|
+
* const preloadFile = fs.readFileSync('./preload.js', 'utf8');
|
1679
|
+
* await page.evaluateOnNewDocument(preloadFile);
|
1680
|
+
* ```
|
1681
|
+
*/
|
1682
|
+
evaluateOnNewDocument<Params extends unknown[], Func extends (...args: Params) => unknown = (...args: Params) => unknown>(pageFunction: Func | string, ...args: Params): Promise<void>;
|
1683
|
+
/**
|
1684
|
+
* Toggles ignoring cache for each request based on the enabled state. By
|
1685
|
+
* default, caching is enabled.
|
1686
|
+
* @param enabled - sets the `enabled` state of cache
|
1687
|
+
* @defaultValue true
|
1688
|
+
*/
|
1689
|
+
setCacheEnabled(enabled?: boolean): Promise<void>;
|
1690
|
+
/**
|
1691
|
+
* @remarks
|
1692
|
+
* Options object which might have the following properties:
|
1693
|
+
*
|
1694
|
+
* - `path` : The file path to save the image to. The screenshot type
|
1695
|
+
* will be inferred from file extension. If `path` is a relative path, then
|
1696
|
+
* it is resolved relative to
|
1697
|
+
* {@link https://nodejs.org/api/process.html#process_process_cwd
|
1698
|
+
* | current working directory}.
|
1699
|
+
* If no path is provided, the image won't be saved to the disk.
|
1700
|
+
*
|
1701
|
+
* - `type` : Specify screenshot type, can be either `jpeg` or `png`.
|
1702
|
+
* Defaults to 'png'.
|
1703
|
+
*
|
1704
|
+
* - `quality` : The quality of the image, between 0-100. Not
|
1705
|
+
* applicable to `png` images.
|
1706
|
+
*
|
1707
|
+
* - `fullPage` : When true, takes a screenshot of the full
|
1708
|
+
* scrollable page. Defaults to `false`.
|
1709
|
+
*
|
1710
|
+
* - `clip` : An object which specifies clipping region of the page.
|
1711
|
+
* Should have the following fields:<br/>
|
1712
|
+
* - `x` : x-coordinate of top-left corner of clip area.<br/>
|
1713
|
+
* - `y` : y-coordinate of top-left corner of clip area.<br/>
|
1714
|
+
* - `width` : width of clipping area.<br/>
|
1715
|
+
* - `height` : height of clipping area.
|
1716
|
+
*
|
1717
|
+
* - `omitBackground` : Hides default white background and allows
|
1718
|
+
* capturing screenshots with transparency. Defaults to `false`.
|
1719
|
+
*
|
1720
|
+
* - `encoding` : The encoding of the image, can be either base64 or
|
1721
|
+
* binary. Defaults to `binary`.
|
1722
|
+
*
|
1723
|
+
* - `captureBeyondViewport` : When true, captures screenshot
|
1724
|
+
* {@link https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
|
1725
|
+
* | beyond the viewport}. When false, falls back to old behaviour,
|
1726
|
+
* and cuts the screenshot by the viewport size. Defaults to `true`.
|
1727
|
+
*
|
1728
|
+
* - `fromSurface` : When true, captures screenshot
|
1729
|
+
* {@link https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot
|
1730
|
+
* | from the surface rather than the view}. When false, works only in
|
1731
|
+
* headful mode and ignores page viewport (but not browser window's
|
1732
|
+
* bounds). Defaults to `true`.
|
1733
|
+
*
|
1734
|
+
* NOTE: Screenshots take at least 1/6 second on OS X. See
|
1735
|
+
* {@link https://crbug.com/741689} for discussion.
|
1736
|
+
* @returns Promise which resolves to buffer or a base64 string (depending on
|
1737
|
+
* the value of `encoding`) with captured screenshot.
|
1738
|
+
*/
|
1739
|
+
screenshot(options?: ScreenshotOptions): Promise<Buffer | string>;
|
1740
|
+
/**
|
1741
|
+
* Generates a PDF of the page with the `print` CSS media type.
|
1742
|
+
* @remarks
|
1743
|
+
*
|
1744
|
+
* NOTE: PDF generation is only supported in Chrome headless mode.
|
1745
|
+
*
|
1746
|
+
* To generate a PDF with the `screen` media type, call
|
1747
|
+
* {@link Page.emulateMediaType | `page.emulateMediaType('screen')`} before
|
1748
|
+
* calling `page.pdf()`.
|
1749
|
+
*
|
1750
|
+
* By default, `page.pdf()` generates a pdf with modified colors for printing.
|
1751
|
+
* Use the
|
1752
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust | `-webkit-print-color-adjust`}
|
1753
|
+
* property to force rendering of exact colors.
|
1754
|
+
*
|
1755
|
+
* @param options - options for generating the PDF.
|
1756
|
+
*/
|
1757
|
+
createPDFStream(options?: PDFOptions): Promise<Readable>;
|
1758
|
+
/**
|
1759
|
+
* @param options -
|
1760
|
+
* @returns
|
1761
|
+
*/
|
1762
|
+
pdf(options?: PDFOptions): Promise<Buffer>;
|
1763
|
+
/**
|
1764
|
+
* @returns The page's title
|
1765
|
+
* @remarks
|
1766
|
+
* Shortcut for {@link Frame.title | page.mainFrame().title()}.
|
1767
|
+
*/
|
1768
|
+
title(): Promise<string>;
|
1769
|
+
close(options?: {
|
1770
|
+
runBeforeUnload?: boolean;
|
1771
|
+
}): Promise<void>;
|
1772
|
+
/**
|
1773
|
+
* Indicates that the page has been closed.
|
1774
|
+
* @returns
|
1775
|
+
*/
|
1776
|
+
isClosed(): boolean;
|
1777
|
+
get mouse(): Mouse;
|
1778
|
+
/**
|
1779
|
+
* This method fetches an element with `selector`, scrolls it into view if
|
1780
|
+
* needed, and then uses {@link Page.mouse} to click in the center of the
|
1781
|
+
* element. If there's no element matching `selector`, the method throws an
|
1782
|
+
* error.
|
1783
|
+
* @remarks Bear in mind that if `click()` triggers a navigation event and
|
1784
|
+
* there's a separate `page.waitForNavigation()` promise to be resolved, you
|
1785
|
+
* may end up with a race condition that yields unexpected results. The
|
1786
|
+
* correct pattern for click and wait for navigation is the following:
|
1787
|
+
*
|
1788
|
+
* ```ts
|
1789
|
+
* const [response] = await Promise.all([
|
1790
|
+
* page.waitForNavigation(waitOptions),
|
1791
|
+
* page.click(selector, clickOptions),
|
1792
|
+
* ]);
|
1793
|
+
* ```
|
1794
|
+
*
|
1795
|
+
* Shortcut for {@link Frame.click | page.mainFrame().click(selector[, options]) }.
|
1796
|
+
* @param selector - A `selector` to search for element to click. If there are
|
1797
|
+
* multiple elements satisfying the `selector`, the first will be clicked
|
1798
|
+
* @param options - `Object`
|
1799
|
+
* @returns Promise which resolves when the element matching `selector` is
|
1800
|
+
* successfully clicked. The Promise will be rejected if there is no element
|
1801
|
+
* matching `selector`.
|
1802
|
+
*/
|
1803
|
+
click(selector: string, options?: {
|
1804
|
+
delay?: number;
|
1805
|
+
button?: MouseButton;
|
1806
|
+
clickCount?: number;
|
1807
|
+
}): Promise<void>;
|
1808
|
+
/**
|
1809
|
+
* This method fetches an element with `selector` and focuses it. If there's no
|
1810
|
+
* element matching `selector`, the method throws an error.
|
1811
|
+
* @param selector - A
|
1812
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector }
|
1813
|
+
* of an element to focus. If there are multiple elements satisfying the
|
1814
|
+
* selector, the first will be focused.
|
1815
|
+
* @returns Promise which resolves when the element matching selector is
|
1816
|
+
* successfully focused. The promise will be rejected if there is no element
|
1817
|
+
* matching selector.
|
1818
|
+
* @remarks
|
1819
|
+
* Shortcut for {@link Frame.focus | page.mainFrame().focus(selector)}.
|
1820
|
+
*/
|
1821
|
+
focus(selector: string): Promise<void>;
|
1822
|
+
/**
|
1823
|
+
* This method fetches an element with `selector`, scrolls it into view if
|
1824
|
+
* needed, and then uses {@link Page.mouse} to hover over the center of the element.
|
1825
|
+
* If there's no element matching `selector`, the method throws an error.
|
1826
|
+
* @param selector - A
|
1827
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
1828
|
+
* to search for element to hover. If there are multiple elements satisfying
|
1829
|
+
* the selector, the first will be hovered.
|
1830
|
+
* @returns Promise which resolves when the element matching `selector` is
|
1831
|
+
* successfully hovered. Promise gets rejected if there's no element matching
|
1832
|
+
* `selector`.
|
1833
|
+
* @remarks
|
1834
|
+
* Shortcut for {@link Page.hover | page.mainFrame().hover(selector)}.
|
1835
|
+
*/
|
1836
|
+
hover(selector: string): Promise<void>;
|
1837
|
+
/**
|
1838
|
+
* Triggers a `change` and `input` event once all the provided options have been
|
1839
|
+
* selected. If there's no `<select>` element matching `selector`, the method
|
1840
|
+
* throws an error.
|
1841
|
+
*
|
1842
|
+
* @example
|
1843
|
+
*
|
1844
|
+
* ```ts
|
1845
|
+
* page.select('select#colors', 'blue'); // single selection
|
1846
|
+
* page.select('select#colors', 'red', 'green', 'blue'); // multiple selections
|
1847
|
+
* ```
|
1848
|
+
*
|
1849
|
+
* @param selector - A
|
1850
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
|
1851
|
+
* to query the page for
|
1852
|
+
* @param values - Values of options to select. If the `<select>` has the
|
1853
|
+
* `multiple` attribute, all values are considered, otherwise only the first one
|
1854
|
+
* is taken into account.
|
1855
|
+
* @returns
|
1856
|
+
*
|
1857
|
+
* @remarks
|
1858
|
+
* Shortcut for {@link Frame.select | page.mainFrame().select()}
|
1859
|
+
*/
|
1860
|
+
select(selector: string, ...values: string[]): Promise<string[]>;
|
1861
|
+
/**
|
1862
|
+
* This method fetches an element with `selector`, scrolls it into view if
|
1863
|
+
* needed, and then uses {@link Page.touchscreen} to tap in the center of the element.
|
1864
|
+
* If there's no element matching `selector`, the method throws an error.
|
1865
|
+
* @param selector - A
|
1866
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
|
1867
|
+
* to search for element to tap. If there are multiple elements satisfying the
|
1868
|
+
* selector, the first will be tapped.
|
1869
|
+
* @returns
|
1870
|
+
* @remarks
|
1871
|
+
* Shortcut for {@link Frame.tap | page.mainFrame().tap(selector)}.
|
1872
|
+
*/
|
1873
|
+
tap(selector: string): Promise<void>;
|
1874
|
+
/**
|
1875
|
+
* Sends a `keydown`, `keypress/input`, and `keyup` event for each character
|
1876
|
+
* in the text.
|
1877
|
+
*
|
1878
|
+
* To press a special key, like `Control` or `ArrowDown`, use {@link Keyboard.press}.
|
1879
|
+
* @example
|
1880
|
+
*
|
1881
|
+
* ```ts
|
1882
|
+
* await page.type('#mytextarea', 'Hello');
|
1883
|
+
* // Types instantly
|
1884
|
+
* await page.type('#mytextarea', 'World', {delay: 100});
|
1885
|
+
* // Types slower, like a user
|
1886
|
+
* ```
|
1887
|
+
*
|
1888
|
+
* @param selector - A
|
1889
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
1890
|
+
* of an element to type into. If there are multiple elements satisfying the
|
1891
|
+
* selector, the first will be used.
|
1892
|
+
* @param text - A text to type into a focused element.
|
1893
|
+
* @param options - have property `delay` which is the Time to wait between
|
1894
|
+
* key presses in milliseconds. Defaults to `0`.
|
1895
|
+
* @returns
|
1896
|
+
* @remarks
|
1897
|
+
*/
|
1898
|
+
type(selector: string, text: string, options?: {
|
1899
|
+
delay: number;
|
1900
|
+
}): Promise<void>;
|
1901
|
+
/**
|
1902
|
+
* @deprecated Replace with `new Promise(r => setTimeout(r, milliseconds));`.
|
1903
|
+
*
|
1904
|
+
* Causes your script to wait for the given number of milliseconds.
|
1905
|
+
*
|
1906
|
+
* @remarks
|
1907
|
+
* It's generally recommended to not wait for a number of seconds, but instead
|
1908
|
+
* use {@link Frame.waitForSelector}, {@link Frame.waitForXPath} or
|
1909
|
+
* {@link Frame.waitForFunction} to wait for exactly the conditions you want.
|
1910
|
+
*
|
1911
|
+
* @example
|
1912
|
+
*
|
1913
|
+
* Wait for 1 second:
|
1914
|
+
*
|
1915
|
+
* ```ts
|
1916
|
+
* await page.waitForTimeout(1000);
|
1917
|
+
* ```
|
1918
|
+
*
|
1919
|
+
* @param milliseconds - the number of milliseconds to wait.
|
1920
|
+
*/
|
1921
|
+
waitForTimeout(milliseconds: number): Promise<void>;
|
1922
|
+
/**
|
1923
|
+
* Wait for the `selector` to appear in page. If at the moment of calling the
|
1924
|
+
* method the `selector` already exists, the method will return immediately. If
|
1925
|
+
* the `selector` doesn't appear after the `timeout` milliseconds of waiting, the
|
1926
|
+
* function will throw.
|
1927
|
+
*
|
1928
|
+
* This method works across navigations:
|
1929
|
+
*
|
1930
|
+
* ```ts
|
1931
|
+
* const puppeteer = require('puppeteer');
|
1932
|
+
* (async () => {
|
1933
|
+
* const browser = await puppeteer.launch();
|
1934
|
+
* const page = await browser.newPage();
|
1935
|
+
* let currentURL;
|
1936
|
+
* page
|
1937
|
+
* .waitForSelector('img')
|
1938
|
+
* .then(() => console.log('First URL with image: ' + currentURL));
|
1939
|
+
* for (currentURL of [
|
1940
|
+
* 'https://example.com',
|
1941
|
+
* 'https://google.com',
|
1942
|
+
* 'https://bbc.com',
|
1943
|
+
* ]) {
|
1944
|
+
* await page.goto(currentURL);
|
1945
|
+
* }
|
1946
|
+
* await browser.close();
|
1947
|
+
* })();
|
1948
|
+
* ```
|
1949
|
+
*
|
1950
|
+
* @param selector - A
|
1951
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
1952
|
+
* of an element to wait for
|
1953
|
+
* @param options - Optional waiting parameters
|
1954
|
+
* @returns Promise which resolves when element specified by selector string
|
1955
|
+
* is added to DOM. Resolves to `null` if waiting for hidden: `true` and
|
1956
|
+
* selector is not found in DOM.
|
1957
|
+
* @remarks
|
1958
|
+
* The optional Parameter in Arguments `options` are :
|
1959
|
+
*
|
1960
|
+
* - `Visible`: A boolean wait for element to be present in DOM and to be
|
1961
|
+
* visible, i.e. to not have `display: none` or `visibility: hidden` CSS
|
1962
|
+
* properties. Defaults to `false`.
|
1963
|
+
*
|
1964
|
+
* - `hidden`: Wait for element to not be found in the DOM or to be hidden,
|
1965
|
+
* i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to
|
1966
|
+
* `false`.
|
1967
|
+
*
|
1968
|
+
* - `timeout`: maximum time to wait for in milliseconds. Defaults to `30000`
|
1969
|
+
* (30 seconds). Pass `0` to disable timeout. The default value can be changed
|
1970
|
+
* by using the {@link Page.setDefaultTimeout} method.
|
1971
|
+
*/
|
1972
|
+
waitForSelector<Selector extends string>(selector: Selector, options?: WaitForSelectorOptions): Promise<ElementHandle<NodeFor<Selector>> | null>;
|
1973
|
+
/**
|
1974
|
+
* Wait for the `xpath` to appear in page. If at the moment of calling the
|
1975
|
+
* method the `xpath` already exists, the method will return immediately. If
|
1976
|
+
* the `xpath` doesn't appear after the `timeout` milliseconds of waiting, the
|
1977
|
+
* function will throw.
|
1978
|
+
*
|
1979
|
+
* This method works across navigation
|
1980
|
+
*
|
1981
|
+
* ```ts
|
1982
|
+
* const puppeteer = require('puppeteer');
|
1983
|
+
* (async () => {
|
1984
|
+
* const browser = await puppeteer.launch();
|
1985
|
+
* const page = await browser.newPage();
|
1986
|
+
* let currentURL;
|
1987
|
+
* page
|
1988
|
+
* .waitForXPath('//img')
|
1989
|
+
* .then(() => console.log('First URL with image: ' + currentURL));
|
1990
|
+
* for (currentURL of [
|
1991
|
+
* 'https://example.com',
|
1992
|
+
* 'https://google.com',
|
1993
|
+
* 'https://bbc.com',
|
1994
|
+
* ]) {
|
1995
|
+
* await page.goto(currentURL);
|
1996
|
+
* }
|
1997
|
+
* await browser.close();
|
1998
|
+
* })();
|
1999
|
+
* ```
|
2000
|
+
*
|
2001
|
+
* @param xpath - A
|
2002
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/XPath | xpath} of an
|
2003
|
+
* element to wait for
|
2004
|
+
* @param options - Optional waiting parameters
|
2005
|
+
* @returns Promise which resolves when element specified by xpath string is
|
2006
|
+
* added to DOM. Resolves to `null` if waiting for `hidden: true` and xpath is
|
2007
|
+
* not found in DOM.
|
2008
|
+
* @remarks
|
2009
|
+
* The optional Argument `options` have properties:
|
2010
|
+
*
|
2011
|
+
* - `visible`: A boolean to wait for element to be present in DOM and to be
|
2012
|
+
* visible, i.e. to not have `display: none` or `visibility: hidden` CSS
|
2013
|
+
* properties. Defaults to `false`.
|
2014
|
+
*
|
2015
|
+
* - `hidden`: A boolean wait for element to not be found in the DOM or to be
|
2016
|
+
* hidden, i.e. have `display: none` or `visibility: hidden` CSS properties.
|
2017
|
+
* Defaults to `false`.
|
2018
|
+
*
|
2019
|
+
* - `timeout`: A number which is maximum time to wait for in milliseconds.
|
2020
|
+
* Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
|
2021
|
+
* value can be changed by using the {@link Page.setDefaultTimeout} method.
|
2022
|
+
*/
|
2023
|
+
waitForXPath(xpath: string, options?: {
|
2024
|
+
visible?: boolean;
|
2025
|
+
hidden?: boolean;
|
2026
|
+
timeout?: number;
|
2027
|
+
}): Promise<ElementHandle<Node> | null>;
|
2028
|
+
/**
|
2029
|
+
* Waits for a function to finish evaluating in the page's context.
|
2030
|
+
*
|
2031
|
+
* @example
|
2032
|
+
* The {@link Page.waitForFunction} can be used to observe viewport size change:
|
2033
|
+
*
|
2034
|
+
* ```ts
|
2035
|
+
* const puppeteer = require('puppeteer');
|
2036
|
+
* (async () => {
|
2037
|
+
* const browser = await puppeteer.launch();
|
2038
|
+
* const page = await browser.newPage();
|
2039
|
+
* const watchDog = page.waitForFunction('window.innerWidth < 100');
|
2040
|
+
* await page.setViewport({width: 50, height: 50});
|
2041
|
+
* await watchDog;
|
2042
|
+
* await browser.close();
|
2043
|
+
* })();
|
2044
|
+
* ```
|
2045
|
+
*
|
2046
|
+
* @example
|
2047
|
+
* To pass arguments from node.js to the predicate of
|
2048
|
+
* {@link Page.waitForFunction} function:
|
2049
|
+
*
|
2050
|
+
* ```ts
|
2051
|
+
* const selector = '.foo';
|
2052
|
+
* await page.waitForFunction(
|
2053
|
+
* selector => !!document.querySelector(selector),
|
2054
|
+
* {},
|
2055
|
+
* selector
|
2056
|
+
* );
|
2057
|
+
* ```
|
2058
|
+
*
|
2059
|
+
* @example
|
2060
|
+
* The predicate of {@link Page.waitForFunction} can be asynchronous too:
|
2061
|
+
*
|
2062
|
+
* ```ts
|
2063
|
+
* const username = 'github-username';
|
2064
|
+
* await page.waitForFunction(
|
2065
|
+
* async username => {
|
2066
|
+
* const githubResponse = await fetch(
|
2067
|
+
* `https://api.github.com/users/${username}`
|
2068
|
+
* );
|
2069
|
+
* const githubUser = await githubResponse.json();
|
2070
|
+
* // show the avatar
|
2071
|
+
* const img = document.createElement('img');
|
2072
|
+
* img.src = githubUser.avatar_url;
|
2073
|
+
* // wait 3 seconds
|
2074
|
+
* await new Promise((resolve, reject) => setTimeout(resolve, 3000));
|
2075
|
+
* img.remove();
|
2076
|
+
* },
|
2077
|
+
* {},
|
2078
|
+
* username
|
2079
|
+
* );
|
2080
|
+
* ```
|
2081
|
+
*
|
2082
|
+
* @param pageFunction - Function to be evaluated in browser context
|
2083
|
+
* @param options - Options for configuring waiting behavior.
|
2084
|
+
*/
|
2085
|
+
waitForFunction<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, options?: FrameWaitForFunctionOptions, ...args: Params): Promise<HandleFor<Awaited<ReturnType<Func>>>>;
|
2086
|
+
}
|
2087
|
+
/**
|
2088
|
+
* @internal
|
2089
|
+
*/
|
2090
|
+
export declare const supportedMetrics: Set<string>;
|
2091
|
+
/**
|
2092
|
+
* @internal
|
2093
|
+
*/
|
2094
|
+
export declare const unitToPixels: {
|
2095
|
+
px: number;
|
2096
|
+
in: number;
|
2097
|
+
cm: number;
|
2098
|
+
mm: number;
|
2099
|
+
};
|
2100
|
+
//# sourceMappingURL=Page.d.ts.map
|