Skip to content

Commit

Permalink
block all base tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome committed Dec 18, 2024
1 parent 4add10f commit 96678ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/replay-internal/src/util/getPrivacyOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getOption(selectors: string[], defaultSelectors: string[]): string {
* Returns privacy related configuration for use in rrweb
*/
export function getPrivacyOptions({ mask, unmask, block, unblock, ignore }: GetPrivacyOptions): GetPrivacyReturn {
const defaultBlockedElements = ['base[href="/"]', 'iframe[srcdoc]:not([src])'];
const defaultBlockedElements = ['base', 'iframe[srcdoc]:not([src])'];

const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]']);
const unmaskSelector = getOption(unmask, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Integration | integrationSettings', () => {
const { replay } = await mockSdk({ replayOptions: { blockAllMedia: false } });

expect(replay['_recordingOptions'].blockSelector).toBe(
'.sentry-block,[data-sentry-block],base[href="/"],iframe[srcdoc]:not([src])',
'.sentry-block,[data-sentry-block],base,iframe[srcdoc]:not([src])',
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/replay-internal/test/integration/rrweb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Integration | rrweb', () => {
});
expect(mockRecord.mock.calls[0]?.[0]).toMatchInlineSnapshot(`
{
"blockSelector": ".sentry-block,[data-sentry-block],base[href="/"],iframe[srcdoc]:not([src]),img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]",
"blockSelector": ".sentry-block,[data-sentry-block],base,iframe[srcdoc]:not([src]),img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]",
"collectFonts": true,
"emit": [Function],
"errorHandler": [Function],
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('Integration | rrweb', () => {

expect(mockRecord.mock.calls[0]?.[0]).toMatchInlineSnapshot(`
{
"blockSelector": ".sentry-block,[data-sentry-block],base[href="/"],iframe[srcdoc]:not([src]),img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]",
"blockSelector": ".sentry-block,[data-sentry-block],base,iframe[srcdoc]:not([src]),img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]",
"checkoutEveryNms": 360000,
"collectFonts": true,
"emit": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Unit | util | getPrivacyOptions', () => {
}),
).toMatchInlineSnapshot(`
{
"blockSelector": ".custom-block,.sentry-block,[data-sentry-block],base[href="/"],iframe[srcdoc]:not([src])",
"blockSelector": ".custom-block,.sentry-block,[data-sentry-block],base,iframe[srcdoc]:not([src])",
"ignoreSelector": ".custom-ignore,.sentry-ignore,[data-sentry-ignore],input[type="file"]",
"maskTextSelector": ".custom-mask,.sentry-mask,[data-sentry-mask]",
"unblockSelector": ".custom-unblock",
Expand Down

0 comments on commit 96678ed

Please sign in to comment.