Skip to content

Commit a0be1a5

Browse files
dgavranicbillyvg
andauthored
feat(replay): Expose rrweb recordCrossOriginIframes under _experiments (#14916)
Closes #14809. I have tested this with my project and it sort of works. While it's not perfect (sometimes produces an unplayable replay), it might unblock other users looking to experiment with this feature. Verify: - [ ] If you've added code that should be tested, please add tests. - [x] Ensure your code lints and the test suite passes (`yarn lint`) & (`yarn test`). This just exposes the API under experiments, as such I don't think it requires tests. --------- Co-authored-by: Billy Vong <billyvg@users.noreply.github.com>
1 parent adca0f5 commit a0be1a5

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

packages/replay-internal/src/integration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ export class Replay implements Integration {
150150
// this can happen if the error is frozen or does not allow mutation for other reasons
151151
}
152152
},
153+
// experimental support for recording iframes from different origins
154+
recordCrossOriginIframes: Boolean(_experiments.recordCrossOriginIframes),
153155
};
154156

155157
this._initialOptions = {

packages/replay-internal/src/types/replay.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions {
229229
captureExceptions: boolean;
230230
traceInternals: boolean;
231231
continuousCheckout: number;
232+
/**
233+
* Before enabling, please read the security considerations:
234+
* https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/cross-origin-iframes.md#considerations
235+
*/
236+
recordCrossOriginIframes: boolean;
232237
autoFlushOnFeedback: boolean;
233238
}>;
234239
}

packages/replay-internal/src/types/rrweb.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export type RrwebRecordOptions = {
4343
maskTextSelector?: string;
4444
blockSelector?: string;
4545
maskInputOptions?: Record<string, boolean>;
46+
recordCrossOriginIframes?: boolean;
4647
} & Record<string, unknown>;
4748

4849
export interface CanvasManagerInterface {

packages/replay-internal/test/integration/rrweb.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('Integration | rrweb', () => {
4040
"maskTextFn": undefined,
4141
"maskTextSelector": ".sentry-mask,[data-sentry-mask]",
4242
"onMutation": [Function],
43+
"recordCrossOriginIframes": false,
4344
"slimDOMOptions": "all",
4445
"unblockSelector": "",
4546
"unmaskTextSelector": "",
@@ -80,6 +81,7 @@ describe('Integration | rrweb', () => {
8081
"maskTextFn": undefined,
8182
"maskTextSelector": ".sentry-mask,[data-sentry-mask]",
8283
"onMutation": [Function],
84+
"recordCrossOriginIframes": false,
8385
"slimDOMOptions": "all",
8486
"unblockSelector": "",
8587
"unmaskTextSelector": "",
@@ -131,6 +133,7 @@ describe('Integration | rrweb', () => {
131133
"maskTextFn": undefined,
132134
"maskTextSelector": ".sentry-mask,[data-sentry-mask]",
133135
"onMutation": [Function],
136+
"recordCrossOriginIframes": false,
134137
"sampling": {
135138
"mousemove": false,
136139
},

0 commit comments

Comments
 (0)