Skip to content

Instantly share code, notes, and snippets.

@AamuLumi
Created June 5, 2017 10:36
Show Gist options
  • Save AamuLumi/ba4b927ce5d7f45f15fd9c0e1e399a30 to your computer and use it in GitHub Desktop.
Save AamuLumi/ba4b927ce5d7f45f15fd9c0e1e399a30 to your computer and use it in GitHub Desktop.
Nightmare action to remove downloads in a Nightmare scenario
Nightmare.action('removeDownload',
function(ns, options, parent, win, renderer, done) {
parent.respondTo('removeDownload', function(subDone) {
win.webContents.session.on('will-download', (event, item, webContents) => {
// Remove download event
event.preventDefault();
});
subDone(null);
});
done(null);
},
function(done) {
this.child.call('removeDownload', done);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment