Skip to content

Commit 94a4e9d

Browse files
fix: Extend ad network error suppression
1 parent 3595979 commit 94a4e9d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/Gam.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,21 @@ export const GamScripts = () => (
5858
<script
5959
dangerouslySetInnerHTML={{
6060
__html: `
61-
// Add global error handler to suppress Publift Fuse cross-origin errors
61+
// Add global error handler to suppress ad network cross-origin errors
6262
// These errors occur in iOS Safari due to strict Same-Origin Policy enforcement
63-
// when the ad viewability script tries to access parent window properties
63+
// when the ad viewability scripts try to access parent window properties
6464
// Also suppress race condition errors during navigation
6565
(function() {
6666
var originalErrorHandler = window.onerror;
6767
window.onerror = function(message, source, lineno, colno, error) {
68-
// Check if this is a Publift Fuse cross-origin error
68+
// Check if this is an ad network cross-origin error
6969
if (
7070
source && (
7171
source.includes('/media/native/') ||
7272
source.includes('fuse.js') ||
7373
source.includes('fuseplatform.net') ||
74-
source.includes('/nobid/blocking_script.js')
74+
source.includes('/nobid/blocking_script.js') ||
75+
source.includes('adform.net')
7576
) && (
7677
(message && typeof message === 'string' && (
7778
message.includes('contextWindow.parent') ||
@@ -86,7 +87,7 @@ export const GamScripts = () => (
8687
)
8788
) {
8889
// Suppress the error - log to console in debug mode
89-
console.debug('Suppressed Publift Fuse cross-origin error:', message, source);
90+
console.debug('Suppressed ad network cross-origin error:', message, source);
9091
return true; // Prevent default error handling
9192
}
9293
// Call original error handler for other errors

0 commit comments

Comments
 (0)