MCPcopy
hub / github.com/segment-boneyard/nightmare / cleanup

Function cleanup

lib/runner.js:296–312  ·  view source on GitHub ↗
(err, data)

Source from the content-addressed store, hash-verified

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.

Callers 3

runner.jsFile · 0.85
handleFailureFunction · 0.85
handleFinishFunction · 0.85

Calls 2

setIsReadyFunction · 0.85
doneFunction · 0.70

Tested by

no test coverage detected