1

I'm using the opn package to open a url in my browser. I need to close that window after some time from the node service. How do I achieve that using opn?

I tried with node-horseman. I can't use that more than once, however. If I try, I get an issue in the second horseman like

Unhandled rejection HeadlessError: Phantom Process died  

I need to close the opened windows through the service. How do I solve this? Can anyone help me out?

And my horseman code is,

horseMan
    .open('http://localhost:4000/next?port=3000')
    .log('Checking the next course...')
    .close();  

Thanks in advance.

Raisus
  • 148
  • 3
  • 23
Prabha
  • 29
  • 7
  • Hi @prabha, did you ever figure this out? I'd like to know too. – mcheah Jul 23 '18 at 17:28
  • Hi @prabha - if you've figured this out, could you let us know? I'm stuck too. I also spell-checked and restructured your question to make it understandable to english-readers. If I have changed anything drastic, feel free to undo my changes, – Raisus Aug 01 '18 at 10:15
  • @mcheah, I hope you didn't have issue with this till now. Sorry for the late response. Instead of opening the window, I use request module to get the result which I expect. And I didn't solved it coz of module change. – Prabha Aug 07 '18 at 06:58
  • Thanks @Raisus, I updated :-). – Prabha Aug 07 '18 at 07:03

0 Answers0