()
| 9 | |
| 10 | useEffect(() => { |
| 11 | const detectIframe = () => { |
| 12 | try { |
| 13 | return window.self !== window.top |
| 14 | } catch (e) { |
| 15 | // If we can't access window.top due to cross-origin restrictions, |
| 16 | // we're likely in an iframe |
| 17 | return true |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | const isInIframe = detectIframe() |
| 22 | setIsInIframe(isInIframe) |
no outgoing calls
no test coverage detected