(popup: Window | null)
| 141 | |
| 142 | /** Close the popup window if it's still open. Swallows cross-origin errors. */ |
| 143 | const closePopup = (popup: Window | null) => { |
| 144 | if (!popup) return; |
| 145 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: cross-origin popup state can throw and cleanup is best-effort |
| 146 | try { |
| 147 | if (!popup.closed) popup.close(); |
| 148 | } catch { |
| 149 | // Cross-origin access can throw; safe to ignore. |
| 150 | } |
| 151 | }; |
| 152 | |
| 153 | const settle = () => { |
| 154 | if (settled) return; |