diff --git a/.size-limit.js b/.size-limit.js index c6e86836fd4c..157c1243021e 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -54,7 +54,7 @@ module.exports = [ path: 'packages/browser/build/npm/esm/index.js', import: createImport('init', 'browserTracingIntegration', 'replayIntegration'), gzip: true, - limit: '68 KB', + limit: '70 KB', modifyWebpackConfig: function (config) { const webpack = require('webpack'); const TerserPlugin = require('terser-webpack-plugin'); diff --git a/packages/replay-internal/src/integration.ts b/packages/replay-internal/src/integration.ts index c2a9206feb0d..4ec1a357eac4 100644 --- a/packages/replay-internal/src/integration.ts +++ b/packages/replay-internal/src/integration.ts @@ -150,6 +150,8 @@ export class Replay implements Integration { // this can happen if the error is frozen or does not allow mutation for other reasons } }, + // experimental support for recording iframes from different origins + recordCrossOriginIframes: Boolean(_experiments.recordCrossOriginIframes), }; this._initialOptions = { diff --git a/packages/replay-internal/src/types/replay.ts b/packages/replay-internal/src/types/replay.ts index 280db17db57a..cc8e6f1827ac 100644 --- a/packages/replay-internal/src/types/replay.ts +++ b/packages/replay-internal/src/types/replay.ts @@ -229,6 +229,11 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions { captureExceptions: boolean; traceInternals: boolean; continuousCheckout: number; + /** + * Before enabling, please read the security considerations: + * https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/cross-origin-iframes.md#considerations + */ + recordCrossOriginIframes: boolean; autoFlushOnFeedback: boolean; }>; } diff --git a/packages/replay-internal/src/types/rrweb.ts b/packages/replay-internal/src/types/rrweb.ts index 60e562cadf55..33f5e1b3bf7f 100644 --- a/packages/replay-internal/src/types/rrweb.ts +++ b/packages/replay-internal/src/types/rrweb.ts @@ -43,6 +43,7 @@ export type RrwebRecordOptions = { maskTextSelector?: string; blockSelector?: string; maskInputOptions?: Record; + recordCrossOriginIframes?: boolean; } & Record; export interface CanvasManagerInterface { diff --git a/packages/replay-internal/test/integration/rrweb.test.ts b/packages/replay-internal/test/integration/rrweb.test.ts index 7f156c542f08..0e6ada8b0d2a 100644 --- a/packages/replay-internal/test/integration/rrweb.test.ts +++ b/packages/replay-internal/test/integration/rrweb.test.ts @@ -40,6 +40,7 @@ describe('Integration | rrweb', () => { "maskTextFn": undefined, "maskTextSelector": ".sentry-mask,[data-sentry-mask]", "onMutation": [Function], + "recordCrossOriginIframes": false, "slimDOMOptions": "all", "unblockSelector": "", "unmaskTextSelector": "", @@ -80,6 +81,7 @@ describe('Integration | rrweb', () => { "maskTextFn": undefined, "maskTextSelector": ".sentry-mask,[data-sentry-mask]", "onMutation": [Function], + "recordCrossOriginIframes": false, "slimDOMOptions": "all", "unblockSelector": "", "unmaskTextSelector": "", @@ -131,6 +133,7 @@ describe('Integration | rrweb', () => { "maskTextFn": undefined, "maskTextSelector": ".sentry-mask,[data-sentry-mask]", "onMutation": [Function], + "recordCrossOriginIframes": false, "sampling": { "mousemove": false, },