2

I need to disable a pop-up on a site, because it's causing PhantomJSDriver to crash.

The options are:

  1. Block any pop-up from opening

  2. Disable JavaScript entirely, so the pop-up won't load (which seems not to be possible as mentioned here)

  3. Override that specific JavaScript function which loads the pop-up.

So... How to block pop-ups in PhantomJSDriver?

ss1
  • 1,009
  • 15
  • 32

1 Answers1

1

Overwriting the function setInterval and setTimeout could be a way to achieve this. I would expect a popup to be a pretty long timeout, like many seconds so you could redirect it to the read timeout function if shorter, or cancel it if longer.

Viewing all the timouts/intervals in javascript?

FlorianB
  • 2,188
  • 18
  • 30