@speedkit/cli 4.51.0-run-control.5 → 4.51.1
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/CHANGELOG.md +37 -0
- package/README.md +14 -1426
- package/dist/commands/diff.d.ts +1 -7
- package/dist/commands/diff.js +3 -9
- package/dist/commands/login.d.ts +0 -3
- package/dist/commands/login.js +3 -14
- package/dist/commands/onboarding.d.ts +0 -26
- package/dist/commands/onboarding.js +4 -221
- package/dist/commands/origin-request.d.ts +0 -4
- package/dist/commands/origin-request.js +0 -4
- package/dist/services/browser-fetch/device-emulation.d.ts +0 -11
- package/dist/services/browser-fetch/device-emulation.js +0 -14
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -0
- package/dist/services/bundler/bundle-service-factory.js +5 -1
- package/dist/services/bundler/bundle-service.d.ts +10 -1
- package/dist/services/bundler/bundle-service.js +16 -1
- package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
- package/dist/services/bundler/error/packjockel-error.js +3 -0
- package/dist/services/bundler/index.d.ts +1 -0
- package/dist/services/bundler/index.js +1 -0
- package/dist/services/bundler/packjockel-service.d.ts +112 -0
- package/dist/services/bundler/packjockel-service.js +202 -0
- package/dist/services/bundler/spec/packjockel-service.spec.js +186 -0
- package/dist/services/cli/cli-environment-factory.d.ts +0 -3
- package/dist/services/cli/cli-environment-factory.js +0 -1
- package/dist/services/cli/cli-service-build-context.d.ts +0 -3
- package/dist/services/cli/cli-service-factory.js +1 -1
- package/dist/services/cli/cli-service-model.d.ts +10 -29
- package/dist/services/cli/cli-service.d.ts +11 -60
- package/dist/services/cli/cli-service.js +32 -196
- package/dist/services/cli/index.d.ts +0 -2
- package/dist/services/cli/index.js +0 -2
- package/dist/services/cli/spec/cli-service.spec.js +50 -113
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
- package/dist/services/deploy/handler/customer-config-handler.d.ts +9 -0
- package/dist/services/deploy/handler/customer-config-handler.js +41 -6
- package/dist/services/deploy/interface/install.d.ts +7 -1
- package/dist/services/deploy/mr/live-state-check.js +21 -2
- package/dist/services/deploy/policy/auto-deploy-policy.js +2 -0
- package/dist/services/deploy/policy/deploy-policy-model.d.ts +4 -0
- package/dist/services/deploy/policy/deploy-policy-model.js +4 -0
- package/dist/services/deploy/policy/testing-deploy-policy.js +2 -0
- package/dist/services/deploy/spec/handler/customer-config-handler.spec.js +98 -0
- package/dist/services/deploy/spec/mr/live-state-check.spec.js +45 -4
- package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +2 -0
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +3 -1
- package/dist/services/diff/diff-service-build-context.d.ts +0 -12
- package/dist/services/diff/diff-service-build-context.js +1 -45
- package/dist/services/diff/diff-service-factory.d.ts +0 -2
- package/dist/services/diff/diff-service-factory.js +25 -65
- package/dist/services/diff/diff-service.d.ts +0 -11
- package/dist/services/diff/diff-service.js +11 -37
- package/dist/services/diff/page-source.d.ts +0 -12
- package/dist/services/diff/page-source.js +11 -16
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +2 -3
- package/dist/services/diff/sinks/tool-diff-sink.js +2 -3
- package/dist/services/diff/spec/diff-service-build-context.spec.js +0 -19
- package/dist/services/diff/spec/diff-service.spec.js +0 -95
- package/dist/services/document-handler-runtime/document-handler-browser-mock.d.ts +13 -0
- package/dist/services/document-handler-runtime/document-handler-browser-mock.js +69 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +27 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +112 -19
- package/dist/services/document-handler-runtime/spec/document-handler-browser-mock.spec.js +34 -0
- package/dist/services/git/git-repository.d.ts +0 -2
- package/dist/services/git/git-repository.js +0 -6
- package/dist/services/integration-api/customer-config-flags.js +0 -1
- package/dist/services/integration-api/integration-api-model.d.ts +4 -1
- package/dist/services/integration-api/spec/customer-config-file.spec.js +56 -0
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +68 -8
- package/dist/services/integration-api/struct/customer-config-file.d.ts +15 -0
- package/dist/services/integration-api/struct/customer-config-file.js +42 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +55 -1
- package/dist/services/integration-api/struct/customer-config.js +70 -3
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +11 -4
- package/dist/services/integration-api/struct/speed-kit-config-file.js +31 -10
- package/dist/services/onboarding/browse/browse-service.d.ts +1 -13
- package/dist/services/onboarding/browse/browse-service.js +7 -43
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -17
- package/dist/services/onboarding/browser/baqend-response.js +0 -23
- package/dist/services/onboarding/browser/emulate-device.d.ts +1 -12
- package/dist/services/onboarding/browser/emulate-device.js +13 -68
- package/dist/services/onboarding/browser/executable/executable-validator.js +2 -4
- package/dist/services/onboarding/browser/extension/extension-bridge.js +3 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -17
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -9
- package/dist/services/onboarding/browser/launch-browser.d.ts +1 -2
- package/dist/services/onboarding/browser/launch-browser.js +1 -6
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +29 -8
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -3
- package/dist/services/onboarding/dashboard/index.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +5 -24
- package/dist/services/onboarding/fetch-event-handler.js +32 -103
- package/dist/services/onboarding/fetch-events/spec/speed-kit-install-js.spec.js +59 -0
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +7 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +0 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +0 -30
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -14
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +10 -29
- package/dist/services/onboarding/file-events/file-watcher.d.ts +4 -43
- package/dist/services/onboarding/file-events/file-watcher.js +21 -119
- package/dist/services/onboarding/inject/inject-service.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +7 -40
- package/dist/services/onboarding/onboarding-model.js +9 -20
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -4
- package/dist/services/onboarding/onboarding-service-build-context.js +1 -7
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -17
- package/dist/services/onboarding/onboarding-service-factory.js +35 -152
- package/dist/services/onboarding/onboarding-service.d.ts +1 -40
- package/dist/services/onboarding/onboarding-service.js +23 -139
- package/dist/services/onboarding/request-cache/cache.d.ts +5 -62
- package/dist/services/onboarding/request-cache/cache.js +17 -128
- package/dist/services/onboarding/spec/file-events/file-watcher.spec.js +67 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +3 -39
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -25
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
- package/dist/services/onboarding/todo-collector.d.ts +2 -7
- package/dist/services/onboarding/todo-collector.js +12 -49
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +0 -38
- package/dist/services/onboarding/virtual-orestes-app/index.js +27 -113
- package/dist/services/origin-request/asset-variations.d.ts +0 -14
- package/dist/services/origin-request/asset-variations.js +4 -11
- package/dist/services/origin-request/origin-fetcher.d.ts +0 -7
- package/dist/services/origin-request/origin-fetcher.js +5 -43
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +0 -17
- package/dist/services/origin-request/origin-request-service-build-context.js +0 -8
- package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
- package/dist/services/origin-request/origin-request-service-factory.js +30 -2
- package/dist/services/origin-request/origin-request-service.d.ts +6 -121
- package/dist/services/origin-request/origin-request-service.js +49 -273
- package/dist/services/origin-request/runtime-config-source.d.ts +0 -6
- package/dist/services/origin-request/runtime-config-source.js +4 -15
- package/dist/services/origin-request/spec/asset-variations.spec.js +0 -20
- package/dist/services/origin-request/spec/origin-request-service.spec.js +6 -329
- package/dist/services/pull/pull-service.js +23 -5
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/dist/services/setup/os/tool-registry.js +2 -2
- package/oclif.manifest.json +269 -3390
- package/package.json +3 -20
- package/dist/base/run-control-command.d.ts +0 -15
- package/dist/base/run-control-command.js +0 -20
- package/dist/build-info.json +0 -6
- package/dist/commands/onboarding/browser/click.d.ts +0 -75
- package/dist/commands/onboarding/browser/click.js +0 -19
- package/dist/commands/onboarding/browser/emulate.d.ts +0 -105
- package/dist/commands/onboarding/browser/emulate.js +0 -26
- package/dist/commands/onboarding/browser/navigate.d.ts +0 -75
- package/dist/commands/onboarding/browser/navigate.js +0 -19
- package/dist/commands/onboarding/browser/panel.d.ts +0 -63
- package/dist/commands/onboarding/browser/panel.js +0 -12
- package/dist/commands/onboarding/browser/reinstall-sw.d.ts +0 -63
- package/dist/commands/onboarding/browser/reinstall-sw.js +0 -14
- package/dist/commands/onboarding/browser/reset.d.ts +0 -71
- package/dist/commands/onboarding/browser/reset.js +0 -18
- package/dist/commands/onboarding/browser/screenshot.d.ts +0 -77
- package/dist/commands/onboarding/browser/screenshot.js +0 -19
- package/dist/commands/onboarding/browser/state.d.ts +0 -63
- package/dist/commands/onboarding/browser/state.js +0 -12
- package/dist/commands/onboarding/browser/tabs.d.ts +0 -58
- package/dist/commands/onboarding/browser/tabs.js +0 -16
- package/dist/commands/onboarding/cache/clear.d.ts +0 -58
- package/dist/commands/onboarding/cache/clear.js +0 -12
- package/dist/commands/onboarding/cache/errors.d.ts +0 -58
- package/dist/commands/onboarding/cache/errors.js +0 -12
- package/dist/commands/onboarding/cache/evict.d.ts +0 -62
- package/dist/commands/onboarding/cache/evict.js +0 -15
- package/dist/commands/onboarding/cache/get.d.ts +0 -85
- package/dist/commands/onboarding/cache/get.js +0 -17
- package/dist/commands/onboarding/cache/list.d.ts +0 -58
- package/dist/commands/onboarding/cache/list.js +0 -15
- package/dist/commands/onboarding/cache/prewarm.d.ts +0 -73
- package/dist/commands/onboarding/cache/prewarm.js +0 -20
- package/dist/commands/onboarding/cache/refresh.d.ts +0 -62
- package/dist/commands/onboarding/cache/refresh.js +0 -18
- package/dist/commands/onboarding/cdp.d.ts +0 -81
- package/dist/commands/onboarding/cdp.js +0 -18
- package/dist/commands/onboarding/debug/arm.d.ts +0 -83
- package/dist/commands/onboarding/debug/arm.js +0 -19
- package/dist/commands/onboarding/debug/await.d.ts +0 -71
- package/dist/commands/onboarding/debug/await.js +0 -18
- package/dist/commands/onboarding/debug/disarm.d.ts +0 -63
- package/dist/commands/onboarding/debug/disarm.js +0 -12
- package/dist/commands/onboarding/debug/eval.d.ts +0 -75
- package/dist/commands/onboarding/debug/eval.js +0 -16
- package/dist/commands/onboarding/debug/release.d.ts +0 -63
- package/dist/commands/onboarding/debug/release.js +0 -12
- package/dist/commands/onboarding/debug/resume.d.ts +0 -63
- package/dist/commands/onboarding/debug/resume.js +0 -12
- package/dist/commands/onboarding/debug/status.d.ts +0 -63
- package/dist/commands/onboarding/debug/status.js +0 -12
- package/dist/commands/onboarding/debug/step.d.ts +0 -67
- package/dist/commands/onboarding/debug/step.js +0 -15
- package/dist/commands/onboarding/files/list.d.ts +0 -58
- package/dist/commands/onboarding/files/list.js +0 -12
- package/dist/commands/onboarding/files/read.d.ts +0 -73
- package/dist/commands/onboarding/files/read.js +0 -16
- package/dist/commands/onboarding/files/rebuild.d.ts +0 -63
- package/dist/commands/onboarding/files/rebuild.js +0 -18
- package/dist/commands/onboarding/files/validate.d.ts +0 -58
- package/dist/commands/onboarding/files/validate.js +0 -12
- package/dist/commands/onboarding/fouc.d.ts +0 -77
- package/dist/commands/onboarding/fouc.js +0 -16
- package/dist/commands/onboarding/inject/add.d.ts +0 -89
- package/dist/commands/onboarding/inject/add.js +0 -17
- package/dist/commands/onboarding/inject/clear.d.ts +0 -63
- package/dist/commands/onboarding/inject/clear.js +0 -12
- package/dist/commands/onboarding/inject/list.d.ts +0 -63
- package/dist/commands/onboarding/inject/list.js +0 -12
- package/dist/commands/onboarding/inject/read.d.ts +0 -75
- package/dist/commands/onboarding/inject/read.js +0 -18
- package/dist/commands/onboarding/inject/recipes.d.ts +0 -63
- package/dist/commands/onboarding/inject/recipes.js +0 -12
- package/dist/commands/onboarding/inject/remove.d.ts +0 -67
- package/dist/commands/onboarding/inject/remove.js +0 -15
- package/dist/commands/onboarding/list.d.ts +0 -13
- package/dist/commands/onboarding/list.js +0 -12
- package/dist/commands/onboarding/logs.d.ts +0 -41
- package/dist/commands/onboarding/logs.js +0 -257
- package/dist/commands/onboarding/navwalk.d.ts +0 -95
- package/dist/commands/onboarding/navwalk.js +0 -19
- package/dist/commands/onboarding/response.d.ts +0 -67
- package/dist/commands/onboarding/response.js +0 -18
- package/dist/commands/onboarding/rum/beacons.d.ts +0 -75
- package/dist/commands/onboarding/rum/beacons.js +0 -16
- package/dist/commands/onboarding/rum/get.d.ts +0 -77
- package/dist/commands/onboarding/rum/get.js +0 -18
- package/dist/commands/onboarding/rum/key.d.ts +0 -67
- package/dist/commands/onboarding/rum/key.js +0 -13
- package/dist/commands/onboarding/rum/previous.d.ts +0 -63
- package/dist/commands/onboarding/rum/previous.js +0 -12
- package/dist/commands/onboarding/status.d.ts +0 -13
- package/dist/commands/onboarding/status.js +0 -17
- package/dist/commands/onboarding/stop.d.ts +0 -13
- package/dist/commands/onboarding/stop.js +0 -17
- package/dist/commands/onboarding/todo.d.ts +0 -58
- package/dist/commands/onboarding/todo.js +0 -12
- package/dist/commands/onboarding/viewport.d.ts +0 -101
- package/dist/commands/onboarding/viewport.js +0 -18
- package/dist/commands/onboarding/watch.d.ts +0 -93
- package/dist/commands/onboarding/watch.js +0 -16
- package/dist/commands/spec/onboarding.spec.js +0 -127
- package/dist/services/cli/build-info.d.ts +0 -33
- package/dist/services/cli/build-info.js +0 -63
- package/dist/services/cli/sink.d.ts +0 -47
- package/dist/services/cli/sink.js +0 -31
- package/dist/services/cli/spec/build-identity.spec.js +0 -85
- package/dist/services/cli/spec/build-info.spec.js +0 -10
- package/dist/services/cli/spec/cli-service-log.spec.js +0 -133
- package/dist/services/cli/spec/memory-cli.d.ts +0 -9
- package/dist/services/cli/spec/memory-cli.js +0 -9
- package/dist/services/diff/config-at-ref.d.ts +0 -20
- package/dist/services/diff/config-at-ref.js +0 -33
- package/dist/services/diff/run-runtime-config.d.ts +0 -33
- package/dist/services/diff/run-runtime-config.js +0 -74
- package/dist/services/diff/spec/config-at-ref.spec.js +0 -46
- package/dist/services/diff/spec/run-runtime-config.spec.js +0 -87
- package/dist/services/onboarding/browser/answer-dialogs.d.ts +0 -12
- package/dist/services/onboarding/browser/answer-dialogs.js +0 -25
- package/dist/services/onboarding/browser/console-log.d.ts +0 -9
- package/dist/services/onboarding/browser/console-log.js +0 -27
- package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +0 -14
- package/dist/services/onboarding/browser/resume-restarted-workers.js +0 -26
- package/dist/services/onboarding/control/body-inspect.d.ts +0 -24
- package/dist/services/onboarding/control/body-inspect.js +0 -106
- package/dist/services/onboarding/control/browser-session.d.ts +0 -547
- package/dist/services/onboarding/control/browser-session.js +0 -1337
- package/dist/services/onboarding/control/config-validation.d.ts +0 -17
- package/dist/services/onboarding/control/config-validation.js +0 -46
- package/dist/services/onboarding/control/control-protocol.d.ts +0 -1430
- package/dist/services/onboarding/control/control-protocol.js +0 -58
- package/dist/services/onboarding/control/control-server.d.ts +0 -292
- package/dist/services/onboarding/control/control-server.js +0 -1629
- package/dist/services/onboarding/control/debug-session.d.ts +0 -219
- package/dist/services/onboarding/control/debug-session.js +0 -897
- package/dist/services/onboarding/control/fouc.d.ts +0 -23
- package/dist/services/onboarding/control/fouc.js +0 -151
- package/dist/services/onboarding/control/index.d.ts +0 -4
- package/dist/services/onboarding/control/index.js +0 -4
- package/dist/services/onboarding/control/navigate-wait.d.ts +0 -33
- package/dist/services/onboarding/control/navigate-wait.js +0 -56
- package/dist/services/onboarding/control/navwalk.d.ts +0 -65
- package/dist/services/onboarding/control/navwalk.js +0 -248
- package/dist/services/onboarding/control/preload-registry.d.ts +0 -150
- package/dist/services/onboarding/control/preload-registry.js +0 -829
- package/dist/services/onboarding/control/response-explainer.d.ts +0 -24
- package/dist/services/onboarding/control/response-explainer.js +0 -257
- package/dist/services/onboarding/control/rum.d.ts +0 -8
- package/dist/services/onboarding/control/rum.js +0 -220
- package/dist/services/onboarding/control/service-worker-tracker.d.ts +0 -68
- package/dist/services/onboarding/control/service-worker-tracker.js +0 -120
- package/dist/services/onboarding/control/viewport.d.ts +0 -45
- package/dist/services/onboarding/control/viewport.js +0 -344
- package/dist/services/onboarding/control/watch.d.ts +0 -26
- package/dist/services/onboarding/control/watch.js +0 -157
- package/dist/services/onboarding/request-cache/asset-key.d.ts +0 -61
- package/dist/services/onboarding/request-cache/asset-key.js +0 -115
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +0 -66
- package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/console-log.spec.js +0 -42
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +0 -45
- package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/browser-session.spec.js +0 -753
- package/dist/services/onboarding/spec/control/control-server.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/control-server.spec.js +0 -371
- package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/debug-session.spec.js +0 -751
- package/dist/services/onboarding/spec/control/fakes.d.ts +0 -31
- package/dist/services/onboarding/spec/control/fakes.js +0 -67
- package/dist/services/onboarding/spec/control/fouc.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/fouc.spec.js +0 -167
- package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navigate-wait.spec.js +0 -47
- package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navwalk.spec.js +0 -222
- package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/preload-registry.spec.js +0 -432
- package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/response-explainer.spec.js +0 -324
- package/dist/services/onboarding/spec/control/rum.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/rum.spec.js +0 -222
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +0 -193
- package/dist/services/onboarding/spec/control/viewport.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/viewport.spec.js +0 -200
- package/dist/services/onboarding/spec/control/watch.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/watch.spec.js +0 -187
- package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-event-handler.spec.js +0 -219
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +0 -41
- package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/request-cache/cache.spec.js +0 -107
- package/dist/services/onboarding/spec/todo-collector.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/todo-collector.spec.js +0 -136
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +0 -65
- package/dist/services/query-builder/rules/rule-match.d.ts +0 -35
- package/dist/services/query-builder/rules/rule-match.js +0 -70
- package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +0 -1
- package/dist/services/query-builder/spec/rules/rule-match.spec.js +0 -121
- package/dist/services/run-control/browser/run-browser-contexts.d.ts +0 -557
- package/dist/services/run-control/browser/run-browser-contexts.js +0 -91
- package/dist/services/run-control/browser/run-browser-service-factory.d.ts +0 -5
- package/dist/services/run-control/browser/run-browser-service-factory.js +0 -7
- package/dist/services/run-control/browser/run-browser-service.d.ts +0 -68
- package/dist/services/run-control/browser/run-browser-service.js +0 -206
- package/dist/services/run-control/cache/run-cache-contexts.d.ts +0 -349
- package/dist/services/run-control/cache/run-cache-contexts.js +0 -51
- package/dist/services/run-control/cache/run-cache-service-factory.d.ts +0 -6
- package/dist/services/run-control/cache/run-cache-service-factory.js +0 -12
- package/dist/services/run-control/cache/run-cache-service.d.ts +0 -35
- package/dist/services/run-control/cache/run-cache-service.js +0 -151
- package/dist/services/run-control/control-client.d.ts +0 -36
- package/dist/services/run-control/control-client.js +0 -147
- package/dist/services/run-control/debug/run-debug-contexts.d.ts +0 -416
- package/dist/services/run-control/debug/run-debug-contexts.js +0 -47
- package/dist/services/run-control/debug/run-debug-service-factory.d.ts +0 -5
- package/dist/services/run-control/debug/run-debug-service-factory.js +0 -7
- package/dist/services/run-control/debug/run-debug-service.d.ts +0 -39
- package/dist/services/run-control/debug/run-debug-service.js +0 -164
- package/dist/services/run-control/files/run-files-contexts.d.ts +0 -238
- package/dist/services/run-control/files/run-files-contexts.js +0 -26
- package/dist/services/run-control/files/run-files-service-factory.d.ts +0 -5
- package/dist/services/run-control/files/run-files-service-factory.js +0 -7
- package/dist/services/run-control/files/run-files-service.d.ts +0 -29
- package/dist/services/run-control/files/run-files-service.js +0 -120
- package/dist/services/run-control/index.d.ts +0 -32
- package/dist/services/run-control/index.js +0 -31
- package/dist/services/run-control/inject/run-inject-contexts.d.ts +0 -319
- package/dist/services/run-control/inject/run-inject-contexts.js +0 -38
- package/dist/services/run-control/inject/run-inject-service-factory.d.ts +0 -5
- package/dist/services/run-control/inject/run-inject-service-factory.js +0 -7
- package/dist/services/run-control/inject/run-inject-service.d.ts +0 -31
- package/dist/services/run-control/inject/run-inject-service.js +0 -227
- package/dist/services/run-control/live-run.d.ts +0 -37
- package/dist/services/run-control/live-run.js +0 -56
- package/dist/services/run-control/probe/run-probe-contexts.d.ts +0 -333
- package/dist/services/run-control/probe/run-probe-contexts.js +0 -73
- package/dist/services/run-control/probe/run-probe-service-factory.d.ts +0 -5
- package/dist/services/run-control/probe/run-probe-service-factory.js +0 -7
- package/dist/services/run-control/probe/run-probe-service.d.ts +0 -54
- package/dist/services/run-control/probe/run-probe-service.js +0 -194
- package/dist/services/run-control/rum/run-rum-contexts.d.ts +0 -216
- package/dist/services/run-control/rum/run-rum-contexts.js +0 -34
- package/dist/services/run-control/rum/run-rum-service-factory.d.ts +0 -5
- package/dist/services/run-control/rum/run-rum-service-factory.js +0 -7
- package/dist/services/run-control/rum/run-rum-service.d.ts +0 -36
- package/dist/services/run-control/rum/run-rum-service.js +0 -122
- package/dist/services/run-control/run-answer.d.ts +0 -28
- package/dist/services/run-control/run-answer.js +0 -58
- package/dist/services/run-control/run-control-context.d.ts +0 -102
- package/dist/services/run-control/run-control-context.js +0 -36
- package/dist/services/run-control/run-control-flags.d.ts +0 -12
- package/dist/services/run-control/run-control-flags.js +0 -22
- package/dist/services/run-control/run-control-model.d.ts +0 -9
- package/dist/services/run-control/run-control-model.js +0 -1
- package/dist/services/run-control/run-control-service-factory.d.ts +0 -14
- package/dist/services/run-control/run-control-service-factory.js +0 -26
- package/dist/services/run-control/session/run-session-contexts.d.ts +0 -25
- package/dist/services/run-control/session/run-session-contexts.js +0 -20
- package/dist/services/run-control/session/run-session-service-factory.d.ts +0 -8
- package/dist/services/run-control/session/run-session-service-factory.js +0 -18
- package/dist/services/run-control/session/run-session-service.d.ts +0 -32
- package/dist/services/run-control/session/run-session-service.js +0 -151
- package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/browser/run-browser-service.spec.js +0 -328
- package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/cache/run-cache-service.spec.js +0 -454
- package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/debug/run-debug-service.spec.js +0 -113
- package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/files/run-files-service.spec.js +0 -234
- package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/inject/run-inject-service.spec.js +0 -251
- package/dist/services/run-control/spec/live-run-fixture.d.ts +0 -32
- package/dist/services/run-control/spec/live-run-fixture.js +0 -109
- package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/probe/run-probe-service.spec.js +0 -108
- package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/rum/run-rum-service.spec.js +0 -47
- package/dist/services/run-control/spec/run-answer.spec.d.ts +0 -1
- package/dist/services/run-control/spec/run-answer.spec.js +0 -57
- package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/session/run-session-service.spec.js +0 -150
- package/dist/services/run-log/crash-mirror.d.ts +0 -31
- package/dist/services/run-log/crash-mirror.js +0 -69
- package/dist/services/run-log/index.d.ts +0 -11
- package/dist/services/run-log/index.js +0 -11
- package/dist/services/run-log/jsonl-appender.d.ts +0 -46
- package/dist/services/run-log/jsonl-appender.js +0 -91
- package/dist/services/run-log/log-event-model.d.ts +0 -104
- package/dist/services/run-log/log-event-model.js +0 -56
- package/dist/services/run-log/log-query-service-factory.d.ts +0 -11
- package/dist/services/run-log/log-query-service-factory.js +0 -14
- package/dist/services/run-log/log-query-service.d.ts +0 -59
- package/dist/services/run-log/log-query-service.js +0 -111
- package/dist/services/run-log/log-reader.d.ts +0 -84
- package/dist/services/run-log/log-reader.js +0 -180
- package/dist/services/run-log/log-summary.d.ts +0 -72
- package/dist/services/run-log/log-summary.js +0 -208
- package/dist/services/run-log/redaction.d.ts +0 -34
- package/dist/services/run-log/redaction.js +0 -124
- package/dist/services/run-log/request-log.d.ts +0 -82
- package/dist/services/run-log/request-log.js +0 -69
- package/dist/services/run-log/request-summary.d.ts +0 -76
- package/dist/services/run-log/request-summary.js +0 -0
- package/dist/services/run-log/run-log.d.ts +0 -61
- package/dist/services/run-log/run-log.js +0 -102
- package/dist/services/run-log/spec/log-query-service.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-query-service.spec.js +0 -197
- package/dist/services/run-log/spec/log-reader.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-reader.spec.js +0 -109
- package/dist/services/run-log/spec/log-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-summary.spec.js +0 -153
- package/dist/services/run-log/spec/redaction.spec.d.ts +0 -1
- package/dist/services/run-log/spec/redaction.spec.js +0 -61
- package/dist/services/run-log/spec/request-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-log.spec.js +0 -101
- package/dist/services/run-log/spec/request-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-summary.spec.js +0 -171
- package/dist/services/run-log/spec/run-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/run-log.spec.js +0 -122
- package/dist/services/run-registry/exit-classification.d.ts +0 -39
- package/dist/services/run-registry/exit-classification.js +0 -42
- package/dist/services/run-registry/index.d.ts +0 -3
- package/dist/services/run-registry/index.js +0 -3
- package/dist/services/run-registry/process-identity.d.ts +0 -28
- package/dist/services/run-registry/process-identity.js +0 -80
- package/dist/services/run-registry/run-registry-model.d.ts +0 -128
- package/dist/services/run-registry/run-registry-model.js +0 -16
- package/dist/services/run-registry/run-registry.d.ts +0 -155
- package/dist/services/run-registry/run-registry.js +0 -430
- package/dist/services/run-registry/spec/exit-classification.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/exit-classification.spec.js +0 -82
- package/dist/services/run-registry/spec/run-registry.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/run-registry.spec.js +0 -526
- /package/dist/{commands/spec/onboarding.spec.d.ts → services/bundler/spec/packjockel-service.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-identity.spec.d.ts → deploy/spec/handler/customer-config-handler.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-info.spec.d.ts → document-handler-runtime/spec/document-handler-browser-mock.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/cli-service-log.spec.d.ts → integration-api/spec/customer-config-file.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/config-at-ref.spec.d.ts → onboarding/fetch-events/spec/speed-kit-install-js.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/run-runtime-config.spec.d.ts → onboarding/spec/file-events/file-watcher.spec.d.ts} +0 -0
|
@@ -3,7 +3,6 @@ import { Protocol } from "puppeteer-core";
|
|
|
3
3
|
import { CustomerConfig } from "../../integration-api/index.js";
|
|
4
4
|
import { AbortResponse } from "../browser/abort-response.js";
|
|
5
5
|
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
6
|
-
import { RumBeacon } from "../control/control-protocol.js";
|
|
7
6
|
import { VirtualOrestesApp } from "../virtual-orestes-app/index.js";
|
|
8
7
|
/**
|
|
9
8
|
* Intercepts v1/rum/pi requests,
|
|
@@ -12,23 +11,10 @@ import { VirtualOrestesApp } from "../virtual-orestes-app/index.js";
|
|
|
12
11
|
*
|
|
13
12
|
* @implements FetchRequestPausedEventHandler
|
|
14
13
|
*/
|
|
15
|
-
/** How many beacons the run keeps for `rum beacons`. */
|
|
16
|
-
export declare const BEACON_LIMIT = 200;
|
|
17
14
|
export declare class SpeedKitRumPiRequest implements FetchRequestPausedEventHandler {
|
|
18
15
|
private customerConfig;
|
|
19
16
|
private orestesApp;
|
|
20
17
|
readonly patterns: Protocol.Fetch.RequestPattern[];
|
|
21
|
-
/**
|
|
22
|
-
* The last beacons, as they left the page.
|
|
23
|
-
*
|
|
24
|
-
* `rum get` reads what Speed Kit merged; which beacon carried a field, and
|
|
25
|
-
* when — the question when a click should have tracked something — is only
|
|
26
|
-
* answerable from the beacons themselves.
|
|
27
|
-
*/
|
|
28
|
-
private readonly kept;
|
|
29
|
-
private seq;
|
|
30
|
-
beacons(): RumBeacon[];
|
|
31
18
|
constructor(customerConfig: CustomerConfig, orestesApp: VirtualOrestesApp);
|
|
32
19
|
handle(event: Protocol.Fetch.RequestPausedEvent, _: CDPSession): Promise<AbortResponse | Partial<Protocol.Fetch.FulfillRequestRequest> | null>;
|
|
33
|
-
private keep;
|
|
34
20
|
}
|
|
@@ -6,24 +6,10 @@ import { safe } from "../../../helpers/safe.js";
|
|
|
6
6
|
*
|
|
7
7
|
* @implements FetchRequestPausedEventHandler
|
|
8
8
|
*/
|
|
9
|
-
/** How many beacons the run keeps for `rum beacons`. */
|
|
10
|
-
export const BEACON_LIMIT = 200;
|
|
11
9
|
export class SpeedKitRumPiRequest {
|
|
12
10
|
customerConfig;
|
|
13
11
|
orestesApp;
|
|
14
12
|
patterns;
|
|
15
|
-
/**
|
|
16
|
-
* The last beacons, as they left the page.
|
|
17
|
-
*
|
|
18
|
-
* `rum get` reads what Speed Kit merged; which beacon carried a field, and
|
|
19
|
-
* when — the question when a click should have tracked something — is only
|
|
20
|
-
* answerable from the beacons themselves.
|
|
21
|
-
*/
|
|
22
|
-
kept = [];
|
|
23
|
-
seq = 0;
|
|
24
|
-
beacons() {
|
|
25
|
-
return [...this.kept];
|
|
26
|
-
}
|
|
27
13
|
constructor(customerConfig, orestesApp) {
|
|
28
14
|
this.customerConfig = customerConfig;
|
|
29
15
|
this.orestesApp = orestesApp;
|
|
@@ -39,9 +25,6 @@ export class SpeedKitRumPiRequest {
|
|
|
39
25
|
return;
|
|
40
26
|
}
|
|
41
27
|
const result = safe(() => JSON.parse(event.request.postData));
|
|
42
|
-
this.keep(event, result.success === true && result.data && typeof result.data === "object"
|
|
43
|
-
? result.data
|
|
44
|
-
: null);
|
|
45
28
|
if (result.success === false) {
|
|
46
29
|
return;
|
|
47
30
|
}
|
|
@@ -52,17 +35,4 @@ export class SpeedKitRumPiRequest {
|
|
|
52
35
|
// refresh in the background - do not block the intercepted rum/pi request
|
|
53
36
|
void this.orestesApp.refreshUrl(changeDetection.url);
|
|
54
37
|
}
|
|
55
|
-
keep(event, data) {
|
|
56
|
-
this.seq += 1;
|
|
57
|
-
this.kept.push({
|
|
58
|
-
seq: this.seq,
|
|
59
|
-
at: new Date().toISOString(),
|
|
60
|
-
url: event.request.url,
|
|
61
|
-
bytes: event.request.postData?.length ?? 0,
|
|
62
|
-
data,
|
|
63
|
-
});
|
|
64
|
-
if (this.kept.length > BEACON_LIMIT) {
|
|
65
|
-
this.kept.shift();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
38
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Protocol } from "devtools-protocol";
|
|
2
2
|
import { CustomerConfig, FileInterface } from "../../integration-api/index.js";
|
|
3
3
|
import { FetchRequestPausedEventHandler } from "../onboarding-model.js";
|
|
4
|
-
/** Makes the worker report `userAgent` as its own, for an emulated device. */
|
|
5
|
-
export declare function userAgentPrelude(userAgent: string): string;
|
|
6
4
|
/**
|
|
7
5
|
* SpeedKitServiceWorkerJs class is responsible for handling fetch requests for the SpeedKit service worker.
|
|
8
6
|
* Injects serviceWorker from local file, if custom_sw is present.
|
|
7
|
+
* With `bundle`, it serves the service worker bundled with the embedded config instead.
|
|
9
8
|
*
|
|
10
9
|
* @implements FetchRequestPausedEventHandler
|
|
11
10
|
*/
|
|
12
11
|
export declare class SpeedKitServiceWorkerJs implements FetchRequestPausedEventHandler {
|
|
13
12
|
private customerConfig;
|
|
14
13
|
private serviceWorker;
|
|
14
|
+
private bundle?;
|
|
15
15
|
readonly patterns: Protocol.Fetch.RequestPattern[];
|
|
16
16
|
/**
|
|
17
17
|
* Timestamp of the last locally served sw.js. Chrome's SW update checker
|
|
@@ -21,17 +21,6 @@ export declare class SpeedKitServiceWorkerJs implements FetchRequestPausedEventH
|
|
|
21
21
|
* OnboardingService uses this timestamp to detect and repair it.
|
|
22
22
|
*/
|
|
23
23
|
lastServedAt: number;
|
|
24
|
-
|
|
25
|
-
* The user agent the served worker should see as its own, while a device
|
|
26
|
-
* emulation is active; undefined otherwise.
|
|
27
|
-
*
|
|
28
|
-
* Speed Kit decides the device in its worker, from the request's user-agent
|
|
29
|
-
* header — which a browser never exposes there — or else from
|
|
30
|
-
* `navigator.userAgent`. A CDP override on the worker target did not change
|
|
31
|
-
* the latter, so the worker script itself says it: prepended, so it runs
|
|
32
|
-
* before any of Speed Kit's code reads it.
|
|
33
|
-
*/
|
|
34
|
-
userAgent?: string;
|
|
35
|
-
constructor(customerConfig: CustomerConfig, serviceWorker: FileInterface);
|
|
24
|
+
constructor(customerConfig: CustomerConfig, serviceWorker: FileInterface, bundle?: (serviceWorker: string) => Promise<string>);
|
|
36
25
|
handle(): Promise<Partial<Protocol.Fetch.FulfillRequestRequest>>;
|
|
37
26
|
}
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import { BaqendResponse } from "../browser/baqend-response.js";
|
|
2
|
-
/** Makes the worker report `userAgent` as its own, for an emulated device. */
|
|
3
|
-
export function userAgentPrelude(userAgent) {
|
|
4
|
-
return `/* sk onboarding browser emulate */
|
|
5
|
-
(function () {
|
|
6
|
-
try {
|
|
7
|
-
Object.defineProperty(self.navigator, "userAgent", {
|
|
8
|
-
get: function () { return ${JSON.stringify(userAgent)}; },
|
|
9
|
-
configurable: true
|
|
10
|
-
});
|
|
11
|
-
} catch (ignored) {
|
|
12
|
-
// A worker that refuses the override still runs; emulate reports it.
|
|
13
|
-
}
|
|
14
|
-
})();`;
|
|
15
|
-
}
|
|
16
2
|
/**
|
|
17
3
|
* SpeedKitServiceWorkerJs class is responsible for handling fetch requests for the SpeedKit service worker.
|
|
18
4
|
* Injects serviceWorker from local file, if custom_sw is present.
|
|
5
|
+
* With `bundle`, it serves the service worker bundled with the embedded config instead.
|
|
19
6
|
*
|
|
20
7
|
* @implements FetchRequestPausedEventHandler
|
|
21
8
|
*/
|
|
22
9
|
export class SpeedKitServiceWorkerJs {
|
|
23
10
|
customerConfig;
|
|
24
11
|
serviceWorker;
|
|
12
|
+
bundle;
|
|
25
13
|
patterns;
|
|
26
14
|
/**
|
|
27
15
|
* Timestamp of the last locally served sw.js. Chrome's SW update checker
|
|
@@ -31,20 +19,10 @@ export class SpeedKitServiceWorkerJs {
|
|
|
31
19
|
* OnboardingService uses this timestamp to detect and repair it.
|
|
32
20
|
*/
|
|
33
21
|
lastServedAt = 0;
|
|
34
|
-
|
|
35
|
-
* The user agent the served worker should see as its own, while a device
|
|
36
|
-
* emulation is active; undefined otherwise.
|
|
37
|
-
*
|
|
38
|
-
* Speed Kit decides the device in its worker, from the request's user-agent
|
|
39
|
-
* header — which a browser never exposes there — or else from
|
|
40
|
-
* `navigator.userAgent`. A CDP override on the worker target did not change
|
|
41
|
-
* the latter, so the worker script itself says it: prepended, so it runs
|
|
42
|
-
* before any of Speed Kit's code reads it.
|
|
43
|
-
*/
|
|
44
|
-
userAgent;
|
|
45
|
-
constructor(customerConfig, serviceWorker) {
|
|
22
|
+
constructor(customerConfig, serviceWorker, bundle) {
|
|
46
23
|
this.customerConfig = customerConfig;
|
|
47
24
|
this.serviceWorker = serviceWorker;
|
|
25
|
+
this.bundle = bundle;
|
|
48
26
|
this.patterns = [
|
|
49
27
|
{
|
|
50
28
|
requestStage: "Request",
|
|
@@ -53,9 +31,12 @@ export class SpeedKitServiceWorkerJs {
|
|
|
53
31
|
];
|
|
54
32
|
}
|
|
55
33
|
async handle() {
|
|
34
|
+
const serviceWorker = this.serviceWorker.getContent();
|
|
35
|
+
// shortcut: bundles on every request, about a second; cache it per config change if updates feel slow.
|
|
36
|
+
const content = this.bundle
|
|
37
|
+
? await this.bundle(serviceWorker)
|
|
38
|
+
: serviceWorker;
|
|
56
39
|
this.lastServedAt = Date.now();
|
|
57
|
-
return new BaqendResponse(
|
|
58
|
-
? `${userAgentPrelude(this.userAgent)}\n${this.serviceWorker.getContent()}`
|
|
59
|
-
: this.serviceWorker.getContent(), "text/javascript; charset=utf-8");
|
|
40
|
+
return new BaqendResponse(content, "text/javascript; charset=utf-8");
|
|
60
41
|
}
|
|
61
42
|
}
|
|
@@ -5,17 +5,6 @@ import { Cache } from "../request-cache/cache.js";
|
|
|
5
5
|
import { ConfigFileInterface, CustomerConfig, FileListInterface } from "../../integration-api/index.js";
|
|
6
6
|
import { BrowserContext } from "../onboarding-model.js";
|
|
7
7
|
import { VirtualOrestesApp } from "../virtual-orestes-app/index.js";
|
|
8
|
-
/**
|
|
9
|
-
* A rebuild asked for before the run wired its watchers.
|
|
10
|
-
*
|
|
11
|
-
* Typed rather than a bare `Error` so the control server can answer it as
|
|
12
|
-
* `NO_REBUILD` — "ask again once the page is up" is a different instruction to
|
|
13
|
-
* the caller than "the rebuild failed", and the two are indistinguishable once
|
|
14
|
-
* they are both a message string.
|
|
15
|
-
*/
|
|
16
|
-
export declare class NoRebuildContextError extends Error {
|
|
17
|
-
constructor();
|
|
18
|
-
}
|
|
19
8
|
/**
|
|
20
9
|
* Add different callbacks that will be executed if a local file is changed.
|
|
21
10
|
*/
|
|
@@ -27,8 +16,6 @@ export declare class FileWatcher {
|
|
|
27
16
|
private browserContext;
|
|
28
17
|
private cache;
|
|
29
18
|
private cacheRefresher?;
|
|
30
|
-
/** What the watchers were wired with, so a rebuild can reuse it. */
|
|
31
|
-
private rebuildContext?;
|
|
32
19
|
constructor(cli: CliServiceInterface, customerConfig: CustomerConfig, files: FileListInterface, documentHandler: DocumentHandlerServer, browserContext: BrowserContext, cache: Cache);
|
|
33
20
|
setCacheRefresher(cacheRefresher: VirtualOrestesApp): void;
|
|
34
21
|
/**
|
|
@@ -46,7 +33,7 @@ export declare class FileWatcher {
|
|
|
46
33
|
* @param page
|
|
47
34
|
* @param serviceWorkerReinstallCallback
|
|
48
35
|
*/
|
|
49
|
-
addCallbackOnFileChange(page: Page, serviceWorkerReinstallCallback: (file
|
|
36
|
+
addCallbackOnFileChange(page: Page, serviceWorkerReinstallCallback: (file: ConfigFileInterface) => Promise<void>, signal: AbortSignal): void;
|
|
50
37
|
/**
|
|
51
38
|
* changes on these files will trigger
|
|
52
39
|
* - a rebuild of the serviceWorker
|
|
@@ -83,7 +70,9 @@ export declare class FileWatcher {
|
|
|
83
70
|
*/
|
|
84
71
|
private handleDynamicStyles;
|
|
85
72
|
/**
|
|
86
|
-
* fileWatcherCallback that will reinstall the serviceWorker
|
|
73
|
+
* fileWatcherCallback that will reinstall the serviceWorker.
|
|
74
|
+
* With the `enableSpeedKitConfigPlugins` feature, the document handler embeds `config_SpeedKit`,
|
|
75
|
+
* so a change to that file also rebuilds the document handler and drops its cache.
|
|
87
76
|
*
|
|
88
77
|
* @param file
|
|
89
78
|
* @param page
|
|
@@ -92,34 +81,6 @@ export declare class FileWatcher {
|
|
|
92
81
|
* @private
|
|
93
82
|
*/
|
|
94
83
|
private onChangeServiceWorkerCallback;
|
|
95
|
-
/**
|
|
96
|
-
* The service-worker group's effects, without a file having changed.
|
|
97
|
-
*
|
|
98
|
-
* Split out of the callback above rather than reimplemented beside it: the
|
|
99
|
-
* blast radius of this group is the thing a caller is asking for when it
|
|
100
|
-
* asks for a rebuild, and a second copy of it would drift from the one the
|
|
101
|
-
* watcher actually runs — at which point `sk onboarding files rebuild` would be
|
|
102
|
-
* reproducing something the run never does.
|
|
103
|
-
*/
|
|
104
|
-
private rebuildServiceWorkerGroup;
|
|
105
|
-
/** The generic-config group's effects, without a file having changed. */
|
|
106
|
-
private rebuildDocumentHandlerGroup;
|
|
107
|
-
/**
|
|
108
|
-
* Run a rebuild group on demand, as if one of its files had changed.
|
|
109
|
-
*
|
|
110
|
-
* The groups are the run's own, so what this does to the browser and the
|
|
111
|
-
* caches is exactly what an edit to one of those files does — which is the
|
|
112
|
-
* point. It reports what it did rather than returning void, because the
|
|
113
|
-
* effects reach past the files: a documentHandler rebuild empties the
|
|
114
|
-
* dh-cache, and a caller comparing two measurements across one of these has
|
|
115
|
-
* to know that the second is against a cold cache.
|
|
116
|
-
*
|
|
117
|
-
* @returns what each group did, in the order it ran.
|
|
118
|
-
*/
|
|
119
|
-
rebuild(target: "install" | "documentHandler" | "all"): Promise<{
|
|
120
|
-
target: "install" | "documentHandler";
|
|
121
|
-
did: string[];
|
|
122
|
-
}[]>;
|
|
123
84
|
/**
|
|
124
85
|
* fileWatcherCallback that will rebuild the local documentHandler
|
|
125
86
|
*
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { safe } from "../../../helpers/safe.js";
|
|
2
|
-
import { FILE_TYPE, } from "../../integration-api/index.js";
|
|
2
|
+
import { FILE_TYPE, usesConfigPlugins, } from "../../integration-api/index.js";
|
|
3
3
|
import { INTEGRATION_FILES } from "../../../models/files.js";
|
|
4
4
|
import { race } from "../../../helpers/race.js";
|
|
5
|
-
/**
|
|
6
|
-
* A rebuild asked for before the run wired its watchers.
|
|
7
|
-
*
|
|
8
|
-
* Typed rather than a bare `Error` so the control server can answer it as
|
|
9
|
-
* `NO_REBUILD` — "ask again once the page is up" is a different instruction to
|
|
10
|
-
* the caller than "the rebuild failed", and the two are indistinguishable once
|
|
11
|
-
* they are both a message string.
|
|
12
|
-
*/
|
|
13
|
-
export class NoRebuildContextError extends Error {
|
|
14
|
-
constructor() {
|
|
15
|
-
super("this run has not wired its file watchers yet, so there are no rebuild groups to trigger — they are wired once the page is ready");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
5
|
/**
|
|
19
6
|
* Add different callbacks that will be executed if a local file is changed.
|
|
20
7
|
*/
|
|
@@ -28,8 +15,6 @@ export class FileWatcher {
|
|
|
28
15
|
// Set by OnboardingServiceFactory. When present, config changes re-warm the
|
|
29
16
|
// dh-cache in the background instead of just clearing it.
|
|
30
17
|
cacheRefresher;
|
|
31
|
-
/** What the watchers were wired with, so a rebuild can reuse it. */
|
|
32
|
-
rebuildContext;
|
|
33
18
|
constructor(cli, customerConfig, files, documentHandler, browserContext, cache) {
|
|
34
19
|
this.cli = cli;
|
|
35
20
|
this.customerConfig = customerConfig;
|
|
@@ -69,15 +54,6 @@ export class FileWatcher {
|
|
|
69
54
|
*/
|
|
70
55
|
addCallbackOnFileChange(page, serviceWorkerReinstallCallback, signal) {
|
|
71
56
|
const installResource = this.files.getByName(INTEGRATION_FILES.BUILD.INSTALL);
|
|
72
|
-
// Kept so the same groups can be triggered without a file having changed —
|
|
73
|
-
// which is what `rebuild()` is. Held rather than re-derived because the
|
|
74
|
-
// page and the reinstall callback belong to the run, and rediscovering them
|
|
75
|
-
// later would mean guessing at things the run already decided.
|
|
76
|
-
this.rebuildContext = {
|
|
77
|
-
page,
|
|
78
|
-
installResource,
|
|
79
|
-
serviceWorkerReinstallCallback,
|
|
80
|
-
};
|
|
81
57
|
this.handleServiceWorkerDependencies(page, installResource, serviceWorkerReinstallCallback, signal);
|
|
82
58
|
this.handleGenericConfigFiles(page, installResource, signal);
|
|
83
59
|
this.handleDynamicStyles(page, signal);
|
|
@@ -113,10 +89,7 @@ export class FileWatcher {
|
|
|
113
89
|
file.onChange(async (file) => {
|
|
114
90
|
const result = await safe(this.onChangeServiceWorkerCallback(file, page, installResource, serviceWorkerReinstallCallback));
|
|
115
91
|
if (result.success === false) {
|
|
116
|
-
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}
|
|
117
|
-
scope: "config",
|
|
118
|
-
data: { file: file.name, error: result.error },
|
|
119
|
-
});
|
|
92
|
+
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}`);
|
|
120
93
|
}
|
|
121
94
|
}, { signal });
|
|
122
95
|
}
|
|
@@ -150,10 +123,7 @@ export class FileWatcher {
|
|
|
150
123
|
file.onChange(async (file) => {
|
|
151
124
|
const result = await safe(this.onChangeConfigFileCallback(page, installResource, file));
|
|
152
125
|
if (result.success === false) {
|
|
153
|
-
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}
|
|
154
|
-
scope: "config",
|
|
155
|
-
data: { file: file.name, error: result.error },
|
|
156
|
-
});
|
|
126
|
+
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}`);
|
|
157
127
|
}
|
|
158
128
|
}, { signal });
|
|
159
129
|
}
|
|
@@ -178,15 +148,14 @@ export class FileWatcher {
|
|
|
178
148
|
.onChange(async (file) => {
|
|
179
149
|
const result = await safe(this.onChangeDynamicStyleCallback(file, page));
|
|
180
150
|
if (result.success === false) {
|
|
181
|
-
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}
|
|
182
|
-
scope: "config",
|
|
183
|
-
data: { file: file.name, error: result.error },
|
|
184
|
-
});
|
|
151
|
+
this.cli.writeError(`error after fileChange: ${file.name}: ${result.error}`);
|
|
185
152
|
}
|
|
186
153
|
}, { signal });
|
|
187
154
|
}
|
|
188
155
|
/**
|
|
189
|
-
* fileWatcherCallback that will reinstall the serviceWorker
|
|
156
|
+
* fileWatcherCallback that will reinstall the serviceWorker.
|
|
157
|
+
* With the `enableSpeedKitConfigPlugins` feature, the document handler embeds `config_SpeedKit`,
|
|
158
|
+
* so a change to that file also rebuilds the document handler and drops its cache.
|
|
190
159
|
*
|
|
191
160
|
* @param file
|
|
192
161
|
* @param page
|
|
@@ -195,84 +164,20 @@ export class FileWatcher {
|
|
|
195
164
|
* @private
|
|
196
165
|
*/
|
|
197
166
|
async onChangeServiceWorkerCallback(file, page, installResource, serviceWorkerReinstallCallback) {
|
|
198
|
-
this.cli.writeWarning(`changed file: ${file.name} (reinstall serviceWorker)
|
|
199
|
-
await this.rebuildServiceWorkerGroup(page, installResource, serviceWorkerReinstallCallback, file);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* The service-worker group's effects, without a file having changed.
|
|
203
|
-
*
|
|
204
|
-
* Split out of the callback above rather than reimplemented beside it: the
|
|
205
|
-
* blast radius of this group is the thing a caller is asking for when it
|
|
206
|
-
* asks for a rebuild, and a second copy of it would drift from the one the
|
|
207
|
-
* watcher actually runs — at which point `sk onboarding files rebuild` would be
|
|
208
|
-
* reproducing something the run never does.
|
|
209
|
-
*/
|
|
210
|
-
async rebuildServiceWorkerGroup(page, installResource, serviceWorkerReinstallCallback, file) {
|
|
167
|
+
this.cli.writeWarning(`changed file: ${file.name} (reinstall serviceWorker)`);
|
|
211
168
|
// clear speed-kit-service-worker-caches and uninstall serviceWorker
|
|
212
169
|
await this.safeClearPageBrowsersCacheStorage(page);
|
|
213
170
|
await this.unregisterServiceWorker(page);
|
|
171
|
+
if (file.name === INTEGRATION_FILES.CONFIG.SPEED_KIT &&
|
|
172
|
+
usesConfigPlugins(this.customerConfig)) {
|
|
173
|
+
await this.documentHandler.buildDocumentHandler();
|
|
174
|
+
this.clearOrRefreshCache(page);
|
|
175
|
+
}
|
|
214
176
|
// rebuild installResource
|
|
215
177
|
await installResource.buildContent();
|
|
216
178
|
// tell puppeteer to reinstall serviceworker on next navigate
|
|
217
179
|
await serviceWorkerReinstallCallback(file);
|
|
218
180
|
}
|
|
219
|
-
/** The generic-config group's effects, without a file having changed. */
|
|
220
|
-
async rebuildDocumentHandlerGroup(page, installResource) {
|
|
221
|
-
await this.safeClearPageBrowsersCacheStorage(page);
|
|
222
|
-
await this.documentHandler.buildDocumentHandler();
|
|
223
|
-
this.clearOrRefreshCache(page);
|
|
224
|
-
await installResource.buildContent();
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Run a rebuild group on demand, as if one of its files had changed.
|
|
228
|
-
*
|
|
229
|
-
* The groups are the run's own, so what this does to the browser and the
|
|
230
|
-
* caches is exactly what an edit to one of those files does — which is the
|
|
231
|
-
* point. It reports what it did rather than returning void, because the
|
|
232
|
-
* effects reach past the files: a documentHandler rebuild empties the
|
|
233
|
-
* dh-cache, and a caller comparing two measurements across one of these has
|
|
234
|
-
* to know that the second is against a cold cache.
|
|
235
|
-
*
|
|
236
|
-
* @returns what each group did, in the order it ran.
|
|
237
|
-
*/
|
|
238
|
-
async rebuild(target) {
|
|
239
|
-
if (!this.rebuildContext) {
|
|
240
|
-
throw new NoRebuildContextError();
|
|
241
|
-
}
|
|
242
|
-
const { page, installResource, serviceWorkerReinstallCallback } = this.rebuildContext;
|
|
243
|
-
const steps = [];
|
|
244
|
-
// documentHandler first when both are asked for. It ends by rebuilding the
|
|
245
|
-
// install resource, and so does the service-worker group — running install
|
|
246
|
-
// last means the reinstall is armed after the final build rather than
|
|
247
|
-
// before it.
|
|
248
|
-
if (target === "documentHandler" || target === "all") {
|
|
249
|
-
await this.rebuildDocumentHandlerGroup(page, installResource);
|
|
250
|
-
steps.push({
|
|
251
|
-
target: "documentHandler",
|
|
252
|
-
did: [
|
|
253
|
-
"rebuilt the local documentHandler",
|
|
254
|
-
this.cacheRefresher
|
|
255
|
-
? "cleared the dh-cache and re-warmed the open page's entries in the background"
|
|
256
|
-
: "cleared the dh-cache",
|
|
257
|
-
"cleared Speed Kit's caches in the browser",
|
|
258
|
-
"rebuilt the install resource",
|
|
259
|
-
],
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
if (target === "install" || target === "all") {
|
|
263
|
-
await this.rebuildServiceWorkerGroup(page, installResource, serviceWorkerReinstallCallback);
|
|
264
|
-
steps.push({
|
|
265
|
-
target: "install",
|
|
266
|
-
did: [
|
|
267
|
-
"cleared Speed Kit's caches in the browser",
|
|
268
|
-
"unregistered the service worker",
|
|
269
|
-
"rebuilt the install resource",
|
|
270
|
-
"armed a service-worker reinstall for the next navigation",
|
|
271
|
-
],
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
return steps;
|
|
275
|
-
}
|
|
276
181
|
/**
|
|
277
182
|
* fileWatcherCallback that will rebuild the local documentHandler
|
|
278
183
|
*
|
|
@@ -282,11 +187,11 @@ export class FileWatcher {
|
|
|
282
187
|
* @private
|
|
283
188
|
*/
|
|
284
189
|
async onChangeConfigFileCallback(page, installResource, file) {
|
|
285
|
-
this.cli.writeWarning(`changed file: ${file.name}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
await
|
|
190
|
+
this.cli.writeWarning(`changed file: ${file.name}`);
|
|
191
|
+
await this.safeClearPageBrowsersCacheStorage(page);
|
|
192
|
+
await this.documentHandler.buildDocumentHandler();
|
|
193
|
+
this.clearOrRefreshCache(page);
|
|
194
|
+
await installResource.buildContent();
|
|
290
195
|
}
|
|
291
196
|
/**
|
|
292
197
|
* fileWatcherCallback that will reinstall the serviceWorker
|
|
@@ -296,10 +201,7 @@ export class FileWatcher {
|
|
|
296
201
|
* @private
|
|
297
202
|
*/
|
|
298
203
|
async onChangeDynamicStyleCallback(file, page) {
|
|
299
|
-
this.cli.writeWarning(`changed file: ${file.name}
|
|
300
|
-
scope: "config",
|
|
301
|
-
data: { file: file.name },
|
|
302
|
-
});
|
|
204
|
+
this.cli.writeWarning(`changed file: ${file.name}`);
|
|
303
205
|
await this.documentHandler.buildDocumentHandler();
|
|
304
206
|
this.clearOrRefreshCache(page);
|
|
305
207
|
const escapedStyles = encodeURI(file.getContent());
|
|
@@ -310,7 +212,7 @@ export class FileWatcher {
|
|
|
310
212
|
if (evaluateResult.success === false &&
|
|
311
213
|
!evaluateResult.error.includes("timeout")) {
|
|
312
214
|
// The stack already starts with the message, so this is not a duplicate.
|
|
313
|
-
this.cli.writeError(evaluateResult.errorObj?.stack ?? evaluateResult.error
|
|
215
|
+
this.cli.writeError(evaluateResult.errorObj?.stack ?? evaluateResult.error);
|
|
314
216
|
}
|
|
315
217
|
}
|
|
316
218
|
/**
|
|
@@ -322,7 +224,7 @@ export class FileWatcher {
|
|
|
322
224
|
async safeClearPageBrowsersCacheStorage(page) {
|
|
323
225
|
const result = await safe(this.clearPageBrowsersCacheStorage(page));
|
|
324
226
|
if (result.success === false) {
|
|
325
|
-
this.cli.writeError(result.error
|
|
227
|
+
this.cli.writeError(result.error);
|
|
326
228
|
}
|
|
327
229
|
}
|
|
328
230
|
/**
|
|
@@ -31,7 +31,7 @@ export class InjectService {
|
|
|
31
31
|
externalSignal,
|
|
32
32
|
disconnected.signal,
|
|
33
33
|
]);
|
|
34
|
-
const browser = await launchBrowser(this.browserContext
|
|
34
|
+
const browser = await launchBrowser(this.browserContext);
|
|
35
35
|
for (const target of browser.targets()) {
|
|
36
36
|
if (target.type() === "browser") {
|
|
37
37
|
await this.fetchEventHandler.handleRequestFetchEvents(target);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { CDPSession } from "puppeteer";
|
|
1
|
+
import { CDPSession, Viewport } from "puppeteer";
|
|
2
2
|
import { Protocol } from "puppeteer-core";
|
|
3
3
|
import { AbortResponse } from "./browser/abort-response.js";
|
|
4
4
|
import { task } from "./todo-collector.js";
|
|
5
5
|
import { VanillaPuppeteer } from "puppeteer-extra";
|
|
6
6
|
import { ChromeFeatureFinding, ChromeFlagDuplicate } from "../../helpers/chrome-flags.js";
|
|
7
7
|
import { CliEnvironment } from "../cli/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { DeviceEmulation, FetchDevice } from "../browser-fetch/device-emulation.js";
|
|
9
9
|
export declare const HEADLESS_PARITY_ARGS: string[];
|
|
10
10
|
declare const HEADLESS_DEFAULT_ARGS_TO_DROP: string[];
|
|
11
11
|
export { HEADLESS_DEFAULT_ARGS_TO_DROP };
|
|
12
|
-
/**
|
|
13
|
-
export
|
|
12
|
+
/** A device as `--device` emulates it: always with a viewport, also for the desktop. */
|
|
13
|
+
export type BrowserDeviceEmulation = DeviceEmulation & {
|
|
14
|
+
viewport: Viewport;
|
|
15
|
+
};
|
|
14
16
|
export declare const BROWSER_EVENTS: {
|
|
15
17
|
DISCONNECTED: string;
|
|
16
18
|
FETCH_AUTH_REQUIRED: string;
|
|
@@ -53,12 +55,7 @@ export declare class BrowserContext {
|
|
|
53
55
|
readonly browserArgs: string[];
|
|
54
56
|
readonly chromePath: string;
|
|
55
57
|
/** The device of `--device`, or undefined to leave Chrome as it launches. */
|
|
56
|
-
readonly emulation?:
|
|
57
|
-
/**
|
|
58
|
-
* Switches the touch of `--device` on every page, set by `emulateDevice`. Only the CDP session
|
|
59
|
-
* that turned Chrome's mouse-to-touch translation on can keep it off across a navigation.
|
|
60
|
-
*/
|
|
61
|
-
setDeviceTouch?: (touch: boolean) => Promise<void>;
|
|
58
|
+
readonly emulation?: BrowserDeviceEmulation;
|
|
62
59
|
constructor(domain: string, browserVersionString?: string, chromeFlags?: string[], environment?: CliEnvironment, userAgent?: string, debuggingPort?: boolean, headless?: boolean, debugPort?: number, device?: FetchDevice);
|
|
63
60
|
/**
|
|
64
61
|
* The user agent is a launch flag rather than only a CDP override on purpose: a per-page
|
|
@@ -189,39 +186,9 @@ export interface LocalCacheError {
|
|
|
189
186
|
stack: string | null;
|
|
190
187
|
occurredAt: number;
|
|
191
188
|
}
|
|
192
|
-
/**
|
|
193
|
-
* What a run command is doing to this browser right now.
|
|
194
|
-
*
|
|
195
|
-
* Read by the devtools extension, which turns the tab strip red while it is
|
|
196
|
-
* active — see `lib/agent-tab-state.ts` there. Additive to the union on
|
|
197
|
-
* purpose: an extension too old to know the id ignores it, so the protocol
|
|
198
|
-
* version does not move.
|
|
199
|
-
*/
|
|
200
|
-
export interface AgentActivity {
|
|
201
|
-
active: boolean;
|
|
202
|
-
/** The sharpest thing installed — `sk debug` over `sk inject (3)`. */
|
|
203
|
-
label: string | null;
|
|
204
|
-
/** ISO, when it became active. */
|
|
205
|
-
since?: string;
|
|
206
|
-
/**
|
|
207
|
-
* The breakpoints `sk onboarding debug` has armed, in its 1–4 numbering.
|
|
208
|
-
*
|
|
209
|
-
* The CLI sets the page's sessionStorage flags directly and the extension's
|
|
210
|
-
* injector reads them, so the pause already lands in the right place without
|
|
211
|
-
* this. The panel is the part that needs telling: its switches are backed by
|
|
212
|
-
* extension storage rather than read back from the page, deliberately —
|
|
213
|
-
* an `inspectedWindow.eval` during a navigation races the document swap and
|
|
214
|
-
* queues behind a paused JS thread, which is exactly what an armed
|
|
215
|
-
* breakpoint produces.
|
|
216
|
-
*/
|
|
217
|
-
breakpoints?: number[];
|
|
218
|
-
}
|
|
219
189
|
export type DevelopmentToolsMessage = {
|
|
220
190
|
id: "skCli";
|
|
221
191
|
data: SkCliInfo;
|
|
222
|
-
} | {
|
|
223
|
-
id: "agent";
|
|
224
|
-
data: AgentActivity;
|
|
225
192
|
} | {
|
|
226
193
|
id: "athena";
|
|
227
194
|
data: AthenaInfo;
|
|
@@ -3,7 +3,7 @@ import { buildHeadedUserAgent } from "./browser/executable/headed-user-agent.js"
|
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { defaultArgs } from "puppeteer";
|
|
5
5
|
import { findChromeFeatureFindings, findDuplicateChromeFlags, isFeatureListFlag, mergeChromeFeatureFlags, } from "../../helpers/chrome-flags.js";
|
|
6
|
-
import {
|
|
6
|
+
import { DEVICE_VIEWPORTS, deviceEmulation, } from "../browser-fetch/device-emulation.js";
|
|
7
7
|
const DEFAULT_BROWSER_ARGS = [
|
|
8
8
|
// No `Translate`: Chrome's translate code has no feature of that name, and Puppeteer disables it anyway.
|
|
9
9
|
"--enable-features=NetworkService",
|
|
@@ -37,10 +37,12 @@ const HEADLESS_DEFAULT_ARGS_TO_DROP = [
|
|
|
37
37
|
"--hide-scrollbars",
|
|
38
38
|
];
|
|
39
39
|
export { HEADLESS_DEFAULT_ARGS_TO_DROP };
|
|
40
|
+
/** `--device desktop` presents Chrome on Windows, the most common Chrome desktop in RUM (60%). */
|
|
41
|
+
const DESKTOP_PLATFORM = "win32";
|
|
40
42
|
/** Room next to an emulated viewport for the DevTools panel that `devtools: true` docks in headed mode. */
|
|
41
43
|
const DEVTOOLS_GUTTER = 520;
|
|
42
44
|
/** What Chrome reports for a touchscreen phone or tablet. */
|
|
43
|
-
|
|
45
|
+
const MAX_TOUCH_POINTS = 5;
|
|
44
46
|
export const BROWSER_EVENTS = {
|
|
45
47
|
DISCONNECTED: "disconnected",
|
|
46
48
|
FETCH_AUTH_REQUIRED: "Fetch.authRequired",
|
|
@@ -84,11 +86,6 @@ export class BrowserContext {
|
|
|
84
86
|
chromePath;
|
|
85
87
|
/** The device of `--device`, or undefined to leave Chrome as it launches. */
|
|
86
88
|
emulation;
|
|
87
|
-
/**
|
|
88
|
-
* Switches the touch of `--device` on every page, set by `emulateDevice`. Only the CDP session
|
|
89
|
-
* that turned Chrome's mouse-to-touch translation on can keep it off across a navigation.
|
|
90
|
-
*/
|
|
91
|
-
setDeviceTouch;
|
|
92
89
|
constructor(domain, browserVersionString = "unknown", chromeFlags, environment, userAgent, debuggingPort = false, headless = false, debugPort = 9222, device) {
|
|
93
90
|
this.domain = domain;
|
|
94
91
|
this.browserVersionString = browserVersionString;
|
|
@@ -113,7 +110,10 @@ export class BrowserContext {
|
|
|
113
110
|
browserArguments.push(`--user-data-dir=${temporaryProfileDirectory}`);
|
|
114
111
|
}
|
|
115
112
|
if (device) {
|
|
116
|
-
this.emulation =
|
|
113
|
+
this.emulation = {
|
|
114
|
+
...deviceEmulation(browserVersionString, device, DESKTOP_PLATFORM),
|
|
115
|
+
viewport: DEVICE_VIEWPORTS[device],
|
|
116
|
+
};
|
|
117
117
|
}
|
|
118
118
|
this.userAgent ??=
|
|
119
119
|
this.emulation?.userAgent ??
|
|
@@ -230,8 +230,7 @@ export class BrowserContext {
|
|
|
230
230
|
/** Args that depend on how Chrome is launched, added after the customer's chromeFlags. */
|
|
231
231
|
getLaunchOnlyArgs() {
|
|
232
232
|
const args = [];
|
|
233
|
-
|
|
234
|
-
if (this.debuggingPort) {
|
|
233
|
+
if (this.debuggingPort || this.headless) {
|
|
235
234
|
args.push(`--remote-debugging-port=${this.debugPort}`);
|
|
236
235
|
// Puppeteer adds the pipe switch for `pipe: true` only when no other
|
|
237
236
|
// `--remote-debugging-*` switch is present, and it refuses
|
|
@@ -254,16 +253,6 @@ export class BrowserContext {
|
|
|
254
253
|
...this.getLaunchOnlyArgs(),
|
|
255
254
|
...this.getSystemChromeFlags(),
|
|
256
255
|
]),
|
|
257
|
-
// Puppeteer installs its own signal handlers by default, and its SIGINT
|
|
258
|
-
// one is `this.kill(); process.exit(130)` — a bare exit, out from under
|
|
259
|
-
// whatever the CLI was doing. That would skip the run's status stamp, the
|
|
260
|
-
// control-socket unlink and the cache teardown, all of which live in the
|
|
261
|
-
// `finally` of `commands/onboarding.ts`. The command registers its own
|
|
262
|
-
// handlers before the browser launches and owns shutdown; the browser
|
|
263
|
-
// closes as part of it.
|
|
264
|
-
handleSIGINT: false,
|
|
265
|
-
handleSIGTERM: false,
|
|
266
|
-
handleSIGHUP: false,
|
|
267
256
|
// Strip Puppeteer's default `--enable-automation` so Chrome doesn't show
|
|
268
257
|
// the "Chrome is being controlled by automated test software" infobar.
|
|
269
258
|
ignoreDefaultArgs: [
|