Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 109842b

Browse files
authored
Merge pull request #2837 from seleniumbase/options-refactoring
Refactor Chromium options
2 parents bbf8299 + 0fd6223 commit 109842b

File tree

2 files changed

+31
-43
lines changed

2 files changed

+31
-43
lines changed

‎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.27.3"
2+
__version__ = "4.27.4"

‎seleniumbase/core/browser_launcher.py

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,31 +1166,24 @@ def _set_chrome_options(
11661166
chrome_options.add_argument("--no-crash-upload")
11671167
chrome_options.add_argument("--deny-permission-prompts")
11681168
included_disabled_features = []
1169+
included_disabled_features.append("OptimizationHints")
1170+
included_disabled_features.append("OptimizationHintsFetching")
1171+
included_disabled_features.append("Translate")
1172+
included_disabled_features.append("OptimizationTargetPrediction")
1173+
included_disabled_features.append("OptimizationGuideModelDownloading")
1174+
included_disabled_features.append("DownloadBubble")
1175+
included_disabled_features.append("DownloadBubbleV2")
1176+
included_disabled_features.append("InsecureDownloadWarnings")
1177+
included_disabled_features.append("InterestFeedContentSuggestions")
11691178
if user_data_dir:
1170-
included_disabled_features.append("OptimizationHintsFetching")
1171-
included_disabled_features.append("Translate")
1172-
included_disabled_features.append("OptimizationTargetPrediction")
11731179
included_disabled_features.append("PrivacySandboxSettings4")
1174-
included_disabled_features.append("DownloadBubble")
1175-
included_disabled_features.append("DownloadBubbleV2")
1176-
included_disabled_features.append("InsecureDownloadWarnings")
1177-
for item in extra_disabled_features:
1178-
if item not in included_disabled_features:
1179-
included_disabled_features.append(item)
1180-
d_f_string = ",".join(included_disabled_features)
1181-
chrome_options.add_argument("--disable-features=%s" % d_f_string)
1182-
else:
1183-
included_disabled_features.append("OptimizationHintsFetching")
1184-
included_disabled_features.append("Translate")
1185-
included_disabled_features.append("OptimizationTargetPrediction")
1186-
included_disabled_features.append("DownloadBubble")
1187-
included_disabled_features.append("DownloadBubbleV2")
1188-
included_disabled_features.append("InsecureDownloadWarnings")
1189-
for item in extra_disabled_features:
1190-
if item not in included_disabled_features:
1191-
included_disabled_features.append(item)
1192-
d_f_string = ",".join(included_disabled_features)
1193-
chrome_options.add_argument("--disable-features=%s" % d_f_string)
1180+
if not is_using_uc(undetectable, browser_name) or user_data_dir:
1181+
included_disabled_features.append("SidePanelPinning")
1182+
for item in extra_disabled_features:
1183+
if item not in included_disabled_features:
1184+
included_disabled_features.append(item)
1185+
d_f_string = ",".join(included_disabled_features)
1186+
chrome_options.add_argument("--disable-features=%s" % d_f_string)
11941187
if (
11951188
is_using_uc(undetectable, browser_name)
11961189
and (
@@ -2828,27 +2821,22 @@ def get_local_driver(
28282821
if disable_features:
28292822
extra_disabled_features.extend(disable_features.split(","))
28302823
included_disabled_features = []
2824+
included_disabled_features.append("OptimizationHints")
2825+
included_disabled_features.append("OptimizationHintsFetching")
2826+
included_disabled_features.append("Translate")
2827+
included_disabled_features.append("OptimizationTargetPrediction")
2828+
included_disabled_features.append("OptimizationGuideModelDownloading")
2829+
included_disabled_features.append("InsecureDownloadWarnings")
2830+
included_disabled_features.append("InterestFeedContentSuggestions")
28312831
if user_data_dir:
2832-
included_disabled_features.append("OptimizationHintsFetching")
2833-
included_disabled_features.append("Translate")
2834-
included_disabled_features.append("OptimizationTargetPrediction")
28352832
included_disabled_features.append("PrivacySandboxSettings4")
2836-
included_disabled_features.append("InsecureDownloadWarnings")
2837-
for item in extra_disabled_features:
2838-
if item not in included_disabled_features:
2839-
included_disabled_features.append(item)
2840-
d_f_string = ",".join(included_disabled_features)
2841-
edge_options.add_argument("--disable-features=%s" % d_f_string)
2842-
else:
2843-
included_disabled_features.append("OptimizationHintsFetching")
2844-
included_disabled_features.append("Translate")
2845-
included_disabled_features.append("OptimizationTargetPrediction")
2846-
included_disabled_features.append("InsecureDownloadWarnings")
2847-
for item in extra_disabled_features:
2848-
if item not in included_disabled_features:
2849-
included_disabled_features.append(item)
2850-
d_f_string = ",".join(included_disabled_features)
2851-
edge_options.add_argument("--disable-features=%s" % d_f_string)
2833+
if not is_using_uc(undetectable, browser_name) or user_data_dir:
2834+
included_disabled_features.append("SidePanelPinning")
2835+
for item in extra_disabled_features:
2836+
if item not in included_disabled_features:
2837+
included_disabled_features.append(item)
2838+
d_f_string = ",".join(included_disabled_features)
2839+
edge_options.add_argument("--disable-features=%s" % d_f_string)
28522840
if (set_binary or IS_LINUX) and not binary_location:
28532841
br_app = "edge"
28542842
binary_loc = detect_b_ver.get_binary_location(br_app)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /