diff --git a/packages/core/src/config.js b/packages/core/src/config.js index ce1d5bef0..ade14bcf7 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -167,6 +167,10 @@ export const configSchema = { disableCache: { type: 'boolean' }, + captureServiceWorker: { + type: 'boolean', + default: false + }, requestHeaders: { type: 'object', normalize: false, @@ -249,6 +253,7 @@ export const snapshotSchema = { requestHeaders: { $ref: '/config/discovery#/properties/requestHeaders' }, authorization: { $ref: '/config/discovery#/properties/authorization' }, disableCache: { $ref: '/config/discovery#/properties/disableCache' }, + captureServiceWorker: { $ref: '/config/discovery#/properties/captureServiceWorker' }, userAgent: { $ref: '/config/discovery#/properties/userAgent' }, devicePixelRatio: { $ref: '/config/discovery#/properties/devicePixelRatio' } } diff --git a/packages/core/src/discovery.js b/packages/core/src/discovery.js index b0e4ca885..8856003be 100644 --- a/packages/core/src/discovery.js +++ b/packages/core/src/discovery.js @@ -52,6 +52,7 @@ function debugSnapshotOptions(snapshot) { debugProp(snapshot, 'discovery.requestHeaders', JSON.stringify); debugProp(snapshot, 'discovery.authorization', JSON.stringify); debugProp(snapshot, 'discovery.disableCache'); + debugProp(snapshot, 'discovery.captureServiceWorker'); debugProp(snapshot, 'discovery.userAgent'); debugProp(snapshot, 'clientInfo'); debugProp(snapshot, 'environmentInfo'); diff --git a/packages/core/src/snapshot.js b/packages/core/src/snapshot.js index a739f4ec9..0a5459852 100644 --- a/packages/core/src/snapshot.js +++ b/packages/core/src/snapshot.js @@ -114,6 +114,7 @@ function getSnapshotOptions(options, { config, meta }) { requestHeaders: config.discovery.requestHeaders, authorization: config.discovery.authorization, disableCache: config.discovery.disableCache, + captureServiceWorker: config.discovery.captureServiceWorker, userAgent: config.discovery.userAgent } }, options], (path, prev, next) => { diff --git a/packages/core/types/index.d.ts b/packages/core/types/index.d.ts index 79b170316..3753fb25c 100644 --- a/packages/core/types/index.d.ts +++ b/packages/core/types/index.d.ts @@ -18,6 +18,7 @@ interface DiscoveryOptions { authorization?: AuthCredentials; allowedHostnames?: string[]; disableCache?: boolean; + captureServiceWorker?: boolean; } interface DiscoveryLaunchOptions {