nightmare-window-manager
nightmare-window-manager copied to clipboard
popup windows are sometimes visible
(from https://github.com/segmentio/nightmare/issues/804)
I need to access new window from nightmare and manipulate it as I do in main window. Is that even possible?
nightmare
.goto('http://website.com/')
.click('button[id="mybutton"]') // this actually opens new window/tab whatever.
.type('input[type="text"]', 'hello world') // I want this to happen on new window, how?
.then(function () { console.log('all done'); })
.catch(function (err) { console.log(err); });
basic html:
<button id="mybutton" onclick="javascript:window.open('http://website.com/', '_blank');">click me</button>
<input type="text"></input>
EDIT: Don't get me wrong, I've searched same questions here, but isn't there any workaround? If not, can I just block opening new window and load the new page into the current one?
EDIT2: I've noticed, that if you specify show: false
opening new tab/window is shown by default. Any thoughts about this? It's getting annoying though.
I'm interested in solving this issue as well. When trying to capture a popup ad's URL, even though nightmare is set to run with show: false
, any popup windows that are opened as a result of a click (e.g a popup ad), temporarily opens a new window with show: true
. I couldn't find anything helpful in the nightmare issues, and dug into electron's BrowserWindow
settings as well, but was unsuccessful.
It works fine on MacOS but on Ubuntu Linux using xvfb
, nightmare just hangs when it comes across a popup window. My guess is that it's not supporting new windows?
Would appreciate any help/advice.
i am waiting this workground
I am waiting for a workaround for this as well.
I am also waiting for a workaround for the solution for this issue
+1 from my side. it will be cool to handle it ;)
me too
+1
+1