Selenium-Requests icon indicating copy to clipboard operation
Selenium-Requests copied to clipboard

Popup blocker can inhibit window.open

Open elliotbrack opened this issue 2 years ago • 1 comments

There seems to be a bug where selenium-requests will hang trying to acquire the mutex from the web server.

The root cause of this is that the popup blocker inhibits the window.open JavaScript code.

This is at least a problem when trying to combine it with undetected-chromedriver, see ultrafunkamsterdam/undetected-chromedriver#380, but I would suspect that it can also trigger in other cases.

To fix it, one approach is to do:

opts = ChromeOptions()
opts.add_argument('--disable-popup-blocking')
driver = MyCustomWebDriver(options=opts)

It's possible that there are other approaches too, such as selectively toggling it while still blocking other popups, or using another method to open a tab - someone suggests driver.tab_new(url) in the issue I linked above.

elliotbrack avatar Feb 16 '22 17:02 elliotbrack

Can anyone else confirm that this fixes the issue for them too?

cryzed avatar Feb 18 '22 22:02 cryzed