Skip to content

Commit

Permalink
fix: refactor & added jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr committed Nov 28, 2024
1 parent bd9516f commit c7368b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion apps/kyb-app/src/common/utils/is-iframe.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Determines if the current window is running within an iframe.
* Handles both same-origin and cross-origin iframe scenarios.
*
* @returns {boolean} True if running in an iframe (including cross-origin), false otherwise
*/
export const isIframe = (): boolean => {
try {
// Check if window.self and window.top are the same reference
Expand All @@ -10,7 +16,7 @@ export const isIframe = (): boolean => {
}

return isFramed;
} catch (e) {
} catch (e: unknown) {
// If we get a security error, we're definitely in a cross-origin iframe
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations

0 comments on commit c7368b0

Please sign in to comment.