Skip to content

Instantly share code, notes, and snippets.

@MikeCook9994
Created January 22, 2017 22:50
Show Gist options
  • Save MikeCook9994/c80d56bc142c42fcb04d2c4e7a49855f to your computer and use it in GitHub Desktop.
Save MikeCook9994/c80d56bc142c42fcb04d2c4e7a49855f to your computer and use it in GitHub Desktop.
import Nightmare from 'nightmare'
let nightmare = new Nightmare();
Nightmare.action('enableRequestListener',
(name, options, parent, win, renderer, done) => {
parent.respondTo('enableRequestListener', (done) => {
win.webContents.session.defaultSession.webRequest.onCompleted({}, (details) => {
});
});
done();
},
(done) => { this.child.call('enableRequestListener', done); }
);
nightmare
.goto(FACEBOOK_AUTHENTICATION_TOKEN_URL)
.type("#email", email)
.type("#pass", password)
.click("#loginbutton")
.wait("button[name='__CONFIRM__']")
.enableRequestListener()
.click("button[name='__CONFIRM__']")
.end()
.catch((e) => { console.log(e) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment