(err, data)
| 294 | } |
| 295 | |
| 296 | function cleanup(err, data) { |
| 297 | clearTimeout(timer) |
| 298 | win.webContents.removeListener('did-fail-load', handleFailure) |
| 299 | win.webContents.removeListener( |
| 300 | 'did-fail-provisional-load', |
| 301 | handleFailure |
| 302 | ) |
| 303 | win.webContents.removeListener( |
| 304 | 'did-get-response-details', |
| 305 | handleDetails |
| 306 | ) |
| 307 | win.webContents.removeListener('dom-ready', handleDomReady) |
| 308 | win.webContents.removeListener('did-finish-load', handleFinish) |
| 309 | setIsReady(true) |
| 310 | // wait a tick before notifying to resolve race conditions for events |
| 311 | setImmediate(() => done(err, data)) |
| 312 | } |
| 313 | |
| 314 | // In most environments, loadURL handles this logic for us, but in some |
| 315 | // it just hangs for unhandled protocols. Mitigate by checking ourselves. |
no test coverage detected