These are chat archives for rosshinkley/nightmare

Apr 2017
Andrew Guenther
Apr 13 2017 00:16
Curiosity question, why does Nightmare use Electron rather than communicating with a Chrome instance via the debugging protocol (through for example)
Apr 13 2017 14:02
@AndrewGuenther From my understanding (I wasn't using it then) nightmare started out using phantomjs and then switched to electron. I'd assume this switch was more straightforward than switching to chrome. The biggest reason might have been because both phantomjs and electron support a headless mode while chrome did not
Although that could be something to discuss now that chrome headless is becoming a thing
Apr 13 2017 14:38
Hi there. Is it possible to have some kind of interactivity in nightmare scripts?
browser.goto(url).if(predicate, then(browser), else(browser)).end()
something like that
@rosshinkley : what do you think about that?
Apr 13 2017 14:56
Or maybe an optional argument to not release the electron process when calling end()
if the process survive to end(), i could enqueue others operations based on the result of any evaluate() call
Apr 13 2017 17:08
Ok, response to myself: it's possible to return different promise in a then() function, and then to have a if-then-else pattern
Ilya Borovitinov
Apr 13 2017 21:06
Hey guys, new user here. Is it possible to duplicate all page console.log to my node console?

I tried

.on('console', function (type, args) {
    // console.log(`${type}`, args)

and it didn't seem to work

Doesn't even print 'test'
Ilya Borovitinov
Apr 13 2017 21:39
Ok, it works
Ilya Borovitinov
Apr 13 2017 21:53
Another question. Is there any way I could pass preload script any info?