nightmare-window-manager icon indicating copy to clipboard operation
nightmare-window-manager copied to clipboard

popup windows are sometimes visible

Open rosshinkley opened this issue 8 years ago • 8 comments

(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.

rosshinkley avatar Jan 02 '17 21:01 rosshinkley

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.

calvinl avatar Apr 27 '17 19:04 calvinl

i am waiting this workground

webjohnjiang avatar May 30 '17 15:05 webjohnjiang

I am waiting for a workaround for this as well.

celdridge8 avatar Jan 09 '18 18:01 celdridge8

I am also waiting for a workaround for the solution for this issue

ImHype avatar Mar 06 '18 10:03 ImHype

+1 from my side. it will be cool to handle it ;)

ghost avatar Dec 12 '18 07:12 ghost

me too

t1ber1u avatar Jan 24 '19 19:01 t1ber1u

+1

vlink3000 avatar Dec 04 '19 15:12 vlink3000

+1

TheTechChild avatar Aug 14 '20 16:08 TheTechChild