Skip to content

Commit 5a61290

Browse files
fix: Enhance error suppression for Publift Fuse and race conditions (#659)
Co-authored-by: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com> Co-authored-by: Tanner Linsley <[email protected]>
1 parent 83f656f commit 5a61290

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/Gam.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const GamScripts = () => (
6161
// Add global error handler to suppress Publift Fuse cross-origin errors
6262
// These errors occur in iOS Safari due to strict Same-Origin Policy enforcement
6363
// when the ad viewability script tries to access parent window properties
64+
// Also suppress race condition errors during navigation
6465
(function() {
6566
var originalErrorHandler = window.onerror;
6667
window.onerror = function(message, source, lineno, colno, error) {
@@ -69,15 +70,18 @@ export const GamScripts = () => (
6970
source && (
7071
source.includes('/media/native/') ||
7172
source.includes('fuse.js') ||
72-
source.includes('fuseplatform.net')
73+
source.includes('fuseplatform.net') ||
74+
source.includes('/nobid/blocking_script.js')
7375
) && (
7476
(message && typeof message === 'string' && (
7577
message.includes('contextWindow.parent') ||
76-
message.includes('null is not an object')
78+
message.includes('null is not an object') ||
79+
message.includes('is not a function')
7780
)) ||
7881
(error && error.message && (
7982
error.message.includes('contextWindow.parent') ||
80-
error.message.includes('null is not an object')
83+
error.message.includes('null is not an object') ||
84+
error.message.includes('is not a function')
8185
))
8286
)
8387
) {

0 commit comments

Comments
 (0)