Skip to content

Commit 07372de

Browse files
fix: security
1 parent 6a6656b commit 07372de

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/source/tests/page-recipe/oauth-page-recipe.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ export class OauthPageRecipe extends PageRecipe {
2121
}
2222
// Check if it's an Error object with a message property
2323
if (e instanceof Error) {
24-
return e.message.includes('Navigating frame was detached');
24+
return e.message.includes('Navigating frame was detached') || e.message.includes('frame was detached');
2525
}
26-
// Fallback: convert to string and check (for non-Error objects)
27-
const errorStr = e.toString();
28-
return errorStr.includes('Navigating frame was detached') || errorStr.includes('frame was detached');
26+
// Check if it's already a string
27+
if (typeof e === 'string') {
28+
return e.includes('Navigating frame was detached') || e.includes('frame was detached');
29+
}
30+
// For other types, we can't reliably check - return false to be safe
31+
return false;
2932
}
3033

3134
/**

0 commit comments

Comments
 (0)