pokeedex 0.1.0 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/bin/pokeedex +1 -44
- data/lib/pokeedex/configuration.rb +0 -6
- data/lib/pokeedex/install_playwright.rb +62 -0
- data/lib/pokeedex/pokemon/scrapper/fetchers/base.rb +1 -1
- data/lib/pokeedex/version.rb +1 -1
- data/lib/pokeedex.rb +5 -2
- data/spec/pokeedex/configuration_spec.rb +0 -7
- data/spec/spec_helper.rb +1 -1
- metadata +2 -550
- data/node_modules/.bin/playwright +0 -1
- data/node_modules/.bin/playwright-core +0 -1
- data/node_modules/.yarn-integrity +0 -22
- data/node_modules/@playwright/test/LICENSE +0 -202
- data/node_modules/@playwright/test/NOTICE +0 -5
- data/node_modules/@playwright/test/README.md +0 -169
- data/node_modules/@playwright/test/cli.js +0 -19
- data/node_modules/@playwright/test/index.d.ts +0 -18
- data/node_modules/@playwright/test/index.js +0 -17
- data/node_modules/@playwright/test/index.mjs +0 -18
- data/node_modules/@playwright/test/node_modules/.bin/playwright +0 -1
- data/node_modules/@playwright/test/package.json +0 -35
- data/node_modules/@playwright/test/reporter.d.ts +0 -17
- data/node_modules/@playwright/test/reporter.js +0 -17
- data/node_modules/@playwright/test/reporter.mjs +0 -17
- data/node_modules/@types/node/LICENSE +0 -21
- data/node_modules/@types/node/README.md +0 -15
- data/node_modules/@types/node/assert/strict.d.ts +0 -8
- data/node_modules/@types/node/assert.d.ts +0 -1040
- data/node_modules/@types/node/async_hooks.d.ts +0 -541
- data/node_modules/@types/node/buffer.d.ts +0 -2300
- data/node_modules/@types/node/child_process.d.ts +0 -1544
- data/node_modules/@types/node/cluster.d.ts +0 -578
- data/node_modules/@types/node/console.d.ts +0 -452
- data/node_modules/@types/node/constants.d.ts +0 -19
- data/node_modules/@types/node/crypto.d.ts +0 -4451
- data/node_modules/@types/node/dgram.d.ts +0 -596
- data/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- data/node_modules/@types/node/dns/promises.d.ts +0 -476
- data/node_modules/@types/node/dns.d.ts +0 -865
- data/node_modules/@types/node/dom-events.d.ts +0 -124
- data/node_modules/@types/node/domain.d.ts +0 -170
- data/node_modules/@types/node/events.d.ts +0 -931
- data/node_modules/@types/node/fs/promises.d.ts +0 -1264
- data/node_modules/@types/node/fs.d.ts +0 -4390
- data/node_modules/@types/node/globals.d.ts +0 -611
- data/node_modules/@types/node/globals.global.d.ts +0 -1
- data/node_modules/@types/node/http.d.ts +0 -1921
- data/node_modules/@types/node/http2.d.ts +0 -2555
- data/node_modules/@types/node/https.d.ts +0 -544
- data/node_modules/@types/node/index.d.ts +0 -90
- data/node_modules/@types/node/inspector.d.ts +0 -3966
- data/node_modules/@types/node/module.d.ts +0 -301
- data/node_modules/@types/node/net.d.ts +0 -995
- data/node_modules/@types/node/os.d.ts +0 -495
- data/node_modules/@types/node/package.json +0 -217
- data/node_modules/@types/node/path.d.ts +0 -200
- data/node_modules/@types/node/perf_hooks.d.ts +0 -941
- data/node_modules/@types/node/process.d.ts +0 -1912
- data/node_modules/@types/node/punycode.d.ts +0 -117
- data/node_modules/@types/node/querystring.d.ts +0 -153
- data/node_modules/@types/node/readline/promises.d.ts +0 -150
- data/node_modules/@types/node/readline.d.ts +0 -540
- data/node_modules/@types/node/repl.d.ts +0 -430
- data/node_modules/@types/node/sea.d.ts +0 -153
- data/node_modules/@types/node/sqlite.d.ts +0 -213
- data/node_modules/@types/node/stream/consumers.d.ts +0 -12
- data/node_modules/@types/node/stream/promises.d.ts +0 -83
- data/node_modules/@types/node/stream/web.d.ts +0 -606
- data/node_modules/@types/node/stream.d.ts +0 -1726
- data/node_modules/@types/node/string_decoder.d.ts +0 -67
- data/node_modules/@types/node/test.d.ts +0 -2098
- data/node_modules/@types/node/timers/promises.d.ts +0 -97
- data/node_modules/@types/node/timers.d.ts +0 -240
- data/node_modules/@types/node/tls.d.ts +0 -1220
- data/node_modules/@types/node/trace_events.d.ts +0 -197
- data/node_modules/@types/node/tty.d.ts +0 -208
- data/node_modules/@types/node/url.d.ts +0 -969
- data/node_modules/@types/node/util.d.ts +0 -2301
- data/node_modules/@types/node/v8.d.ts +0 -808
- data/node_modules/@types/node/vm.d.ts +0 -922
- data/node_modules/@types/node/wasi.d.ts +0 -181
- data/node_modules/@types/node/worker_threads.d.ts +0 -712
- data/node_modules/@types/node/zlib.d.ts +0 -539
- data/node_modules/fsevents/LICENSE +0 -22
- data/node_modules/fsevents/README.md +0 -83
- data/node_modules/fsevents/fsevents.d.ts +0 -46
- data/node_modules/fsevents/fsevents.js +0 -82
- data/node_modules/fsevents/fsevents.node +0 -0
- data/node_modules/fsevents/package.json +0 -62
- data/node_modules/playwright/.eslintrc.js +0 -6
- data/node_modules/playwright/LICENSE +0 -202
- data/node_modules/playwright/NOTICE +0 -5
- data/node_modules/playwright/README.md +0 -169
- data/node_modules/playwright/ThirdPartyNotices.txt +0 -4356
- data/node_modules/playwright/cli.js +0 -19
- data/node_modules/playwright/index.d.ts +0 -17
- data/node_modules/playwright/index.js +0 -17
- data/node_modules/playwright/index.mjs +0 -18
- data/node_modules/playwright/jsx-runtime.js +0 -41
- data/node_modules/playwright/jsx-runtime.mjs +0 -21
- data/node_modules/playwright/lib/common/config.js +0 -256
- data/node_modules/playwright/lib/common/configLoader.js +0 -321
- data/node_modules/playwright/lib/common/esmLoaderHost.js +0 -93
- data/node_modules/playwright/lib/common/expectBundle.js +0 -27
- data/node_modules/playwright/lib/common/expectBundleImpl.js +0 -389
- data/node_modules/playwright/lib/common/fixtures.js +0 -323
- data/node_modules/playwright/lib/common/globals.js +0 -48
- data/node_modules/playwright/lib/common/ipc.js +0 -48
- data/node_modules/playwright/lib/common/poolBuilder.js +0 -79
- data/node_modules/playwright/lib/common/process.js +0 -140
- data/node_modules/playwright/lib/common/suiteUtils.js +0 -133
- data/node_modules/playwright/lib/common/test.js +0 -311
- data/node_modules/playwright/lib/common/testLoader.js +0 -102
- data/node_modules/playwright/lib/common/testType.js +0 -284
- data/node_modules/playwright/lib/fsWatcher.js +0 -69
- data/node_modules/playwright/lib/index.js +0 -888
- data/node_modules/playwright/lib/internalsForTest.js +0 -28
- data/node_modules/playwright/lib/isomorphic/events.js +0 -72
- data/node_modules/playwright/lib/isomorphic/folders.js +0 -25
- data/node_modules/playwright/lib/isomorphic/stringInternPool.js +0 -58
- data/node_modules/playwright/lib/isomorphic/teleReceiver.js +0 -504
- data/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +0 -149
- data/node_modules/playwright/lib/isomorphic/testServerConnection.js +0 -210
- data/node_modules/playwright/lib/isomorphic/testServerInterface.js +0 -5
- data/node_modules/playwright/lib/isomorphic/testTree.js +0 -272
- data/node_modules/playwright/lib/loader/loaderMain.js +0 -58
- data/node_modules/playwright/lib/matchers/expect.js +0 -297
- data/node_modules/playwright/lib/matchers/matcherHint.js +0 -50
- data/node_modules/playwright/lib/matchers/matchers.js +0 -449
- data/node_modules/playwright/lib/matchers/toBeTruthy.js +0 -55
- data/node_modules/playwright/lib/matchers/toEqual.js +0 -57
- data/node_modules/playwright/lib/matchers/toMatchSnapshot.js +0 -383
- data/node_modules/playwright/lib/matchers/toMatchText.js +0 -76
- data/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +0 -78
- data/node_modules/playwright/lib/plugins/index.js +0 -19
- data/node_modules/playwright/lib/plugins/webServerPlugin.js +0 -187
- data/node_modules/playwright/lib/program.js +0 -346
- data/node_modules/playwright/lib/reporters/base.js +0 -553
- data/node_modules/playwright/lib/reporters/blob.js +0 -133
- data/node_modules/playwright/lib/reporters/dot.js +0 -82
- data/node_modules/playwright/lib/reporters/empty.js +0 -42
- data/node_modules/playwright/lib/reporters/github.js +0 -115
- data/node_modules/playwright/lib/reporters/html.js +0 -623
- data/node_modules/playwright/lib/reporters/internalReporter.js +0 -123
- data/node_modules/playwright/lib/reporters/json.js +0 -243
- data/node_modules/playwright/lib/reporters/junit.js +0 -233
- data/node_modules/playwright/lib/reporters/line.js +0 -108
- data/node_modules/playwright/lib/reporters/list.js +0 -222
- data/node_modules/playwright/lib/reporters/markdown.js +0 -76
- data/node_modules/playwright/lib/reporters/merge.js +0 -477
- data/node_modules/playwright/lib/reporters/multiplexer.js +0 -90
- data/node_modules/playwright/lib/reporters/reporterV2.js +0 -118
- data/node_modules/playwright/lib/reporters/teleEmitter.js +0 -268
- data/node_modules/playwright/lib/reporters/versions/blobV1.js +0 -5
- data/node_modules/playwright/lib/runner/dispatcher.js +0 -532
- data/node_modules/playwright/lib/runner/failureTracker.js +0 -60
- data/node_modules/playwright/lib/runner/loadUtils.js +0 -308
- data/node_modules/playwright/lib/runner/loaderHost.js +0 -85
- data/node_modules/playwright/lib/runner/processHost.js +0 -175
- data/node_modules/playwright/lib/runner/projectUtils.js +0 -203
- data/node_modules/playwright/lib/runner/reporters.js +0 -151
- data/node_modules/playwright/lib/runner/runner.js +0 -179
- data/node_modules/playwright/lib/runner/sigIntWatcher.js +0 -100
- data/node_modules/playwright/lib/runner/taskRunner.js +0 -147
- data/node_modules/playwright/lib/runner/tasks.js +0 -407
- data/node_modules/playwright/lib/runner/testGroups.js +0 -136
- data/node_modules/playwright/lib/runner/testServer.js +0 -605
- data/node_modules/playwright/lib/runner/uiModeReporter.js +0 -31
- data/node_modules/playwright/lib/runner/vcs.js +0 -55
- data/node_modules/playwright/lib/runner/watchMode.js +0 -398
- data/node_modules/playwright/lib/runner/workerHost.js +0 -85
- data/node_modules/playwright/lib/third_party/tsconfig-loader.js +0 -134
- data/node_modules/playwright/lib/transform/babelBundle.js +0 -28
- data/node_modules/playwright/lib/transform/babelBundleImpl.js +0 -2032
- data/node_modules/playwright/lib/transform/compilationCache.js +0 -254
- data/node_modules/playwright/lib/transform/esmLoader.js +0 -117
- data/node_modules/playwright/lib/transform/esmUtils.js +0 -32
- data/node_modules/playwright/lib/transform/portTransport.js +0 -81
- data/node_modules/playwright/lib/transform/transform.js +0 -267
- data/node_modules/playwright/lib/util.js +0 -356
- data/node_modules/playwright/lib/utilsBundle.js +0 -28
- data/node_modules/playwright/lib/utilsBundleImpl.js +0 -102
- data/node_modules/playwright/lib/worker/fixtureRunner.js +0 -279
- data/node_modules/playwright/lib/worker/testInfo.js +0 -397
- data/node_modules/playwright/lib/worker/testTracing.js +0 -314
- data/node_modules/playwright/lib/worker/timeoutManager.js +0 -153
- data/node_modules/playwright/lib/worker/workerMain.js +0 -637
- data/node_modules/playwright/node_modules/.bin/playwright-core +0 -1
- data/node_modules/playwright/package.json +0 -66
- data/node_modules/playwright/test.d.ts +0 -18
- data/node_modules/playwright/test.js +0 -24
- data/node_modules/playwright/test.mjs +0 -33
- data/node_modules/playwright/types/test.d.ts +0 -8444
- data/node_modules/playwright/types/testReporter.d.ts +0 -749
- data/node_modules/playwright-core/LICENSE +0 -202
- data/node_modules/playwright-core/NOTICE +0 -5
- data/node_modules/playwright-core/README.md +0 -3
- data/node_modules/playwright-core/ThirdPartyNotices.txt +0 -1548
- data/node_modules/playwright-core/bin/PrintDeps.exe +0 -0
- data/node_modules/playwright-core/bin/README.md +0 -2
- data/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
- data/node_modules/playwright-core/browsers.json +0 -53
- data/node_modules/playwright-core/cli.js +0 -18
- data/node_modules/playwright-core/index.d.ts +0 -17
- data/node_modules/playwright-core/index.js +0 -33
- data/node_modules/playwright-core/index.mjs +0 -28
- data/node_modules/playwright-core/lib/androidServerImpl.js +0 -69
- data/node_modules/playwright-core/lib/browserServerImpl.js +0 -92
- data/node_modules/playwright-core/lib/cli/driver.js +0 -95
- data/node_modules/playwright-core/lib/cli/program.js +0 -577
- data/node_modules/playwright-core/lib/cli/programWithTestStub.js +0 -67
- data/node_modules/playwright-core/lib/client/accessibility.js +0 -50
- data/node_modules/playwright-core/lib/client/android.js +0 -473
- data/node_modules/playwright-core/lib/client/api.js +0 -279
- data/node_modules/playwright-core/lib/client/artifact.js +0 -79
- data/node_modules/playwright-core/lib/client/browser.js +0 -145
- data/node_modules/playwright-core/lib/client/browserContext.js +0 -541
- data/node_modules/playwright-core/lib/client/browserType.js +0 -241
- data/node_modules/playwright-core/lib/client/cdpSession.js +0 -53
- data/node_modules/playwright-core/lib/client/channelOwner.js +0 -231
- data/node_modules/playwright-core/lib/client/clientHelper.js +0 -57
- data/node_modules/playwright-core/lib/client/clientInstrumentation.js +0 -50
- data/node_modules/playwright-core/lib/client/clock.js +0 -68
- data/node_modules/playwright-core/lib/client/connection.js +0 -330
- data/node_modules/playwright-core/lib/client/consoleMessage.js +0 -55
- data/node_modules/playwright-core/lib/client/coverage.js +0 -41
- data/node_modules/playwright-core/lib/client/dialog.js +0 -57
- data/node_modules/playwright-core/lib/client/download.js +0 -62
- data/node_modules/playwright-core/lib/client/electron.js +0 -135
- data/node_modules/playwright-core/lib/client/elementHandle.js +0 -321
- data/node_modules/playwright-core/lib/client/errors.js +0 -77
- data/node_modules/playwright-core/lib/client/eventEmitter.js +0 -314
- data/node_modules/playwright-core/lib/client/events.js +0 -94
- data/node_modules/playwright-core/lib/client/fetch.js +0 -396
- data/node_modules/playwright-core/lib/client/fileChooser.js +0 -45
- data/node_modules/playwright-core/lib/client/frame.js +0 -504
- data/node_modules/playwright-core/lib/client/harRouter.js +0 -99
- data/node_modules/playwright-core/lib/client/input.js +0 -111
- data/node_modules/playwright-core/lib/client/jsHandle.js +0 -129
- data/node_modules/playwright-core/lib/client/jsonPipe.js +0 -35
- data/node_modules/playwright-core/lib/client/localUtils.js +0 -35
- data/node_modules/playwright-core/lib/client/locator.js +0 -441
- data/node_modules/playwright-core/lib/client/network.js +0 -604
- data/node_modules/playwright-core/lib/client/page.js +0 -725
- data/node_modules/playwright-core/lib/client/playwright.js +0 -77
- data/node_modules/playwright-core/lib/client/selectors.js +0 -67
- data/node_modules/playwright-core/lib/client/stream.js +0 -54
- data/node_modules/playwright-core/lib/client/tracing.js +0 -138
- data/node_modules/playwright-core/lib/client/types.js +0 -24
- data/node_modules/playwright-core/lib/client/video.js +0 -51
- data/node_modules/playwright-core/lib/client/waiter.js +0 -158
- data/node_modules/playwright-core/lib/client/webError.js +0 -37
- data/node_modules/playwright-core/lib/client/worker.js +0 -71
- data/node_modules/playwright-core/lib/client/writableStream.js +0 -54
- data/node_modules/playwright-core/lib/common/socksProxy.js +0 -569
- data/node_modules/playwright-core/lib/common/timeoutSettings.js +0 -73
- data/node_modules/playwright-core/lib/common/types.js +0 -5
- data/node_modules/playwright-core/lib/generated/clockSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/consoleApiSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/injectedScriptSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/recorderSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/utilityScriptSource.js +0 -7
- data/node_modules/playwright-core/lib/image_tools/colorUtils.js +0 -98
- data/node_modules/playwright-core/lib/image_tools/compare.js +0 -108
- data/node_modules/playwright-core/lib/image_tools/imageChannel.js +0 -70
- data/node_modules/playwright-core/lib/image_tools/stats.js +0 -102
- data/node_modules/playwright-core/lib/inProcessFactory.js +0 -54
- data/node_modules/playwright-core/lib/inprocess.js +0 -20
- data/node_modules/playwright-core/lib/outofprocess.js +0 -67
- data/node_modules/playwright-core/lib/protocol/debug.js +0 -27
- data/node_modules/playwright-core/lib/protocol/serializers.js +0 -173
- data/node_modules/playwright-core/lib/protocol/transport.js +0 -82
- data/node_modules/playwright-core/lib/protocol/validator.js +0 -2694
- data/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +0 -139
- data/node_modules/playwright-core/lib/remote/playwrightConnection.js +0 -274
- data/node_modules/playwright-core/lib/remote/playwrightServer.js +0 -110
- data/node_modules/playwright-core/lib/server/accessibility.js +0 -62
- data/node_modules/playwright-core/lib/server/android/android.js +0 -441
- data/node_modules/playwright-core/lib/server/android/backendAdb.js +0 -172
- data/node_modules/playwright-core/lib/server/artifact.js +0 -104
- data/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +0 -296
- data/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +0 -206
- data/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +0 -162
- data/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +0 -110
- data/node_modules/playwright-core/lib/server/bidi/bidiInput.js +0 -174
- data/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +0 -304
- data/node_modules/playwright-core/lib/server/bidi/bidiPage.js +0 -456
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +0 -238
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +0 -139
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +0 -144
- data/node_modules/playwright-core/lib/server/browser.js +0 -137
- data/node_modules/playwright-core/lib/server/browserContext.js +0 -684
- data/node_modules/playwright-core/lib/server/browserType.js +0 -307
- data/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- data/node_modules/playwright-core/lib/server/chromium/chromium.js +0 -362
- data/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +0 -44
- data/node_modules/playwright-core/lib/server/chromium/crAccessibility.js +0 -237
- data/node_modules/playwright-core/lib/server/chromium/crBrowser.js +0 -515
- data/node_modules/playwright-core/lib/server/chromium/crConnection.js +0 -228
- data/node_modules/playwright-core/lib/server/chromium/crCoverage.js +0 -246
- data/node_modules/playwright-core/lib/server/chromium/crDevTools.js +0 -104
- data/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +0 -143
- data/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +0 -156
- data/node_modules/playwright-core/lib/server/chromium/crInput.js +0 -171
- data/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +0 -767
- data/node_modules/playwright-core/lib/server/chromium/crPage.js +0 -1128
- data/node_modules/playwright-core/lib/server/chromium/crPdf.js +0 -153
- data/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +0 -133
- data/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +0 -112
- data/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +0 -145
- data/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +0 -155
- data/node_modules/playwright-core/lib/server/clock.js +0 -125
- data/node_modules/playwright-core/lib/server/codegen/csharp.js +0 -299
- data/node_modules/playwright-core/lib/server/codegen/java.js +0 -235
- data/node_modules/playwright-core/lib/server/codegen/javascript.js +0 -223
- data/node_modules/playwright-core/lib/server/codegen/jsonl.js +0 -47
- data/node_modules/playwright-core/lib/server/codegen/language.js +0 -76
- data/node_modules/playwright-core/lib/server/codegen/languages.js +0 -30
- data/node_modules/playwright-core/lib/server/codegen/python.js +0 -265
- data/node_modules/playwright-core/lib/server/codegen/types.js +0 -5
- data/node_modules/playwright-core/lib/server/console.js +0 -57
- data/node_modules/playwright-core/lib/server/cookieStore.js +0 -112
- data/node_modules/playwright-core/lib/server/debugController.js +0 -234
- data/node_modules/playwright-core/lib/server/debugger.js +0 -132
- data/node_modules/playwright-core/lib/server/deviceDescriptors.js +0 -26
- data/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +0 -1669
- data/node_modules/playwright-core/lib/server/dialog.js +0 -70
- data/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +0 -193
- data/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +0 -118
- data/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +0 -351
- data/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +0 -170
- data/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
- data/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
- data/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +0 -103
- data/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +0 -44
- data/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +0 -395
- data/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +0 -93
- data/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
- data/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +0 -286
- data/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +0 -102
- data/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
- data/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
- data/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +0 -221
- data/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +0 -358
- data/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +0 -106
- data/node_modules/playwright-core/lib/server/dispatchers/selectorsDispatcher.js +0 -36
- data/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +0 -62
- data/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +0 -54
- data/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
- data/node_modules/playwright-core/lib/server/dom.js +0 -845
- data/node_modules/playwright-core/lib/server/download.js +0 -53
- data/node_modules/playwright-core/lib/server/electron/electron.js +0 -296
- data/node_modules/playwright-core/lib/server/electron/loader.js +0 -57
- data/node_modules/playwright-core/lib/server/errors.js +0 -68
- data/node_modules/playwright-core/lib/server/fetch.js +0 -660
- data/node_modules/playwright-core/lib/server/fileChooser.js +0 -42
- data/node_modules/playwright-core/lib/server/fileUploadUtils.js +0 -75
- data/node_modules/playwright-core/lib/server/firefox/ffAccessibility.js +0 -216
- data/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +0 -458
- data/node_modules/playwright-core/lib/server/firefox/ffConnection.js +0 -168
- data/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +0 -138
- data/node_modules/playwright-core/lib/server/firefox/ffInput.js +0 -150
- data/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +0 -233
- data/node_modules/playwright-core/lib/server/firefox/ffPage.js +0 -556
- data/node_modules/playwright-core/lib/server/firefox/firefox.js +0 -110
- data/node_modules/playwright-core/lib/server/formData.js +0 -75
- data/node_modules/playwright-core/lib/server/frameSelectors.js +0 -171
- data/node_modules/playwright-core/lib/server/frames.js +0 -1654
- data/node_modules/playwright-core/lib/server/har/harRecorder.js +0 -139
- data/node_modules/playwright-core/lib/server/har/harTracer.js +0 -531
- data/node_modules/playwright-core/lib/server/helper.js +0 -103
- data/node_modules/playwright-core/lib/server/index.js +0 -114
- data/node_modules/playwright-core/lib/server/input.js +0 -311
- data/node_modules/playwright-core/lib/server/instrumentation.js +0 -70
- data/node_modules/playwright-core/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
- data/node_modules/playwright-core/lib/server/javascript.js +0 -306
- data/node_modules/playwright-core/lib/server/launchApp.js +0 -91
- data/node_modules/playwright-core/lib/server/macEditingCommands.js +0 -139
- data/node_modules/playwright-core/lib/server/network.js +0 -617
- data/node_modules/playwright-core/lib/server/page.js +0 -825
- data/node_modules/playwright-core/lib/server/pipeTransport.js +0 -85
- data/node_modules/playwright-core/lib/server/playwright.js +0 -85
- data/node_modules/playwright-core/lib/server/progress.js +0 -102
- data/node_modules/playwright-core/lib/server/protocolError.js +0 -49
- data/node_modules/playwright-core/lib/server/recorder/contextRecorder.js +0 -316
- data/node_modules/playwright-core/lib/server/recorder/recorderActions.js +0 -5
- data/node_modules/playwright-core/lib/server/recorder/recorderApp.js +0 -190
- data/node_modules/playwright-core/lib/server/recorder/recorderCollection.js +0 -127
- data/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +0 -177
- data/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +0 -71
- data/node_modules/playwright-core/lib/server/recorder/throttledFile.js +0 -46
- data/node_modules/playwright-core/lib/server/recorder.js +0 -324
- data/node_modules/playwright-core/lib/server/registry/browserFetcher.js +0 -168
- data/node_modules/playwright-core/lib/server/registry/dependencies.js +0 -322
- data/node_modules/playwright-core/lib/server/registry/index.js +0 -924
- data/node_modules/playwright-core/lib/server/registry/nativeDeps.js +0 -490
- data/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +0 -138
- data/node_modules/playwright-core/lib/server/screenshotter.js +0 -348
- data/node_modules/playwright-core/lib/server/selectors.js +0 -73
- data/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +0 -328
- data/node_modules/playwright-core/lib/server/socksInterceptor.js +0 -100
- data/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +0 -171
- data/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +0 -493
- data/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +0 -486
- data/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +0 -93
- data/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +0 -216
- data/node_modules/playwright-core/lib/server/transport.js +0 -191
- data/node_modules/playwright-core/lib/server/types.js +0 -24
- data/node_modules/playwright-core/lib/server/usKeyboardLayout.js +0 -555
- data/node_modules/playwright-core/lib/server/webkit/webkit.js +0 -87
- data/node_modules/playwright-core/lib/server/webkit/wkAccessibility.js +0 -194
- data/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +0 -328
- data/node_modules/playwright-core/lib/server/webkit/wkConnection.js +0 -173
- data/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +0 -146
- data/node_modules/playwright-core/lib/server/webkit/wkInput.js +0 -169
- data/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +0 -162
- data/node_modules/playwright-core/lib/server/webkit/wkPage.js +0 -1216
- data/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +0 -94
- data/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +0 -104
- data/node_modules/playwright-core/lib/third_party/diff_match_patch.js +0 -2222
- data/node_modules/playwright-core/lib/third_party/pixelmatch.js +0 -255
- data/node_modules/playwright-core/lib/utils/ascii.js +0 -31
- data/node_modules/playwright-core/lib/utils/comparators.js +0 -171
- data/node_modules/playwright-core/lib/utils/crypto.js +0 -174
- data/node_modules/playwright-core/lib/utils/debug.js +0 -46
- data/node_modules/playwright-core/lib/utils/debugLogger.js +0 -91
- data/node_modules/playwright-core/lib/utils/env.js +0 -49
- data/node_modules/playwright-core/lib/utils/eventsHelper.js +0 -38
- data/node_modules/playwright-core/lib/utils/expectUtils.js +0 -33
- data/node_modules/playwright-core/lib/utils/fileUtils.js +0 -205
- data/node_modules/playwright-core/lib/utils/happy-eyeballs.js +0 -181
- data/node_modules/playwright-core/lib/utils/headers.js +0 -52
- data/node_modules/playwright-core/lib/utils/hostPlatform.js +0 -133
- data/node_modules/playwright-core/lib/utils/httpServer.js +0 -236
- data/node_modules/playwright-core/lib/utils/index.js +0 -368
- data/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +0 -250
- data/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +0 -979
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +0 -651
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +0 -179
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +0 -62
- data/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +0 -29
- data/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +0 -397
- data/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +0 -139
- data/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +0 -39
- data/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +0 -120
- data/node_modules/playwright-core/lib/utils/linuxUtils.js +0 -78
- data/node_modules/playwright-core/lib/utils/manualPromise.js +0 -109
- data/node_modules/playwright-core/lib/utils/multimap.js +0 -75
- data/node_modules/playwright-core/lib/utils/network.js +0 -160
- data/node_modules/playwright-core/lib/utils/processLauncher.js +0 -248
- data/node_modules/playwright-core/lib/utils/profiler.js +0 -53
- data/node_modules/playwright-core/lib/utils/rtti.js +0 -44
- data/node_modules/playwright-core/lib/utils/semaphore.js +0 -51
- data/node_modules/playwright-core/lib/utils/spawnAsync.js +0 -45
- data/node_modules/playwright-core/lib/utils/stackTrace.js +0 -121
- data/node_modules/playwright-core/lib/utils/task.js +0 -58
- data/node_modules/playwright-core/lib/utils/time.js +0 -37
- data/node_modules/playwright-core/lib/utils/timeoutRunner.js +0 -66
- data/node_modules/playwright-core/lib/utils/traceUtils.js +0 -44
- data/node_modules/playwright-core/lib/utils/userAgent.js +0 -105
- data/node_modules/playwright-core/lib/utils/wsServer.js +0 -127
- data/node_modules/playwright-core/lib/utils/zipFile.js +0 -75
- data/node_modules/playwright-core/lib/utils/zones.js +0 -62
- data/node_modules/playwright-core/lib/utilsBundle.js +0 -82
- data/node_modules/playwright-core/lib/utilsBundleImpl/index.js +0 -53
- data/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +0 -1066
- data/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -66
- data/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-aW6Vz3gf.js +0 -24
- data/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
- data/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- data/node_modules/playwright-core/lib/vite/recorder/assets/index-B-MT5gKo.css +0 -1
- data/node_modules/playwright-core/lib/vite/recorder/assets/index-DCpXOVIh.js +0 -47
- data/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
- data/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-eFKCUIu2.js +0 -24
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/workbench-D0cirtfA.js +0 -72
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BeNbaIVa.js +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.ez37Vkbh.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.BkuvsLJp.js +0 -2
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.html +0 -16
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/index.C968kAiC.js +0 -2
- data/node_modules/playwright-core/lib/vite/traceViewer/index.CrbWWHbf.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -27
- data/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -21
- data/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -3
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BkFnr4V0.js +0 -10
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.D3cNFP6u.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
- data/node_modules/playwright-core/lib/vite/traceViewer/workbench.DjbIuxix.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DSXBckUd.css +0 -32
- data/node_modules/playwright-core/lib/zipBundle.js +0 -25
- data/node_modules/playwright-core/lib/zipBundleImpl.js +0 -5
- data/node_modules/playwright-core/package.json +0 -44
- data/node_modules/playwright-core/types/protocol.d.ts +0 -21500
- data/node_modules/playwright-core/types/structs.d.ts +0 -45
- data/node_modules/playwright-core/types/types.d.ts +0 -21431
- data/node_modules/undici-types/LICENSE +0 -21
- data/node_modules/undici-types/README.md +0 -6
- data/node_modules/undici-types/agent.d.ts +0 -31
- data/node_modules/undici-types/api.d.ts +0 -43
- data/node_modules/undici-types/balanced-pool.d.ts +0 -29
- data/node_modules/undici-types/cache.d.ts +0 -36
- data/node_modules/undici-types/client.d.ts +0 -108
- data/node_modules/undici-types/connector.d.ts +0 -34
- data/node_modules/undici-types/content-type.d.ts +0 -21
- data/node_modules/undici-types/cookies.d.ts +0 -28
- data/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- data/node_modules/undici-types/dispatcher.d.ts +0 -255
- data/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- data/node_modules/undici-types/errors.d.ts +0 -149
- data/node_modules/undici-types/eventsource.d.ts +0 -63
- data/node_modules/undici-types/fetch.d.ts +0 -209
- data/node_modules/undici-types/file.d.ts +0 -39
- data/node_modules/undici-types/filereader.d.ts +0 -54
- data/node_modules/undici-types/formdata.d.ts +0 -108
- data/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- data/node_modules/undici-types/global-origin.d.ts +0 -7
- data/node_modules/undici-types/handlers.d.ts +0 -15
- data/node_modules/undici-types/header.d.ts +0 -4
- data/node_modules/undici-types/index.d.ts +0 -71
- data/node_modules/undici-types/interceptors.d.ts +0 -15
- data/node_modules/undici-types/mock-agent.d.ts +0 -50
- data/node_modules/undici-types/mock-client.d.ts +0 -25
- data/node_modules/undici-types/mock-errors.d.ts +0 -12
- data/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- data/node_modules/undici-types/mock-pool.d.ts +0 -25
- data/node_modules/undici-types/package.json +0 -55
- data/node_modules/undici-types/patch.d.ts +0 -71
- data/node_modules/undici-types/pool-stats.d.ts +0 -19
- data/node_modules/undici-types/pool.d.ts +0 -39
- data/node_modules/undici-types/proxy-agent.d.ts +0 -28
- data/node_modules/undici-types/readable.d.ts +0 -60
- data/node_modules/undici-types/retry-agent.d.ts +0 -8
- data/node_modules/undici-types/retry-handler.d.ts +0 -116
- data/node_modules/undici-types/util.d.ts +0 -18
- data/node_modules/undici-types/webidl.d.ts +0 -222
- data/node_modules/undici-types/websocket.d.ts +0 -152
- data/yarn.lock +0 -41
@@ -1,556 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.UTILITY_WORLD_NAME = exports.FFPage = void 0;
|
7
|
-
var dialog = _interopRequireWildcard(require("../dialog"));
|
8
|
-
var dom = _interopRequireWildcard(require("../dom"));
|
9
|
-
var _eventsHelper = require("../../utils/eventsHelper");
|
10
|
-
var _page = require("../page");
|
11
|
-
var _ffAccessibility = require("./ffAccessibility");
|
12
|
-
var _ffConnection = require("./ffConnection");
|
13
|
-
var _ffExecutionContext = require("./ffExecutionContext");
|
14
|
-
var _ffInput = require("./ffInput");
|
15
|
-
var _ffNetworkManager = require("./ffNetworkManager");
|
16
|
-
var _stackTrace = require("../../utils/stackTrace");
|
17
|
-
var _debugLogger = require("../../utils/debugLogger");
|
18
|
-
var _manualPromise = require("../../utils/manualPromise");
|
19
|
-
var _browserContext = require("../browserContext");
|
20
|
-
var _errors = require("../errors");
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
23
|
-
/**
|
24
|
-
* Copyright 2019 Google Inc. All rights reserved.
|
25
|
-
* Modifications copyright (c) Microsoft Corporation.
|
26
|
-
*
|
27
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
28
|
-
* you may not use this file except in compliance with the License.
|
29
|
-
* You may obtain a copy of the License at
|
30
|
-
*
|
31
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
32
|
-
*
|
33
|
-
* Unless required by applicable law or agreed to in writing, software
|
34
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
35
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
36
|
-
* See the License for the specific language governing permissions and
|
37
|
-
* limitations under the License.
|
38
|
-
*/
|
39
|
-
|
40
|
-
const UTILITY_WORLD_NAME = exports.UTILITY_WORLD_NAME = '__playwright_utility_world__';
|
41
|
-
class FFPage {
|
42
|
-
constructor(session, browserContext, opener) {
|
43
|
-
this.cspErrorsAsynchronousForInlineScripts = true;
|
44
|
-
this.rawMouse = void 0;
|
45
|
-
this.rawKeyboard = void 0;
|
46
|
-
this.rawTouchscreen = void 0;
|
47
|
-
this._session = void 0;
|
48
|
-
this._page = void 0;
|
49
|
-
this._networkManager = void 0;
|
50
|
-
this._browserContext = void 0;
|
51
|
-
this._pagePromise = new _manualPromise.ManualPromise();
|
52
|
-
this._initializedPage = null;
|
53
|
-
this._initializationFailed = false;
|
54
|
-
this._opener = void 0;
|
55
|
-
this._contextIdToContext = void 0;
|
56
|
-
this._eventListeners = void 0;
|
57
|
-
this._workers = new Map();
|
58
|
-
this._screencastId = void 0;
|
59
|
-
this._initScripts = [];
|
60
|
-
this._session = session;
|
61
|
-
this._opener = opener;
|
62
|
-
this.rawKeyboard = new _ffInput.RawKeyboardImpl(session);
|
63
|
-
this.rawMouse = new _ffInput.RawMouseImpl(session);
|
64
|
-
this.rawTouchscreen = new _ffInput.RawTouchscreenImpl(session);
|
65
|
-
this._contextIdToContext = new Map();
|
66
|
-
this._browserContext = browserContext;
|
67
|
-
this._page = new _page.Page(this, browserContext);
|
68
|
-
this.rawMouse.setPage(this._page);
|
69
|
-
this._networkManager = new _ffNetworkManager.FFNetworkManager(session, this._page);
|
70
|
-
this._page.on(_page.Page.Events.FrameDetached, frame => this._removeContextsForFrame(frame));
|
71
|
-
// TODO: remove Page.willOpenNewWindowAsynchronously from the protocol.
|
72
|
-
this._eventListeners = [_eventsHelper.eventsHelper.addEventListener(this._session, 'Page.eventFired', this._onEventFired.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.frameAttached', this._onFrameAttached.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.frameDetached', this._onFrameDetached.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.navigationAborted', this._onNavigationAborted.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.navigationCommitted', this._onNavigationCommitted.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.navigationStarted', this._onNavigationStarted.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.sameDocumentNavigation', this._onSameDocumentNavigation.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Runtime.executionContextCreated', this._onExecutionContextCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Runtime.executionContextDestroyed', this._onExecutionContextDestroyed.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Runtime.executionContextsCleared', this._onExecutionContextsCleared.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.linkClicked', event => this._onLinkClicked(event.phase)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.uncaughtError', this._onUncaughtError.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Runtime.console', this._onConsole.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.dialogOpened', this._onDialogOpened.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.bindingCalled', this._onBindingCalled.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.fileChooserOpened', this._onFileChooserOpened.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.workerCreated', this._onWorkerCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.workerDestroyed', this._onWorkerDestroyed.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.dispatchMessageFromWorker', this._onDispatchMessageFromWorker.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.crashed', this._onCrashed.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.videoRecordingStarted', this._onVideoRecordingStarted.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.webSocketCreated', this._onWebSocketCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.webSocketClosed', this._onWebSocketClosed.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.webSocketFrameReceived', this._onWebSocketFrameReceived.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.webSocketFrameSent', this._onWebSocketFrameSent.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._session, 'Page.screencastFrame', this._onScreencastFrame.bind(this))];
|
73
|
-
this._session.once('Page.ready', async () => {
|
74
|
-
await this._page.initOpener(this._opener);
|
75
|
-
if (this._initializationFailed) return;
|
76
|
-
// Note: it is important to call |reportAsNew| before resolving pageOrError promise,
|
77
|
-
// so that anyone who awaits pageOrError got a ready and reported page.
|
78
|
-
this._initializedPage = this._page;
|
79
|
-
this._page.reportAsNew();
|
80
|
-
this._pagePromise.resolve(this._page);
|
81
|
-
});
|
82
|
-
// Ideally, we somehow ensure that utility world is created before Page.ready arrives, but currently it is racy.
|
83
|
-
// Therefore, we can end up with an initialized page without utility world, although very unlikely.
|
84
|
-
this.addInitScript(new _page.InitScript('', true), UTILITY_WORLD_NAME).catch(e => this._markAsError(e));
|
85
|
-
}
|
86
|
-
potentiallyUninitializedPage() {
|
87
|
-
return this._page;
|
88
|
-
}
|
89
|
-
async _markAsError(error) {
|
90
|
-
// Same error may be report twice: channer disconnected and session.send fails.
|
91
|
-
if (this._initializationFailed) return;
|
92
|
-
this._initializationFailed = true;
|
93
|
-
if (!this._initializedPage) {
|
94
|
-
await this._page.initOpener(this._opener);
|
95
|
-
this._page.reportAsNew(error);
|
96
|
-
this._pagePromise.resolve(error);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
async pageOrError() {
|
100
|
-
return this._pagePromise;
|
101
|
-
}
|
102
|
-
_onWebSocketCreated(event) {
|
103
|
-
this._page._frameManager.onWebSocketCreated(webSocketId(event.frameId, event.wsid), event.requestURL);
|
104
|
-
this._page._frameManager.onWebSocketRequest(webSocketId(event.frameId, event.wsid));
|
105
|
-
}
|
106
|
-
_onWebSocketClosed(event) {
|
107
|
-
if (event.error) this._page._frameManager.webSocketError(webSocketId(event.frameId, event.wsid), event.error);
|
108
|
-
this._page._frameManager.webSocketClosed(webSocketId(event.frameId, event.wsid));
|
109
|
-
}
|
110
|
-
_onWebSocketFrameReceived(event) {
|
111
|
-
this._page._frameManager.webSocketFrameReceived(webSocketId(event.frameId, event.wsid), event.opcode, event.data);
|
112
|
-
}
|
113
|
-
_onWebSocketFrameSent(event) {
|
114
|
-
this._page._frameManager.onWebSocketFrameSent(webSocketId(event.frameId, event.wsid), event.opcode, event.data);
|
115
|
-
}
|
116
|
-
_onExecutionContextCreated(payload) {
|
117
|
-
const {
|
118
|
-
executionContextId,
|
119
|
-
auxData
|
120
|
-
} = payload;
|
121
|
-
const frame = this._page._frameManager.frame(auxData.frameId);
|
122
|
-
if (!frame) return;
|
123
|
-
const delegate = new _ffExecutionContext.FFExecutionContext(this._session, executionContextId);
|
124
|
-
let worldName;
|
125
|
-
if (auxData.name === UTILITY_WORLD_NAME) worldName = 'utility';else if (!auxData.name) worldName = 'main';else return;
|
126
|
-
const context = new dom.FrameExecutionContext(delegate, frame, worldName);
|
127
|
-
context[contextDelegateSymbol] = delegate;
|
128
|
-
frame._contextCreated(worldName, context);
|
129
|
-
this._contextIdToContext.set(executionContextId, context);
|
130
|
-
}
|
131
|
-
_onExecutionContextDestroyed(payload) {
|
132
|
-
const {
|
133
|
-
executionContextId
|
134
|
-
} = payload;
|
135
|
-
const context = this._contextIdToContext.get(executionContextId);
|
136
|
-
if (!context) return;
|
137
|
-
this._contextIdToContext.delete(executionContextId);
|
138
|
-
context.frame._contextDestroyed(context);
|
139
|
-
}
|
140
|
-
_onExecutionContextsCleared() {
|
141
|
-
for (const executionContextId of Array.from(this._contextIdToContext.keys())) this._onExecutionContextDestroyed({
|
142
|
-
executionContextId
|
143
|
-
});
|
144
|
-
}
|
145
|
-
_removeContextsForFrame(frame) {
|
146
|
-
for (const [contextId, context] of this._contextIdToContext) {
|
147
|
-
if (context.frame === frame) this._contextIdToContext.delete(contextId);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
_onLinkClicked(phase) {
|
151
|
-
if (phase === 'before') this._page._frameManager.frameWillPotentiallyRequestNavigation();else this._page._frameManager.frameDidPotentiallyRequestNavigation();
|
152
|
-
}
|
153
|
-
_onNavigationStarted(params) {
|
154
|
-
this._page._frameManager.frameRequestedNavigation(params.frameId, params.navigationId);
|
155
|
-
}
|
156
|
-
_onNavigationAborted(params) {
|
157
|
-
this._page._frameManager.frameAbortedNavigation(params.frameId, params.errorText, params.navigationId);
|
158
|
-
}
|
159
|
-
_onNavigationCommitted(params) {
|
160
|
-
for (const [workerId, worker] of this._workers) {
|
161
|
-
if (worker.frameId === params.frameId) this._onWorkerDestroyed({
|
162
|
-
workerId
|
163
|
-
});
|
164
|
-
}
|
165
|
-
this._page._frameManager.frameCommittedNewDocumentNavigation(params.frameId, params.url, params.name || '', params.navigationId || '', false);
|
166
|
-
}
|
167
|
-
_onSameDocumentNavigation(params) {
|
168
|
-
this._page._frameManager.frameCommittedSameDocumentNavigation(params.frameId, params.url);
|
169
|
-
}
|
170
|
-
_onFrameAttached(params) {
|
171
|
-
this._page._frameManager.frameAttached(params.frameId, params.parentFrameId);
|
172
|
-
}
|
173
|
-
_onFrameDetached(params) {
|
174
|
-
this._page._frameManager.frameDetached(params.frameId);
|
175
|
-
}
|
176
|
-
_onEventFired(payload) {
|
177
|
-
const {
|
178
|
-
frameId,
|
179
|
-
name
|
180
|
-
} = payload;
|
181
|
-
if (name === 'load') this._page._frameManager.frameLifecycleEvent(frameId, 'load');
|
182
|
-
if (name === 'DOMContentLoaded') this._page._frameManager.frameLifecycleEvent(frameId, 'domcontentloaded');
|
183
|
-
}
|
184
|
-
_onUncaughtError(params) {
|
185
|
-
const {
|
186
|
-
name,
|
187
|
-
message
|
188
|
-
} = (0, _stackTrace.splitErrorMessage)(params.message);
|
189
|
-
const error = new Error(message);
|
190
|
-
error.stack = params.message + '\n' + params.stack.split('\n').filter(Boolean).map(a => a.replace(/([^@]*)@(.*)/, ' at $1 ($2)')).join('\n');
|
191
|
-
error.name = name;
|
192
|
-
this._page.emitOnContextOnceInitialized(_browserContext.BrowserContext.Events.PageError, error, this._page);
|
193
|
-
}
|
194
|
-
_onConsole(payload) {
|
195
|
-
const {
|
196
|
-
type,
|
197
|
-
args,
|
198
|
-
executionContextId,
|
199
|
-
location
|
200
|
-
} = payload;
|
201
|
-
const context = this._contextIdToContext.get(executionContextId);
|
202
|
-
if (!context) return;
|
203
|
-
// Juggler reports 'warn' for some internal messages generated by the browser.
|
204
|
-
this._page._addConsoleMessage(type === 'warn' ? 'warning' : type, args.map(arg => context.createHandle(arg)), location);
|
205
|
-
}
|
206
|
-
_onDialogOpened(params) {
|
207
|
-
this._page.emitOnContext(_browserContext.BrowserContext.Events.Dialog, new dialog.Dialog(this._page, params.type, params.message, async (accept, promptText) => {
|
208
|
-
await this._session.sendMayFail('Page.handleDialog', {
|
209
|
-
dialogId: params.dialogId,
|
210
|
-
accept,
|
211
|
-
promptText
|
212
|
-
});
|
213
|
-
}, params.defaultValue));
|
214
|
-
}
|
215
|
-
async _onBindingCalled(event) {
|
216
|
-
const pageOrError = await this.pageOrError();
|
217
|
-
if (!(pageOrError instanceof Error)) {
|
218
|
-
const context = this._contextIdToContext.get(event.executionContextId);
|
219
|
-
if (context) await this._page._onBindingCalled(event.payload, context);
|
220
|
-
}
|
221
|
-
}
|
222
|
-
async _onFileChooserOpened(payload) {
|
223
|
-
const {
|
224
|
-
executionContextId,
|
225
|
-
element
|
226
|
-
} = payload;
|
227
|
-
const context = this._contextIdToContext.get(executionContextId);
|
228
|
-
if (!context) return;
|
229
|
-
const handle = context.createHandle(element).asElement();
|
230
|
-
await this._page._onFileChooserOpened(handle);
|
231
|
-
}
|
232
|
-
async _onWorkerCreated(event) {
|
233
|
-
const workerId = event.workerId;
|
234
|
-
const worker = new _page.Worker(this._page, event.url);
|
235
|
-
const workerSession = new _ffConnection.FFSession(this._session._connection, workerId, message => {
|
236
|
-
this._session.send('Page.sendMessageToWorker', {
|
237
|
-
frameId: event.frameId,
|
238
|
-
workerId: workerId,
|
239
|
-
message: JSON.stringify(message)
|
240
|
-
}).catch(e => {
|
241
|
-
workerSession.dispatchMessage({
|
242
|
-
id: message.id,
|
243
|
-
method: '',
|
244
|
-
params: {},
|
245
|
-
error: {
|
246
|
-
message: e.message,
|
247
|
-
data: undefined
|
248
|
-
}
|
249
|
-
});
|
250
|
-
});
|
251
|
-
});
|
252
|
-
this._workers.set(workerId, {
|
253
|
-
session: workerSession,
|
254
|
-
frameId: event.frameId
|
255
|
-
});
|
256
|
-
this._page._addWorker(workerId, worker);
|
257
|
-
workerSession.once('Runtime.executionContextCreated', event => {
|
258
|
-
worker._createExecutionContext(new _ffExecutionContext.FFExecutionContext(workerSession, event.executionContextId));
|
259
|
-
});
|
260
|
-
workerSession.on('Runtime.console', event => {
|
261
|
-
const {
|
262
|
-
type,
|
263
|
-
args,
|
264
|
-
location
|
265
|
-
} = event;
|
266
|
-
const context = worker._existingExecutionContext;
|
267
|
-
this._page._addConsoleMessage(type, args.map(arg => context.createHandle(arg)), location);
|
268
|
-
});
|
269
|
-
// Note: we receive worker exceptions directly from the page.
|
270
|
-
}
|
271
|
-
_onWorkerDestroyed(event) {
|
272
|
-
const workerId = event.workerId;
|
273
|
-
const worker = this._workers.get(workerId);
|
274
|
-
if (!worker) return;
|
275
|
-
worker.session.dispose();
|
276
|
-
this._workers.delete(workerId);
|
277
|
-
this._page._removeWorker(workerId);
|
278
|
-
}
|
279
|
-
async _onDispatchMessageFromWorker(event) {
|
280
|
-
const worker = this._workers.get(event.workerId);
|
281
|
-
if (!worker) return;
|
282
|
-
worker.session.dispatchMessage(JSON.parse(event.message));
|
283
|
-
}
|
284
|
-
async _onCrashed(event) {
|
285
|
-
this._session.markAsCrashed();
|
286
|
-
this._page._didCrash();
|
287
|
-
}
|
288
|
-
_onVideoRecordingStarted(event) {
|
289
|
-
this._browserContext._browser._videoStarted(this._browserContext, event.screencastId, event.file, this.pageOrError());
|
290
|
-
}
|
291
|
-
didClose() {
|
292
|
-
this._markAsError(new _errors.TargetClosedError());
|
293
|
-
this._session.dispose();
|
294
|
-
_eventsHelper.eventsHelper.removeEventListeners(this._eventListeners);
|
295
|
-
this._networkManager.dispose();
|
296
|
-
this._page._didClose();
|
297
|
-
}
|
298
|
-
async navigateFrame(frame, url, referer) {
|
299
|
-
const response = await this._session.send('Page.navigate', {
|
300
|
-
url,
|
301
|
-
referer,
|
302
|
-
frameId: frame._id
|
303
|
-
});
|
304
|
-
return {
|
305
|
-
newDocumentId: response.navigationId || undefined
|
306
|
-
};
|
307
|
-
}
|
308
|
-
async updateExtraHTTPHeaders() {
|
309
|
-
await this._session.send('Network.setExtraHTTPHeaders', {
|
310
|
-
headers: this._page.extraHTTPHeaders() || []
|
311
|
-
});
|
312
|
-
}
|
313
|
-
async updateEmulatedViewportSize() {
|
314
|
-
const viewportSize = this._page.viewportSize();
|
315
|
-
await this._session.send('Page.setViewportSize', {
|
316
|
-
viewportSize
|
317
|
-
});
|
318
|
-
}
|
319
|
-
async bringToFront() {
|
320
|
-
await this._session.send('Page.bringToFront', {});
|
321
|
-
}
|
322
|
-
async updateEmulateMedia() {
|
323
|
-
const emulatedMedia = this._page.emulatedMedia();
|
324
|
-
const colorScheme = emulatedMedia.colorScheme === 'no-override' ? undefined : emulatedMedia.colorScheme;
|
325
|
-
const reducedMotion = emulatedMedia.reducedMotion === 'no-override' ? undefined : emulatedMedia.reducedMotion;
|
326
|
-
const forcedColors = emulatedMedia.forcedColors === 'no-override' ? undefined : emulatedMedia.forcedColors;
|
327
|
-
await this._session.send('Page.setEmulatedMedia', {
|
328
|
-
// Empty string means reset.
|
329
|
-
type: emulatedMedia.media === 'no-override' ? '' : emulatedMedia.media,
|
330
|
-
colorScheme,
|
331
|
-
reducedMotion,
|
332
|
-
forcedColors
|
333
|
-
});
|
334
|
-
}
|
335
|
-
async updateRequestInterception() {
|
336
|
-
await this._networkManager.setRequestInterception(this._page.needsRequestInterception());
|
337
|
-
}
|
338
|
-
async updateFileChooserInterception() {
|
339
|
-
const enabled = this._page.fileChooserIntercepted();
|
340
|
-
await this._session.send('Page.setInterceptFileChooserDialog', {
|
341
|
-
enabled
|
342
|
-
}).catch(() => {}); // target can be closed.
|
343
|
-
}
|
344
|
-
async reload() {
|
345
|
-
await this._session.send('Page.reload');
|
346
|
-
}
|
347
|
-
async goBack() {
|
348
|
-
const {
|
349
|
-
success
|
350
|
-
} = await this._session.send('Page.goBack', {
|
351
|
-
frameId: this._page.mainFrame()._id
|
352
|
-
});
|
353
|
-
return success;
|
354
|
-
}
|
355
|
-
async goForward() {
|
356
|
-
const {
|
357
|
-
success
|
358
|
-
} = await this._session.send('Page.goForward', {
|
359
|
-
frameId: this._page.mainFrame()._id
|
360
|
-
});
|
361
|
-
return success;
|
362
|
-
}
|
363
|
-
async addInitScript(initScript, worldName) {
|
364
|
-
this._initScripts.push({
|
365
|
-
initScript,
|
366
|
-
worldName
|
367
|
-
});
|
368
|
-
await this._session.send('Page.setInitScripts', {
|
369
|
-
scripts: this._initScripts.map(s => ({
|
370
|
-
script: s.initScript.source,
|
371
|
-
worldName: s.worldName
|
372
|
-
}))
|
373
|
-
});
|
374
|
-
}
|
375
|
-
async removeNonInternalInitScripts() {
|
376
|
-
this._initScripts = this._initScripts.filter(s => s.initScript.internal);
|
377
|
-
await this._session.send('Page.setInitScripts', {
|
378
|
-
scripts: this._initScripts.map(s => ({
|
379
|
-
script: s.initScript.source,
|
380
|
-
worldName: s.worldName
|
381
|
-
}))
|
382
|
-
});
|
383
|
-
}
|
384
|
-
async closePage(runBeforeUnload) {
|
385
|
-
await this._session.send('Page.close', {
|
386
|
-
runBeforeUnload
|
387
|
-
});
|
388
|
-
}
|
389
|
-
async setBackgroundColor(color) {
|
390
|
-
if (color) throw new Error('Not implemented');
|
391
|
-
}
|
392
|
-
async takeScreenshot(progress, format, documentRect, viewportRect, quality, fitsViewport, scale) {
|
393
|
-
if (!documentRect) {
|
394
|
-
const scrollOffset = await this._page.mainFrame().waitForFunctionValueInUtility(progress, () => ({
|
395
|
-
x: window.scrollX,
|
396
|
-
y: window.scrollY
|
397
|
-
}));
|
398
|
-
documentRect = {
|
399
|
-
x: viewportRect.x + scrollOffset.x,
|
400
|
-
y: viewportRect.y + scrollOffset.y,
|
401
|
-
width: viewportRect.width,
|
402
|
-
height: viewportRect.height
|
403
|
-
};
|
404
|
-
}
|
405
|
-
progress.throwIfAborted();
|
406
|
-
const {
|
407
|
-
data
|
408
|
-
} = await this._session.send('Page.screenshot', {
|
409
|
-
mimeType: 'image/' + format,
|
410
|
-
clip: documentRect,
|
411
|
-
quality,
|
412
|
-
omitDeviceScaleFactor: scale === 'css'
|
413
|
-
});
|
414
|
-
return Buffer.from(data, 'base64');
|
415
|
-
}
|
416
|
-
async getContentFrame(handle) {
|
417
|
-
const {
|
418
|
-
contentFrameId
|
419
|
-
} = await this._session.send('Page.describeNode', {
|
420
|
-
frameId: handle._context.frame._id,
|
421
|
-
objectId: handle._objectId
|
422
|
-
});
|
423
|
-
if (!contentFrameId) return null;
|
424
|
-
return this._page._frameManager.frame(contentFrameId);
|
425
|
-
}
|
426
|
-
async getOwnerFrame(handle) {
|
427
|
-
const {
|
428
|
-
ownerFrameId
|
429
|
-
} = await this._session.send('Page.describeNode', {
|
430
|
-
frameId: handle._context.frame._id,
|
431
|
-
objectId: handle._objectId
|
432
|
-
});
|
433
|
-
return ownerFrameId || null;
|
434
|
-
}
|
435
|
-
isElementHandle(remoteObject) {
|
436
|
-
return remoteObject.subtype === 'node';
|
437
|
-
}
|
438
|
-
async getBoundingBox(handle) {
|
439
|
-
const quads = await this.getContentQuads(handle);
|
440
|
-
if (!quads || !quads.length) return null;
|
441
|
-
let minX = Infinity;
|
442
|
-
let maxX = -Infinity;
|
443
|
-
let minY = Infinity;
|
444
|
-
let maxY = -Infinity;
|
445
|
-
for (const quad of quads) {
|
446
|
-
for (const point of quad) {
|
447
|
-
minX = Math.min(minX, point.x);
|
448
|
-
maxX = Math.max(maxX, point.x);
|
449
|
-
minY = Math.min(minY, point.y);
|
450
|
-
maxY = Math.max(maxY, point.y);
|
451
|
-
}
|
452
|
-
}
|
453
|
-
return {
|
454
|
-
x: minX,
|
455
|
-
y: minY,
|
456
|
-
width: maxX - minX,
|
457
|
-
height: maxY - minY
|
458
|
-
};
|
459
|
-
}
|
460
|
-
async scrollRectIntoViewIfNeeded(handle, rect) {
|
461
|
-
return await this._session.send('Page.scrollIntoViewIfNeeded', {
|
462
|
-
frameId: handle._context.frame._id,
|
463
|
-
objectId: handle._objectId,
|
464
|
-
rect
|
465
|
-
}).then(() => 'done').catch(e => {
|
466
|
-
if (e instanceof Error && e.message.includes('Node is detached from document')) return 'error:notconnected';
|
467
|
-
if (e instanceof Error && e.message.includes('Node does not have a layout object')) return 'error:notvisible';
|
468
|
-
throw e;
|
469
|
-
});
|
470
|
-
}
|
471
|
-
async setScreencastOptions(options) {
|
472
|
-
if (options) {
|
473
|
-
const {
|
474
|
-
screencastId
|
475
|
-
} = await this._session.send('Page.startScreencast', options);
|
476
|
-
this._screencastId = screencastId;
|
477
|
-
} else {
|
478
|
-
await this._session.send('Page.stopScreencast');
|
479
|
-
}
|
480
|
-
}
|
481
|
-
_onScreencastFrame(event) {
|
482
|
-
if (!this._screencastId) return;
|
483
|
-
const screencastId = this._screencastId;
|
484
|
-
this._page.throttleScreencastFrameAck(() => {
|
485
|
-
this._session.send('Page.screencastFrameAck', {
|
486
|
-
screencastId
|
487
|
-
}).catch(e => _debugLogger.debugLogger.log('error', e));
|
488
|
-
});
|
489
|
-
const buffer = Buffer.from(event.data, 'base64');
|
490
|
-
this._page.emit(_page.Page.Events.ScreencastFrame, {
|
491
|
-
buffer,
|
492
|
-
width: event.deviceWidth,
|
493
|
-
height: event.deviceHeight
|
494
|
-
});
|
495
|
-
}
|
496
|
-
rafCountForStablePosition() {
|
497
|
-
return 1;
|
498
|
-
}
|
499
|
-
async getContentQuads(handle) {
|
500
|
-
const result = await this._session.sendMayFail('Page.getContentQuads', {
|
501
|
-
frameId: handle._context.frame._id,
|
502
|
-
objectId: handle._objectId
|
503
|
-
});
|
504
|
-
if (!result) return null;
|
505
|
-
return result.quads.map(quad => [quad.p1, quad.p2, quad.p3, quad.p4]);
|
506
|
-
}
|
507
|
-
async setInputFiles(handle, files) {
|
508
|
-
await handle.evaluateInUtility(([injected, node, files]) => injected.setInputFiles(node, files), files);
|
509
|
-
}
|
510
|
-
async setInputFilePaths(handle, files) {
|
511
|
-
await this._session.send('Page.setFileInputFiles', {
|
512
|
-
frameId: handle._context.frame._id,
|
513
|
-
objectId: handle._objectId,
|
514
|
-
files
|
515
|
-
});
|
516
|
-
}
|
517
|
-
async adoptElementHandle(handle, to) {
|
518
|
-
const result = await this._session.send('Page.adoptNode', {
|
519
|
-
frameId: handle._context.frame._id,
|
520
|
-
objectId: handle._objectId,
|
521
|
-
executionContextId: to[contextDelegateSymbol]._executionContextId
|
522
|
-
});
|
523
|
-
if (!result.remoteObject) throw new Error(dom.kUnableToAdoptErrorMessage);
|
524
|
-
return to.createHandle(result.remoteObject);
|
525
|
-
}
|
526
|
-
async getAccessibilityTree(needle) {
|
527
|
-
return (0, _ffAccessibility.getAccessibilityTree)(this._session, needle);
|
528
|
-
}
|
529
|
-
async inputActionEpilogue() {}
|
530
|
-
async resetForReuse() {
|
531
|
-
// Firefox sometimes keeps the last mouse position in the page,
|
532
|
-
// which affects things like hovered state.
|
533
|
-
// See https://github.com/microsoft/playwright/issues/22432.
|
534
|
-
// Move mouse to (-1, -1) to avoid anything being hovered.
|
535
|
-
await this.rawMouse.move(-1, -1, 'none', new Set(), new Set(), false);
|
536
|
-
}
|
537
|
-
async getFrameElement(frame) {
|
538
|
-
const parent = frame.parentFrame();
|
539
|
-
if (!parent) throw new Error('Frame has been detached.');
|
540
|
-
const context = await parent._mainContext();
|
541
|
-
const result = await this._session.send('Page.adoptNode', {
|
542
|
-
frameId: frame._id,
|
543
|
-
executionContextId: context[contextDelegateSymbol]._executionContextId
|
544
|
-
});
|
545
|
-
if (!result.remoteObject) throw new Error('Frame has been detached.');
|
546
|
-
return context.createHandle(result.remoteObject);
|
547
|
-
}
|
548
|
-
shouldToggleStyleSheetToSyncAnimations() {
|
549
|
-
return false;
|
550
|
-
}
|
551
|
-
}
|
552
|
-
exports.FFPage = FFPage;
|
553
|
-
function webSocketId(frameId, wsid) {
|
554
|
-
return `${frameId}---${wsid}`;
|
555
|
-
}
|
556
|
-
const contextDelegateSymbol = Symbol('delegate');
|
@@ -1,110 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Firefox = void 0;
|
7
|
-
var os = _interopRequireWildcard(require("os"));
|
8
|
-
var _path = _interopRequireDefault(require("path"));
|
9
|
-
var _ffBrowser = require("./ffBrowser");
|
10
|
-
var _ffConnection = require("./ffConnection");
|
11
|
-
var _browserType = require("../browserType");
|
12
|
-
var _utils = require("../../utils");
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
16
|
-
/**
|
17
|
-
* Copyright 2017 Google Inc. All rights reserved.
|
18
|
-
* Modifications copyright (c) Microsoft Corporation.
|
19
|
-
*
|
20
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
21
|
-
* you may not use this file except in compliance with the License.
|
22
|
-
* You may obtain a copy of the License at
|
23
|
-
*
|
24
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
25
|
-
*
|
26
|
-
* Unless required by applicable law or agreed to in writing, software
|
27
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
28
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
29
|
-
* See the License for the specific language governing permissions and
|
30
|
-
* limitations under the License.
|
31
|
-
*/
|
32
|
-
|
33
|
-
class Firefox extends _browserType.BrowserType {
|
34
|
-
constructor(parent) {
|
35
|
-
super(parent, 'firefox');
|
36
|
-
}
|
37
|
-
connectToTransport(transport, options) {
|
38
|
-
return _ffBrowser.FFBrowser.connect(this.attribution.playwright, transport, options);
|
39
|
-
}
|
40
|
-
doRewriteStartupLog(error) {
|
41
|
-
if (!error.logs) return error;
|
42
|
-
// https://github.com/microsoft/playwright/issues/6500
|
43
|
-
if (error.logs.includes(`as root in a regular user's session is not supported.`)) error.logs = '\n' + (0, _utils.wrapInASCIIBox)(`Firefox is unable to launch if the $HOME folder isn't owned by the current user.\nWorkaround: Set the HOME=/root environment variable${process.env.GITHUB_ACTION ? ' in your GitHub Actions workflow file' : ''} when running Playwright.`, 1);
|
44
|
-
if (error.logs.includes('no DISPLAY environment variable specified')) error.logs = '\n' + (0, _utils.wrapInASCIIBox)(_browserType.kNoXServerRunningError, 1);
|
45
|
-
return error;
|
46
|
-
}
|
47
|
-
amendEnvironment(env, userDataDir, executable, browserArguments) {
|
48
|
-
if (!_path.default.isAbsolute(os.homedir())) throw new Error(`Cannot launch Firefox with relative home directory. Did you set ${os.platform() === 'win32' ? 'USERPROFILE' : 'HOME'} to a relative path?`);
|
49
|
-
if (os.platform() === 'linux') {
|
50
|
-
// Always remove SNAP_NAME and SNAP_INSTANCE_NAME env variables since they
|
51
|
-
// confuse Firefox: in our case, builds never come from SNAP.
|
52
|
-
// See https://github.com/microsoft/playwright/issues/20555
|
53
|
-
return {
|
54
|
-
...env,
|
55
|
-
SNAP_NAME: undefined,
|
56
|
-
SNAP_INSTANCE_NAME: undefined
|
57
|
-
};
|
58
|
-
}
|
59
|
-
return env;
|
60
|
-
}
|
61
|
-
attemptToGracefullyCloseBrowser(transport) {
|
62
|
-
const message = {
|
63
|
-
method: 'Browser.close',
|
64
|
-
params: {},
|
65
|
-
id: _ffConnection.kBrowserCloseMessageId
|
66
|
-
};
|
67
|
-
transport.send(message);
|
68
|
-
}
|
69
|
-
defaultArgs(options, isPersistent, userDataDir) {
|
70
|
-
const {
|
71
|
-
args = [],
|
72
|
-
headless
|
73
|
-
} = options;
|
74
|
-
const userDataDirArg = args.find(arg => arg.startsWith('-profile') || arg.startsWith('--profile'));
|
75
|
-
if (userDataDirArg) throw this._createUserDataDirArgMisuseError('--profile');
|
76
|
-
if (args.find(arg => arg.startsWith('-juggler'))) throw new Error('Use the port parameter instead of -juggler argument');
|
77
|
-
const firefoxArguments = ['-no-remote'];
|
78
|
-
if (headless) {
|
79
|
-
firefoxArguments.push('-headless');
|
80
|
-
} else {
|
81
|
-
firefoxArguments.push('-wait-for-browser');
|
82
|
-
firefoxArguments.push('-foreground');
|
83
|
-
}
|
84
|
-
firefoxArguments.push(`-profile`, userDataDir);
|
85
|
-
firefoxArguments.push('-juggler-pipe');
|
86
|
-
firefoxArguments.push(...args);
|
87
|
-
if (isPersistent) firefoxArguments.push('about:blank');else firefoxArguments.push('-silent');
|
88
|
-
return firefoxArguments;
|
89
|
-
}
|
90
|
-
readyState(options) {
|
91
|
-
return new JugglerReadyState();
|
92
|
-
}
|
93
|
-
}
|
94
|
-
exports.Firefox = Firefox;
|
95
|
-
class JugglerReadyState {
|
96
|
-
constructor() {
|
97
|
-
this._jugglerPromise = new _utils.ManualPromise();
|
98
|
-
}
|
99
|
-
onBrowserOutput(message) {
|
100
|
-
if (message.includes('Juggler listening to the pipe')) this._jugglerPromise.resolve();
|
101
|
-
}
|
102
|
-
onBrowserExit() {
|
103
|
-
// Unblock launch when browser prematurely exits.
|
104
|
-
this._jugglerPromise.resolve();
|
105
|
-
}
|
106
|
-
async waitUntilReady() {
|
107
|
-
await this._jugglerPromise;
|
108
|
-
return {};
|
109
|
-
}
|
110
|
-
}
|