seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.45k stars 908 forks source link

(UC Mode) `sb.open_new_window()` leads to "Enhanced ad privacy in Chrome" pop-up #2823

Closed mdmintz closed 4 weeks ago

mdmintz commented 4 weeks ago

(UC Mode) sb.open_new_window() leads to "Enhanced ad privacy in Chrome" pop-up

Screenshot 2024-06-03 at 12 43 04 PM

Currently, open_new_window() calls driver.switch_to.new_window("tab") to open a new window and switch to it, but that leads to the issue. Easy to get around that by using driver.execute_script("window.open('');") instead, and then calling sb.switch_to_newest_window() after that. sb.open_new_window() can be modified to use the execute_script way in UC Mode to avoid the issue.