These are chat archives for rosshinkley/nightmare

Apr 2017
Vladimir Milenko
Apr 17 2017 18:11 UTC
Hi guys!
Can someone help me? I want to keep nightmare running forever :D
Apr 17 2017 19:19 UTC
@VladimirMilenko I believe the electron process will stay up until you call end on it. Not sure if that's helpful but probably need more information about your particular use case to give more details
Vladimir Milenko
Apr 17 2017 19:20 UTC
@johnferro I need to launch some page which connects via WS to some server and makes tons of screenshots. So what i need - is to keep nightmare process alive
Now looks like i've solved by calling wait with 0 ms, but without calling end. So it throws unhandled promise, but stays alive
Apr 17 2017 19:42 UTC
@VladimirMilenko Ok, glad you found something that works for you. For future reference I don't think the wait is strictly required. For example, if you run the following script you should see the electron window remain open until the node process is explicitly killed.
var Nightmare = require('nightmare');
var nightmare = Nightmare({ show: true});

  .type('#search_form_input_homepage', 'github nightmare')
  .wait('#zero_click_wrapper .c-info__title a')
  .evaluate(function () {
    return document.querySelector('#zero_click_wrapper .c-info__title a').href;
  .then(function (result) {
  .catch(function (error) {
    console.error('Search failed:', error);