diff --git a/packages/core/src/config.js b/packages/core/src/config.js index 68d090244..2162c690d 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -459,7 +459,8 @@ export const snapshotSchema = { type: 'array', items: { type: 'string' } }, - cookies: { type: 'string' }, + cookies: { oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }] }, + userAgent: { type: 'string' }, width: { $ref: '/config/snapshot#/properties/widths/items' }, resources: { type: 'array', diff --git a/packages/core/src/discovery.js b/packages/core/src/discovery.js index d03d89200..3a1036dbb 100644 --- a/packages/core/src/discovery.js +++ b/packages/core/src/discovery.js @@ -69,6 +69,11 @@ function debugSnapshotOptions(snapshot) { debugProp(snapshot, 'clientInfo'); debugProp(snapshot, 'environmentInfo'); debugProp(snapshot, 'domSnapshot', Boolean); + if (snapshot.responsiveSnapshotCapture) { + debugProp(snapshot, 'domSnapshot.0.userAgent'); + } else { + debugProp(snapshot, 'domSnapshot.userAgent'); + } for (let added of (snapshot.additionalSnapshots || [])) { log.debug(`Additional snapshot: ${added.name}`, snapshot.meta); diff --git a/packages/dom/src/serialize-dom.js b/packages/dom/src/serialize-dom.js index 0402d6d69..b800d01a6 100644 --- a/packages/dom/src/serialize-dom.js +++ b/packages/dom/src/serialize-dom.js @@ -117,6 +117,7 @@ export function serializeDOM(options) { let result = { html: serializeHTML(ctx), cookies: cookies, + userAgent: navigator.userAgent, warnings: Array.from(ctx.warnings), resources: Array.from(ctx.resources), hints: Array.from(ctx.hints)