Skip to content

Commit 4de63c8

Browse files
authored
Merge pull request #4418 from seleniumbase/fix-brave-and-opera
Fix Brave and Opera automation
2 parents e6a60b8 + f4353ef commit 4de63c8

6 files changed

Lines changed: 42 additions & 14 deletions

File tree

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
regex>=2026.6.28
55
pymdown-extensions>=10.21.3
6-
pipdeptree>=3.1.0
6+
pipdeptree>=3.1.1
77
python-dateutil>=2.8.2
88
click>=8.4.2
99
Markdown==3.10.2

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ exceptiongroup>=1.3.1
1010
websockets~=15.0.1;python_version<"3.10"
1111
websockets>=16.0;python_version>="3.10"
1212
filelock~=3.19.1;python_version<"3.10"
13-
filelock>=3.29.4;python_version>="3.10"
13+
filelock>=3.29.5;python_version>="3.10"
1414
fasteners>=0.20
1515
mycdp>=1.4.0
1616
pynose>=1.5.5
1717
platformdirs~=4.4.0;python_version<"3.10"
1818
platformdirs>=4.10.0;python_version>="3.10"
19-
typing-extensions>=4.15.0
19+
typing-extensions>=4.16.0
2020
sbvirtualdisplay>=1.4.0
2121
MarkupSafe>=3.0.3
2222
Jinja2>=3.1.6
@@ -61,7 +61,8 @@ pytest-html==4.0.2
6161
pytest-metadata==3.1.1
6262
pytest-ordering==0.6
6363
pytest-rerunfailures==16.0.1;python_version<"3.10"
64-
pytest-rerunfailures==16.3;python_version>="3.10"
64+
pytest-rerunfailures==16.3;python_version=="3.10"
65+
pytest-rerunfailures==16.4;python_version>="3.11"
6566
pytest-xdist==3.8.0
6667
parameterized==0.9.0
6768
behave==1.2.6
@@ -79,7 +80,7 @@ rich>=15.0.0,<16
7980
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
8081

8182
coverage>=7.10.7;python_version<"3.10"
82-
coverage>=7.14.3;python_version>="3.10"
83+
coverage>=7.15.0;python_version>="3.10"
8384
pytest-cov>=7.1.0
8485
flake8==7.3.0
8586
mccabe==0.7.0

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.50.4"
2+
__version__ = "4.50.5"

seleniumbase/core/browser_launcher.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,13 @@ def _set_chrome_options(
28162816
d_f_string = ",".join(included_disabled_features)
28172817
chrome_options.add_argument("--disable-features=%s" % d_f_string)
28182818
chrome_options.add_argument("--enable-unsafe-extension-debugging")
2819-
chrome_options.add_argument("--test-type")
2819+
if (
2820+
hasattr(sb_config, "_cdp_browser")
2821+
and sb_config._cdp_browser == "brave"
2822+
):
2823+
pass # Looks like "--test-type" breaks Brave now
2824+
else:
2825+
chrome_options.add_argument("--test-type")
28202826
if proxy_auth or sb_config._ext_dirs:
28212827
if not is_using_uc(undetectable, browser_name):
28222828
chrome_options.add_argument("--remote-debugging-pipe")
@@ -3120,6 +3126,11 @@ def get_driver(
31203126
if browser_name in constants.ChromiumSubs.chromium_subs:
31213127
browser_name = "chrome"
31223128
browser_name = browser_name.lower()
3129+
if (
3130+
hasattr(sb_config, "_cdp_browser")
3131+
and sb_config._cdp_browser == "brave"
3132+
):
3133+
undetectable = True
31233134
if is_using_uc(undetectable, browser_name):
31243135
if ad_block_on:
31253136
sb_config.ad_block_on = True
@@ -5146,6 +5157,13 @@ def get_local_driver(
51465157
sb_config.multi_proxy = True
51475158
if uc_driver_version and driver_version == "keep":
51485159
driver_version = uc_driver_version
5160+
if (
5161+
hasattr(sb_config, "_cdp_browser")
5162+
and sb_config._cdp_browser == "opera"
5163+
):
5164+
use_version = "132"
5165+
if use_uc:
5166+
use_version = "144"
51495167
use_version = find_chromedriver_version_to_use(
51505168
use_version, driver_version
51515169
)

seleniumbase/undetected/cdp_driver/config.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import tempfile
99
import zipfile
1010
from contextlib import suppress
11+
from seleniumbase import config as sb_config
1112
from seleniumbase.config import settings
1213
from seleniumbase.drivers import cft_drivers
1314
from seleniumbase.drivers import chromium_drivers
@@ -238,12 +239,10 @@ def __init__(
238239
"--enable-privacy-sandbox-ads-apis",
239240
"--safebrowsing-disable-download-protection",
240241
'--simulate-outdated-no-au="Tue, 31 Dec 2099 23:59:59 GMT"',
241-
"--test-type",
242242
"--ash-no-nudges",
243243
"--password-store=basic",
244244
"--deny-permission-prompts",
245245
"--disable-breakpad",
246-
"--disable-setuid-sandbox",
247246
"--disable-prompt-on-repost",
248247
"--disable-application-cache",
249248
"--disable-password-generation",
@@ -262,6 +261,15 @@ def __init__(
262261
"--disable-renderer-backgrounding",
263262
"--disable-dev-shm-usage",
264263
]
264+
if (
265+
hasattr(sb_config, "_cdp_browser")
266+
and sb_config._cdp_browser == "brave"
267+
):
268+
pass # Looks like "--test-type" breaks Brave now
269+
else:
270+
self._default_browser_args.append("--test-type")
271+
if IS_LINUX:
272+
self._default_browser_args.append("--disable-setuid-sandbox")
265273
if mock_keychain:
266274
self._default_browser_args.append("--use-mock-keychain")
267275

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@
174174
'websockets~=15.0.1;python_version<"3.10"',
175175
'websockets>=16.0;python_version>="3.10"',
176176
'filelock~=3.19.1;python_version<"3.10"',
177-
'filelock>=3.29.4;python_version>="3.10"',
177+
'filelock>=3.29.5;python_version>="3.10"',
178178
'fasteners>=0.20',
179179
'mycdp>=1.4.0',
180180
'pynose>=1.5.5',
181181
'platformdirs~=4.4.0;python_version<"3.10"',
182182
'platformdirs>=4.10.0;python_version>="3.10"',
183-
'typing-extensions>=4.15.0',
183+
'typing-extensions>=4.16.0',
184184
'sbvirtualdisplay>=1.4.0',
185185
'MarkupSafe>=3.0.3',
186186
'Jinja2>=3.1.6',
@@ -225,7 +225,8 @@
225225
'pytest-metadata==3.1.1',
226226
'pytest-ordering==0.6',
227227
'pytest-rerunfailures==16.0.1;python_version<"3.10"',
228-
'pytest-rerunfailures==16.3;python_version>="3.10"',
228+
'pytest-rerunfailures==16.3;python_version=="3.10"',
229+
'pytest-rerunfailures==16.4;python_version>="3.11"',
229230
'pytest-xdist==3.8.0',
230231
'parameterized==0.9.0',
231232
'behave==1.2.6', # Newer ones had issues
@@ -252,7 +253,7 @@
252253
# Usage: coverage run -m pytest; coverage html; coverage report
253254
"coverage": [
254255
'coverage>=7.10.7;python_version<"3.10"',
255-
'coverage>=7.14.3;python_version>="3.10"',
256+
'coverage>=7.15.0;python_version>="3.10"',
256257
'pytest-cov>=7.1.0',
257258
],
258259
# pip install -e .[flake8]
@@ -282,7 +283,7 @@
282283
# (An optional library for image-processing.)
283284
"pillow": [
284285
'Pillow>=11.3.0;python_version<"3.10"',
285-
'Pillow>=12.2.0;python_version>="3.10"',
286+
'Pillow>=12.3.0;python_version>="3.10"',
286287
],
287288
# pip install -e .[pip-system-certs]
288289
# (If you see [SSL: CERTIFICATE_VERIFY_FAILED], then get this.)

0 commit comments

Comments
 (0)