Closed josephrocca closed 7 years ago
Please search for existing issues before creating a new one, see: https://github.com/segmentio/nightmare/issues/856
Ah, thanks. Sorry about that
For the benefit of those who arrive here via search, there's another thread here with potential workarounds until this is solved: https://github.com/segmentio/nightmare/issues/1018
Closing this as a dupe of #856
To put it briefly, I've got an electron project and I'd like to use nightmare instances within this project. Is this possible? Currently I'm using a
<webview>
tag and ipc to do all my automation but it's a bit of a mess and nightmare is just so sleek in comparison so I'm hoping this is possible.For context, the reason I'm using electron is because it's really easy to display the results of test and scrapes live and I can use libraries like chart.js rather than just
console.log
ing messages.So far as I understand, nightmare just uses an electron
BrowserWindow
under the hood, so this should be quite easy? But I guess nightmare tries to create a whole new electron instance rather than just a BrowserWindow and the main electron instance doesn't like that? If that's the case, is there a way to tell a new nightmarejs instance that there's already an electron instance running, and to pass it a reference so it doesn't try create a new one?My most minimal test was just:
That works fine with
node .
, but running it withelectron .
doesn't work - it just outputs 'starting' to the console.Thanks!