()
| 176 | let unloadHandler: (() => void) | null = null; |
| 177 | |
| 178 | const cleanup = () => { |
| 179 | if (cleanedUp) return; |
| 180 | cleanedUp = true; |
| 181 | observer?.disconnect(); |
| 182 | if (intervalId !== null) { |
| 183 | session.ownerWindow.clearInterval(intervalId); |
| 184 | } |
| 185 | if (unloadHandler) { |
| 186 | popupWindow.removeEventListener("beforeunload", unloadHandler); |
| 187 | popupWindow.removeEventListener("unload", unloadHandler); |
| 188 | } |
| 189 | session.popupCleanups.delete(cleanup); |
| 190 | session.popupOpened = false; |
| 191 | maybeCleanupSession(session, "popup closed"); |
| 192 | }; |
| 193 | |
| 194 | const scanPopup = () => { |
| 195 | if (popupWindow.closed) { |
no test coverage detected