Skip to content

Commit cec15f0

Browse files
authored
Refine ad script error suppression logic
1 parent 5f28e78 commit cec15f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/router.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ export function getRouter() {
8787
errorMessage.includes('null is not an object') ||
8888
errorMessage.includes('is not a function')
8989

90-
if (hasAdScriptFrame && hasExpectedErrorMessage) {
90+
// Some ad script errors (e.g. Publift Fuse cross-origin iframe errors) have
91+
// highly specific message patterns that identify them unambiguously, even when
92+
// the stack trace has been obscured by Sentry's sentryWrapped helper and no
93+
// ad-script frame is visible. Suppress these directly by message alone.
94+
const isUnambiguousAdScriptError =
95+
errorMessage.includes('window.top.document') ||
96+
errorMessage.includes('isPlacementXdom')
97+
98+
if (isUnambiguousAdScriptError || (hasAdScriptFrame && hasExpectedErrorMessage)) {
9199
// Suppress the error - log to console in debug mode
92100
console.debug(
93101
'Suppressed Publift Fuse/ad script error:',

0 commit comments

Comments
 (0)