osn-selenium 0.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osn_selenium/__init__.py +1 -0
- osn_selenium/browsers_handler/__init__.py +70 -0
- osn_selenium/browsers_handler/_windows.py +130 -0
- osn_selenium/browsers_handler/types.py +20 -0
- osn_selenium/captcha_workers/__init__.py +26 -0
- osn_selenium/dev_tools/__init__.py +1 -0
- osn_selenium/dev_tools/_types.py +22 -0
- osn_selenium/dev_tools/domains/__init__.py +63 -0
- osn_selenium/dev_tools/domains/abstract.py +378 -0
- osn_selenium/dev_tools/domains/fetch.py +1295 -0
- osn_selenium/dev_tools/domains_default/__init__.py +1 -0
- osn_selenium/dev_tools/domains_default/fetch.py +155 -0
- osn_selenium/dev_tools/errors.py +89 -0
- osn_selenium/dev_tools/logger.py +558 -0
- osn_selenium/dev_tools/manager.py +1551 -0
- osn_selenium/dev_tools/utils.py +509 -0
- osn_selenium/errors.py +16 -0
- osn_selenium/types.py +118 -0
- osn_selenium/webdrivers/BaseDriver/__init__.py +1 -0
- osn_selenium/webdrivers/BaseDriver/_utils.py +37 -0
- osn_selenium/webdrivers/BaseDriver/flags.py +644 -0
- osn_selenium/webdrivers/BaseDriver/protocols.py +2135 -0
- osn_selenium/webdrivers/BaseDriver/trio_wrapper.py +71 -0
- osn_selenium/webdrivers/BaseDriver/webdriver.py +2626 -0
- osn_selenium/webdrivers/Blink/__init__.py +1 -0
- osn_selenium/webdrivers/Blink/flags.py +1349 -0
- osn_selenium/webdrivers/Blink/protocols.py +330 -0
- osn_selenium/webdrivers/Blink/webdriver.py +637 -0
- osn_selenium/webdrivers/Chrome/__init__.py +1 -0
- osn_selenium/webdrivers/Chrome/flags.py +192 -0
- osn_selenium/webdrivers/Chrome/protocols.py +228 -0
- osn_selenium/webdrivers/Chrome/webdriver.py +394 -0
- osn_selenium/webdrivers/Edge/__init__.py +1 -0
- osn_selenium/webdrivers/Edge/flags.py +192 -0
- osn_selenium/webdrivers/Edge/protocols.py +228 -0
- osn_selenium/webdrivers/Edge/webdriver.py +394 -0
- osn_selenium/webdrivers/Yandex/__init__.py +1 -0
- osn_selenium/webdrivers/Yandex/flags.py +192 -0
- osn_selenium/webdrivers/Yandex/protocols.py +211 -0
- osn_selenium/webdrivers/Yandex/webdriver.py +350 -0
- osn_selenium/webdrivers/__init__.py +1 -0
- osn_selenium/webdrivers/_functions.py +504 -0
- osn_selenium/webdrivers/js_scripts/check_element_in_viewport.js +18 -0
- osn_selenium/webdrivers/js_scripts/get_document_scroll_size.js +4 -0
- osn_selenium/webdrivers/js_scripts/get_element_css.js +6 -0
- osn_selenium/webdrivers/js_scripts/get_element_rect_in_viewport.js +9 -0
- osn_selenium/webdrivers/js_scripts/get_random_element_point_in_viewport.js +59 -0
- osn_selenium/webdrivers/js_scripts/get_viewport_position.js +4 -0
- osn_selenium/webdrivers/js_scripts/get_viewport_rect.js +6 -0
- osn_selenium/webdrivers/js_scripts/get_viewport_size.js +4 -0
- osn_selenium/webdrivers/js_scripts/open_new_tab.js +1 -0
- osn_selenium/webdrivers/js_scripts/stop_window_loading.js +1 -0
- osn_selenium/webdrivers/types.py +390 -0
- osn_selenium-0.0.0.dist-info/METADATA +710 -0
- osn_selenium-0.0.0.dist-info/RECORD +57 -0
- osn_selenium-0.0.0.dist-info/WHEEL +5 -0
- osn_selenium-0.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1349 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
from typing import (
|
|
3
|
+
Any,
|
|
4
|
+
Optional,
|
|
5
|
+
TypedDict,
|
|
6
|
+
Union
|
|
7
|
+
)
|
|
8
|
+
from osn_selenium.webdrivers.BaseDriver.flags import (
|
|
9
|
+
BrowserArguments,
|
|
10
|
+
BrowserAttributes,
|
|
11
|
+
BrowserExperimentalOptions,
|
|
12
|
+
BrowserFlagsManager
|
|
13
|
+
)
|
|
14
|
+
from osn_selenium.webdrivers.types import (
|
|
15
|
+
AutoplayPolicyType,
|
|
16
|
+
FlagDefinition,
|
|
17
|
+
FlagNotDefined,
|
|
18
|
+
FlagType,
|
|
19
|
+
LogLevelType,
|
|
20
|
+
UseGLType,
|
|
21
|
+
_blink_webdriver_option_type
|
|
22
|
+
)
|
|
23
|
+
from osn_selenium.webdrivers._functions import (
|
|
24
|
+
bool_adding_validation_function,
|
|
25
|
+
build_first_start_argument,
|
|
26
|
+
int_adding_validation_function,
|
|
27
|
+
optional_bool_adding_validation_function,
|
|
28
|
+
path_adding_validation_function,
|
|
29
|
+
str_adding_validation_function
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class BlinkExperimentalOptions(BrowserExperimentalOptions, total=False):
|
|
34
|
+
"""
|
|
35
|
+
Typed dictionary for experimental options specific to Blink-based browsers.
|
|
36
|
+
|
|
37
|
+
Attributes:
|
|
38
|
+
debugger_address (Optional[str]): The address (IP:port) of the remote debugger.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
debugger_address: Optional[str]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class BlinkFeatures(TypedDict, total=False):
|
|
45
|
+
"""
|
|
46
|
+
Typed dictionary for Blink-specific feature flags.
|
|
47
|
+
|
|
48
|
+
These flags control experimental or internal features within the Blink rendering engine.
|
|
49
|
+
|
|
50
|
+
Attributes:
|
|
51
|
+
calculate_native_win_occlusion (Optional[bool]): Controls native window occlusion calculation.
|
|
52
|
+
accept_ch_frame (Optional[bool]): Enables/disables Accept-CH frame.
|
|
53
|
+
avoid_unload_check_sync (Optional[bool]): Avoids synchronous unload checks.
|
|
54
|
+
bfcache_feature (Optional[bool]): Controls the Back-Forward Cache feature.
|
|
55
|
+
heavy_ad_mitigations (Optional[bool]): Enables/disables heavy ad mitigations.
|
|
56
|
+
isolate_origins (Optional[bool]): Controls origin isolation.
|
|
57
|
+
lazy_frame_loading (Optional[bool]): Enables/disables lazy frame loading.
|
|
58
|
+
script_streaming (Optional[bool]): Controls script streaming.
|
|
59
|
+
global_media_controls (Optional[bool]): Enables/disables global media controls.
|
|
60
|
+
improved_cookie_controls (Optional[bool]): Enables/disables improved cookie controls.
|
|
61
|
+
privacy_sandbox_settings4 (Optional[bool]): Controls Privacy Sandbox settings (version 4).
|
|
62
|
+
media_router (Optional[bool]): Enables/disables media router.
|
|
63
|
+
autofill_server_comm (Optional[bool]): Controls autofill server communication.
|
|
64
|
+
cert_transparency_updater (Optional[bool]): Controls certificate transparency updater.
|
|
65
|
+
optimization_hints (Optional[bool]): Enables/disables optimization hints.
|
|
66
|
+
dial_media_route_provider (Optional[bool]): Controls DIAL media route provider.
|
|
67
|
+
paint_holding (Optional[bool]): Enables/disables paint holding.
|
|
68
|
+
destroy_profile_on_browser_close (Optional[bool]): Destroys user profile on browser close.
|
|
69
|
+
site_per_process (Optional[bool]): Enforces site isolation (site-per-process model).
|
|
70
|
+
automation_controlled (Optional[bool]): Indicates if the browser is controlled by automation.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
calculate_native_win_occlusion: Optional[bool]
|
|
74
|
+
accept_ch_frame: Optional[bool]
|
|
75
|
+
avoid_unload_check_sync: Optional[bool]
|
|
76
|
+
bfcache_feature: Optional[bool]
|
|
77
|
+
heavy_ad_mitigations: Optional[bool]
|
|
78
|
+
isolate_origins: Optional[bool]
|
|
79
|
+
lazy_frame_loading: Optional[bool]
|
|
80
|
+
script_streaming: Optional[bool]
|
|
81
|
+
global_media_controls: Optional[bool]
|
|
82
|
+
improved_cookie_controls: Optional[bool]
|
|
83
|
+
privacy_sandbox_settings4: Optional[bool]
|
|
84
|
+
media_router: Optional[bool]
|
|
85
|
+
autofill_server_comm: Optional[bool]
|
|
86
|
+
cert_transparency_updater: Optional[bool]
|
|
87
|
+
optimization_hints: Optional[bool]
|
|
88
|
+
dial_media_route_provider: Optional[bool]
|
|
89
|
+
paint_holding: Optional[bool]
|
|
90
|
+
destroy_profile_on_browser_close: Optional[bool]
|
|
91
|
+
site_per_process: Optional[bool]
|
|
92
|
+
automation_controlled: Optional[bool]
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class BlinkAttributes(BrowserAttributes, total=False):
|
|
96
|
+
"""
|
|
97
|
+
Typed dictionary for WebDriver attributes specific to Blink-based browsers.
|
|
98
|
+
|
|
99
|
+
Attributes:
|
|
100
|
+
enable_bidi (Optional[bool]): Enables/disables BiDi (Bidirectional) protocol mapper.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
pass
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class BlinkArguments(BrowserArguments, total=False):
|
|
107
|
+
"""
|
|
108
|
+
Typed dictionary for command-line arguments specific to Blink-based browsers.
|
|
109
|
+
|
|
110
|
+
Attributes:
|
|
111
|
+
se_downloads_enabled (bool): Enables/disables Selenium downloads.
|
|
112
|
+
headless_mode (bool): Runs the browser in headless mode (without a UI).
|
|
113
|
+
mute_audio (bool): Mutes audio output from the browser.
|
|
114
|
+
no_first_run (bool): Prevents the browser from showing the "first run" experience.
|
|
115
|
+
disable_background_timer_throttling (bool): Disables throttling of background timers.
|
|
116
|
+
disable_backgrounding_occluded_windows (bool): Prevents backgrounding of occluded windows.
|
|
117
|
+
disable_hang_monitor (bool): Disables the browser's hang monitor.
|
|
118
|
+
disable_ipc_flooding_protection (bool): Disables IPC flooding protection.
|
|
119
|
+
disable_renderer_backgrounding (bool): Prevents renderer processes from being backgrounded.
|
|
120
|
+
disable_back_forward_cache (bool): Disables the Back-Forward Cache.
|
|
121
|
+
disable_notifications (bool): Disables web notifications.
|
|
122
|
+
disable_popup_blocking (bool): Disables the built-in popup blocker.
|
|
123
|
+
disable_prompt_on_repost (bool): Disables the prompt when reposting form data.
|
|
124
|
+
disable_sync (bool): Disables browser synchronization features.
|
|
125
|
+
disable_background_networking (bool): Disables background network activity.
|
|
126
|
+
disable_breakpad (bool): Disables the crash reporter.
|
|
127
|
+
disable_component_update (bool): Disables component updates.
|
|
128
|
+
disable_domain_reliability (bool): Disables domain reliability monitoring.
|
|
129
|
+
disable_new_content_rendering_timeout (bool): Disables timeout for new content rendering.
|
|
130
|
+
disable_threaded_animation (bool): Disables threaded animation.
|
|
131
|
+
disable_threaded_scrolling (bool): Disables threaded scrolling.
|
|
132
|
+
disable_checker_imaging (bool): Disables checker imaging.
|
|
133
|
+
disable_image_animation_resync (bool): Disables image animation resynchronization.
|
|
134
|
+
disable_partial_raster (bool): Disables partial rasterization.
|
|
135
|
+
disable_skia_runtime_opts (bool): Disables Skia runtime optimizations.
|
|
136
|
+
disable_dev_shm_usage (bool): Disables the use of /dev/shm (important for Docker).
|
|
137
|
+
disable_gpu (bool): Disables GPU hardware acceleration.
|
|
138
|
+
aggressive_cache_discard (bool): Enables aggressive discarding of cached data.
|
|
139
|
+
allow_running_insecure_content (bool): Allows running insecure content on HTTPS pages.
|
|
140
|
+
no_process_per_site (bool): Runs all sites in a single process (less secure, but saves memory).
|
|
141
|
+
enable_precise_memory_info (bool): Enables precise memory information reporting.
|
|
142
|
+
use_fake_device_for_media_stream (bool): Uses a fake camera/microphone for media streams.
|
|
143
|
+
use_fake_ui_for_media_stream (bool): Uses a fake UI for media stream requests.
|
|
144
|
+
deny_permission_prompts (bool): Automatically denies all permission prompts.
|
|
145
|
+
disable_external_intent_requests (bool): Disables external intent requests.
|
|
146
|
+
noerrdialogs (bool): Suppresses error dialogs.
|
|
147
|
+
enable_automation (bool): Enables automation features.
|
|
148
|
+
test_type (bool): Sets the browser to test mode.
|
|
149
|
+
remote_debugging_pipe (bool): Uses a pipe for remote debugging instead of a port.
|
|
150
|
+
silent_debugger_extension_api (bool): Silences debugger extension API warnings.
|
|
151
|
+
enable_logging_stderr (bool): Enables logging to stderr.
|
|
152
|
+
password_store_basic (bool): Uses a basic password store.
|
|
153
|
+
use_mock_keychain (bool): Uses a mock keychain for testing.
|
|
154
|
+
enable_crash_reporter_for_testing (bool): Enables crash reporter for testing purposes.
|
|
155
|
+
metrics_recording_only (bool): Records metrics without sending them.
|
|
156
|
+
no_pings (bool): Disables sending pings.
|
|
157
|
+
allow_pre_commit_input (bool): Allows pre-commit input.
|
|
158
|
+
deterministic_mode (bool): Runs the browser in a more deterministic mode.
|
|
159
|
+
run_all_compositor_stages_before_draw (bool): Runs all compositor stages before drawing.
|
|
160
|
+
enable_begin_frame_control (bool): Enables begin frame control.
|
|
161
|
+
in_process_gpu (bool): Runs the GPU process in-process.
|
|
162
|
+
block_new_web_contents (bool): Blocks new web contents (e.g., pop-ups).
|
|
163
|
+
new_window (bool): Opens a new window instead of a new tab.
|
|
164
|
+
no_service_autorun (bool): Disables service autorun.
|
|
165
|
+
process_per_tab (bool): Runs each tab in its own process.
|
|
166
|
+
single_process (bool): Runs the browser in a single process (less stable).
|
|
167
|
+
no_sandbox (bool): Disables the sandbox (less secure, but can fix some issues).
|
|
168
|
+
user_agent (Optional[str]): Sets a custom user agent string.
|
|
169
|
+
user_data_dir (Optional[str]): Specifies the user data directory.
|
|
170
|
+
proxy_server (Optional[str]): Specifies a proxy server to use.
|
|
171
|
+
remote_debugging_port (Optional[int]): Specifies the remote debugging port.
|
|
172
|
+
remote_debugging_address (Optional[str]): Specifies the remote debugging address.
|
|
173
|
+
use_file_for_fake_video_capture (Optional[Union[str, pathlib.Path]]): Uses a file for fake video capture.
|
|
174
|
+
autoplay_policy (Optional[AutoplayPolicyType]): Sets the autoplay policy.
|
|
175
|
+
log_level (Optional[LogLevelType]): Sets the browser's log level.
|
|
176
|
+
use_gl (Optional[UseGLType]): Specifies the GL backend to use.
|
|
177
|
+
force_color_profile (Optional[str]): Forces a specific color profile.
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
headless_mode: bool
|
|
181
|
+
mute_audio: bool
|
|
182
|
+
no_first_run: bool
|
|
183
|
+
disable_background_timer_throttling: bool
|
|
184
|
+
disable_backgrounding_occluded_windows: bool
|
|
185
|
+
disable_hang_monitor: bool
|
|
186
|
+
disable_ipc_flooding_protection: bool
|
|
187
|
+
disable_renderer_backgrounding: bool
|
|
188
|
+
disable_back_forward_cache: bool
|
|
189
|
+
disable_notifications: bool
|
|
190
|
+
disable_popup_blocking: bool
|
|
191
|
+
disable_prompt_on_repost: bool
|
|
192
|
+
disable_sync: bool
|
|
193
|
+
disable_background_networking: bool
|
|
194
|
+
disable_breakpad: bool
|
|
195
|
+
disable_component_update: bool
|
|
196
|
+
disable_domain_reliability: bool
|
|
197
|
+
disable_new_content_rendering_timeout: bool
|
|
198
|
+
disable_threaded_animation: bool
|
|
199
|
+
disable_threaded_scrolling: bool
|
|
200
|
+
disable_checker_imaging: bool
|
|
201
|
+
disable_image_animation_resync: bool
|
|
202
|
+
disable_partial_raster: bool
|
|
203
|
+
disable_skia_runtime_opts: bool
|
|
204
|
+
disable_dev_shm_usage: bool
|
|
205
|
+
disable_gpu: bool
|
|
206
|
+
aggressive_cache_discard: bool
|
|
207
|
+
allow_running_insecure_content: bool
|
|
208
|
+
no_process_per_site: bool
|
|
209
|
+
enable_precise_memory_info: bool
|
|
210
|
+
use_fake_device_for_media_stream: bool
|
|
211
|
+
use_fake_ui_for_media_stream: bool
|
|
212
|
+
deny_permission_prompts: bool
|
|
213
|
+
disable_external_intent_requests: bool
|
|
214
|
+
noerrdialogs: bool
|
|
215
|
+
enable_automation: bool
|
|
216
|
+
test_type: bool
|
|
217
|
+
remote_debugging_pipe: bool
|
|
218
|
+
silent_debugger_extension_api: bool
|
|
219
|
+
enable_logging_stderr: bool
|
|
220
|
+
password_store_basic: bool
|
|
221
|
+
use_mock_keychain: bool
|
|
222
|
+
enable_crash_reporter_for_testing: bool
|
|
223
|
+
metrics_recording_only: bool
|
|
224
|
+
no_pings: bool
|
|
225
|
+
allow_pre_commit_input: bool
|
|
226
|
+
deterministic_mode: bool
|
|
227
|
+
run_all_compositor_stages_before_draw: bool
|
|
228
|
+
enable_begin_frame_control: bool
|
|
229
|
+
in_process_gpu: bool
|
|
230
|
+
block_new_web_contents: bool
|
|
231
|
+
new_window: bool
|
|
232
|
+
no_service_autorun: bool
|
|
233
|
+
process_per_tab: bool
|
|
234
|
+
single_process: bool
|
|
235
|
+
no_sandbox: bool
|
|
236
|
+
user_agent: Optional[str]
|
|
237
|
+
user_data_dir: Optional[str]
|
|
238
|
+
proxy_server: Optional[str]
|
|
239
|
+
remote_debugging_port: Optional[int]
|
|
240
|
+
remote_debugging_address: Optional[str]
|
|
241
|
+
use_file_for_fake_video_capture: Optional[Union[str, pathlib.Path]]
|
|
242
|
+
autoplay_policy: Optional[AutoplayPolicyType]
|
|
243
|
+
log_level: Optional[LogLevelType]
|
|
244
|
+
use_gl: Optional[UseGLType]
|
|
245
|
+
force_color_profile: Optional[str]
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class BlinkFlags(TypedDict, total=False):
|
|
249
|
+
"""
|
|
250
|
+
Typed dictionary representing a collection of all flag types for Blink-based browsers.
|
|
251
|
+
|
|
252
|
+
Attributes:
|
|
253
|
+
argument (BlinkArguments): Command-line arguments for the browser.
|
|
254
|
+
experimental_option (BlinkExperimentalOptions): Experimental options for WebDriver.
|
|
255
|
+
attribute (BlinkAttributes): WebDriver attributes.
|
|
256
|
+
blink_feature (BlinkFeatures): Blink-specific feature flags.
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
argument: BlinkArguments
|
|
260
|
+
experimental_option: BlinkExperimentalOptions
|
|
261
|
+
attribute: BlinkAttributes
|
|
262
|
+
blink_feature: BlinkFeatures
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class BlinkFlagsManager(BrowserFlagsManager):
|
|
266
|
+
"""
|
|
267
|
+
Manages browser flags specifically for Blink-based browsers (like Chrome, Edge), adding support for Blink Features.
|
|
268
|
+
|
|
269
|
+
This class extends `BrowserFlagsManager` to handle Blink-specific features,
|
|
270
|
+
such as `--enable-blink-features` and `--disable-blink-features`, and provides
|
|
271
|
+
a comprehensive set of predefined flags for these browsers.
|
|
272
|
+
|
|
273
|
+
Attributes:
|
|
274
|
+
_browser_exe (Optional[Union[str, pathlib.Path]]): Path to the browser executable.
|
|
275
|
+
_start_page_url (Optional[str]): The URL to open when the browser starts.
|
|
276
|
+
_enable_blink_features (dict[str, str]): Stores enabled Blink feature commands.
|
|
277
|
+
_disable_blink_features (dict[str, str]): Stores disabled Blink feature commands.
|
|
278
|
+
"""
|
|
279
|
+
|
|
280
|
+
def __init__(
|
|
281
|
+
self,
|
|
282
|
+
browser_exe: Optional[Union[str, pathlib.Path]] = None,
|
|
283
|
+
start_page_url: Optional[str] = None,
|
|
284
|
+
flags_types: Optional[dict[str, FlagType]] = None,
|
|
285
|
+
flags_definitions: Optional[dict[str, FlagDefinition]] = None
|
|
286
|
+
):
|
|
287
|
+
"""
|
|
288
|
+
Initializes the BlinkFlagsManager.
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
browser_exe (Optional[Union[str, pathlib.Path]]): Path to the browser executable file.
|
|
292
|
+
start_page_url (Optional[str]): Initial URL to open on browser startup.
|
|
293
|
+
flags_types (Optional[dict[str, FlagType]]): Custom flag types to add or override.
|
|
294
|
+
flags_definitions (Optional[dict[str, FlagDefinition]]): Custom flag definitions to add or override.
|
|
295
|
+
"""
|
|
296
|
+
|
|
297
|
+
blink_flags_types = {
|
|
298
|
+
"blink_feature": FlagType(
|
|
299
|
+
set_flag_function=self.set_blink_feature,
|
|
300
|
+
remove_flag_function=self.remove_blink_feature,
|
|
301
|
+
set_flags_function=self.set_blink_features,
|
|
302
|
+
update_flags_function=self.update_blink_features,
|
|
303
|
+
clear_flags_function=self.clear_blink_features,
|
|
304
|
+
build_options_function=self.build_options_blink_features,
|
|
305
|
+
build_start_args_function=self.build_start_args_blink_features
|
|
306
|
+
),
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if flags_types is not None:
|
|
310
|
+
blink_flags_types.update(flags_types)
|
|
311
|
+
|
|
312
|
+
blink_flags_definitions = {
|
|
313
|
+
"debugger_address": FlagDefinition(
|
|
314
|
+
name="debugger_address",
|
|
315
|
+
command="debuggerAddress",
|
|
316
|
+
type="experimental_option",
|
|
317
|
+
mode="webdriver_option",
|
|
318
|
+
adding_validation_function=str_adding_validation_function
|
|
319
|
+
),
|
|
320
|
+
"remote_debugging_port": FlagDefinition(
|
|
321
|
+
name="remote_debugging_port",
|
|
322
|
+
command='--remote-debugging-port={value}',
|
|
323
|
+
type="argument",
|
|
324
|
+
mode="startup_argument",
|
|
325
|
+
adding_validation_function=int_adding_validation_function
|
|
326
|
+
),
|
|
327
|
+
"remote_debugging_address": FlagDefinition(
|
|
328
|
+
name="remote_debugging_address",
|
|
329
|
+
command='--remote-debugging-address="{value}"',
|
|
330
|
+
type="argument",
|
|
331
|
+
mode="startup_argument",
|
|
332
|
+
adding_validation_function=str_adding_validation_function
|
|
333
|
+
),
|
|
334
|
+
"user_agent": FlagDefinition(
|
|
335
|
+
name="user_agent",
|
|
336
|
+
command='--user-agent="{value}"',
|
|
337
|
+
type="argument",
|
|
338
|
+
mode="both",
|
|
339
|
+
adding_validation_function=str_adding_validation_function
|
|
340
|
+
),
|
|
341
|
+
"user_data_dir": FlagDefinition(
|
|
342
|
+
name="user_data_dir",
|
|
343
|
+
command='--user-data-dir="{value}"',
|
|
344
|
+
type="argument",
|
|
345
|
+
mode="startup_argument",
|
|
346
|
+
adding_validation_function=str_adding_validation_function
|
|
347
|
+
),
|
|
348
|
+
"proxy_server": FlagDefinition(
|
|
349
|
+
name="proxy_server",
|
|
350
|
+
command='--proxy-server="{value}"',
|
|
351
|
+
type="argument",
|
|
352
|
+
mode="webdriver_option",
|
|
353
|
+
adding_validation_function=str_adding_validation_function
|
|
354
|
+
),
|
|
355
|
+
"headless_mode": FlagDefinition(
|
|
356
|
+
name="headless_mode",
|
|
357
|
+
command="--headless",
|
|
358
|
+
type="argument",
|
|
359
|
+
mode="both",
|
|
360
|
+
adding_validation_function=bool_adding_validation_function
|
|
361
|
+
),
|
|
362
|
+
"mute_audio": FlagDefinition(
|
|
363
|
+
name="mute_audio",
|
|
364
|
+
command="--mute-audio",
|
|
365
|
+
type="argument",
|
|
366
|
+
mode="both",
|
|
367
|
+
adding_validation_function=bool_adding_validation_function
|
|
368
|
+
),
|
|
369
|
+
"disable_background_timer_throttling": FlagDefinition(
|
|
370
|
+
name="disable_background_timer_throttling",
|
|
371
|
+
command="--disable-background-timer-throttling",
|
|
372
|
+
type="argument",
|
|
373
|
+
mode="both",
|
|
374
|
+
adding_validation_function=bool_adding_validation_function
|
|
375
|
+
),
|
|
376
|
+
"disable_backgrounding_occluded_windows": FlagDefinition(
|
|
377
|
+
name="disable_backgrounding_occluded_windows",
|
|
378
|
+
command="--disable-backgrounding-occluded-windows",
|
|
379
|
+
type="argument",
|
|
380
|
+
mode="both",
|
|
381
|
+
adding_validation_function=bool_adding_validation_function
|
|
382
|
+
),
|
|
383
|
+
"disable_hang_monitor": FlagDefinition(
|
|
384
|
+
name="disable_hang_monitor",
|
|
385
|
+
command="--disable-hang-monitor",
|
|
386
|
+
type="argument",
|
|
387
|
+
mode="both",
|
|
388
|
+
adding_validation_function=bool_adding_validation_function
|
|
389
|
+
),
|
|
390
|
+
"disable_ipc_flooding_protection": FlagDefinition(
|
|
391
|
+
name="disable_ipc_flooding_protection",
|
|
392
|
+
command="--disable-ipc-flooding-protection",
|
|
393
|
+
type="argument",
|
|
394
|
+
mode="both",
|
|
395
|
+
adding_validation_function=bool_adding_validation_function
|
|
396
|
+
),
|
|
397
|
+
"disable_renderer_backgrounding": FlagDefinition(
|
|
398
|
+
name="disable_renderer_backgrounding",
|
|
399
|
+
command="--disable-renderer-backgrounding",
|
|
400
|
+
type="argument",
|
|
401
|
+
mode="both",
|
|
402
|
+
adding_validation_function=bool_adding_validation_function
|
|
403
|
+
),
|
|
404
|
+
"aggressive_cache_discard": FlagDefinition(
|
|
405
|
+
name="aggressive_cache_discard",
|
|
406
|
+
command="--aggressive-cache-discard",
|
|
407
|
+
type="argument",
|
|
408
|
+
mode="both",
|
|
409
|
+
adding_validation_function=bool_adding_validation_function
|
|
410
|
+
),
|
|
411
|
+
"allow_running_insecure_content": FlagDefinition(
|
|
412
|
+
name="allow_running_insecure_content",
|
|
413
|
+
command="--allow-running-insecure-content",
|
|
414
|
+
type="argument",
|
|
415
|
+
mode="both",
|
|
416
|
+
adding_validation_function=bool_adding_validation_function
|
|
417
|
+
),
|
|
418
|
+
"disable_back_forward_cache": FlagDefinition(
|
|
419
|
+
name="disable_back_forward_cache",
|
|
420
|
+
command="--disable-back-forward-cache",
|
|
421
|
+
type="argument",
|
|
422
|
+
mode="both",
|
|
423
|
+
adding_validation_function=bool_adding_validation_function
|
|
424
|
+
),
|
|
425
|
+
"no_process_per_site": FlagDefinition(
|
|
426
|
+
name="no_process_per_site",
|
|
427
|
+
command="--no-process-per-site",
|
|
428
|
+
type="argument",
|
|
429
|
+
mode="both",
|
|
430
|
+
adding_validation_function=bool_adding_validation_function
|
|
431
|
+
),
|
|
432
|
+
"enable_precise_memory_info": FlagDefinition(
|
|
433
|
+
name="enable_precise_memory_info",
|
|
434
|
+
command="--enable-precise-memory-info",
|
|
435
|
+
type="argument",
|
|
436
|
+
mode="both",
|
|
437
|
+
adding_validation_function=bool_adding_validation_function
|
|
438
|
+
),
|
|
439
|
+
"use_fake_device_for_media_stream": FlagDefinition(
|
|
440
|
+
name="use_fake_device_for_media_stream",
|
|
441
|
+
command="--use-fake-device-for-media-stream",
|
|
442
|
+
type="argument",
|
|
443
|
+
mode="both",
|
|
444
|
+
adding_validation_function=bool_adding_validation_function
|
|
445
|
+
),
|
|
446
|
+
"use_fake_ui_for_media_stream": FlagDefinition(
|
|
447
|
+
name="use_fake_ui_for_media_stream",
|
|
448
|
+
command="--use-fake-ui-for-media-stream",
|
|
449
|
+
type="argument",
|
|
450
|
+
mode="both",
|
|
451
|
+
adding_validation_function=bool_adding_validation_function
|
|
452
|
+
),
|
|
453
|
+
"use_file_for_fake_video_capture": FlagDefinition(
|
|
454
|
+
name="use_file_for_fake_video_capture",
|
|
455
|
+
command='--use-file-for-fake-video-capture={value}',
|
|
456
|
+
type="argument",
|
|
457
|
+
mode="both",
|
|
458
|
+
adding_validation_function=path_adding_validation_function
|
|
459
|
+
),
|
|
460
|
+
"autoplay_policy": FlagDefinition(
|
|
461
|
+
name="autoplay_policy",
|
|
462
|
+
command='--autoplay-policy={value}',
|
|
463
|
+
type="argument",
|
|
464
|
+
mode="both",
|
|
465
|
+
adding_validation_function=str_adding_validation_function
|
|
466
|
+
),
|
|
467
|
+
"deny_permission_prompts": FlagDefinition(
|
|
468
|
+
name="deny_permission_prompts",
|
|
469
|
+
command="--deny-permission-prompts",
|
|
470
|
+
type="argument",
|
|
471
|
+
mode="both",
|
|
472
|
+
adding_validation_function=bool_adding_validation_function
|
|
473
|
+
),
|
|
474
|
+
"disable_external_intent_requests": FlagDefinition(
|
|
475
|
+
name="disable_external_intent_requests",
|
|
476
|
+
command="--disable-external-intent-requests",
|
|
477
|
+
type="argument",
|
|
478
|
+
mode="both",
|
|
479
|
+
adding_validation_function=bool_adding_validation_function
|
|
480
|
+
),
|
|
481
|
+
"disable_notifications": FlagDefinition(
|
|
482
|
+
name="disable_notifications",
|
|
483
|
+
command="--disable-notifications",
|
|
484
|
+
type="argument",
|
|
485
|
+
mode="both",
|
|
486
|
+
adding_validation_function=bool_adding_validation_function
|
|
487
|
+
),
|
|
488
|
+
"disable_popup_blocking": FlagDefinition(
|
|
489
|
+
name="disable_popup_blocking",
|
|
490
|
+
command="--disable-popup-blocking",
|
|
491
|
+
type="argument",
|
|
492
|
+
mode="both",
|
|
493
|
+
adding_validation_function=bool_adding_validation_function
|
|
494
|
+
),
|
|
495
|
+
"disable_prompt_on_repost": FlagDefinition(
|
|
496
|
+
name="disable_prompt_on_repost",
|
|
497
|
+
command="--disable-prompt-on-repost",
|
|
498
|
+
type="argument",
|
|
499
|
+
mode="both",
|
|
500
|
+
adding_validation_function=bool_adding_validation_function
|
|
501
|
+
),
|
|
502
|
+
"noerrdialogs": FlagDefinition(
|
|
503
|
+
name="noerrdialogs",
|
|
504
|
+
command="--noerrdialogs",
|
|
505
|
+
type="argument",
|
|
506
|
+
mode="both",
|
|
507
|
+
adding_validation_function=bool_adding_validation_function
|
|
508
|
+
),
|
|
509
|
+
"enable_automation": FlagDefinition(
|
|
510
|
+
name="enable_automation",
|
|
511
|
+
command="--enable-automation",
|
|
512
|
+
type="argument",
|
|
513
|
+
mode="both",
|
|
514
|
+
adding_validation_function=bool_adding_validation_function
|
|
515
|
+
),
|
|
516
|
+
"test_type": FlagDefinition(
|
|
517
|
+
name="test_type",
|
|
518
|
+
command="--test-type",
|
|
519
|
+
type="argument",
|
|
520
|
+
mode="both",
|
|
521
|
+
adding_validation_function=bool_adding_validation_function
|
|
522
|
+
),
|
|
523
|
+
"remote_debugging_pipe": FlagDefinition(
|
|
524
|
+
name="remote_debugging_pipe",
|
|
525
|
+
command="--remote-debugging-pipe",
|
|
526
|
+
type="argument",
|
|
527
|
+
mode="both",
|
|
528
|
+
adding_validation_function=bool_adding_validation_function
|
|
529
|
+
),
|
|
530
|
+
"silent_debugger_extension_api": FlagDefinition(
|
|
531
|
+
name="silent_debugger_extension_api",
|
|
532
|
+
command="--silent-debugger-extension-api",
|
|
533
|
+
type="argument",
|
|
534
|
+
mode="both",
|
|
535
|
+
adding_validation_function=bool_adding_validation_function
|
|
536
|
+
),
|
|
537
|
+
"enable_logging_stderr": FlagDefinition(
|
|
538
|
+
name="enable_logging_stderr",
|
|
539
|
+
command="enable-logging=stderr",
|
|
540
|
+
type="argument",
|
|
541
|
+
mode="both",
|
|
542
|
+
adding_validation_function=bool_adding_validation_function
|
|
543
|
+
),
|
|
544
|
+
"log_level": FlagDefinition(
|
|
545
|
+
name="log_level",
|
|
546
|
+
command='--log-level={value}',
|
|
547
|
+
type="argument",
|
|
548
|
+
mode="both",
|
|
549
|
+
adding_validation_function=str_adding_validation_function
|
|
550
|
+
),
|
|
551
|
+
"password_store_basic": FlagDefinition(
|
|
552
|
+
name="password_store_basic",
|
|
553
|
+
command="--password-store=basic",
|
|
554
|
+
type="argument",
|
|
555
|
+
mode="both",
|
|
556
|
+
adding_validation_function=bool_adding_validation_function
|
|
557
|
+
),
|
|
558
|
+
"use_mock_keychain": FlagDefinition(
|
|
559
|
+
name="use_mock_keychain",
|
|
560
|
+
command="--use-mock-keychain",
|
|
561
|
+
type="argument",
|
|
562
|
+
mode="both",
|
|
563
|
+
adding_validation_function=bool_adding_validation_function
|
|
564
|
+
),
|
|
565
|
+
"disable_background_networking": FlagDefinition(
|
|
566
|
+
name="disable_background_networking",
|
|
567
|
+
command="--disable-background-networking",
|
|
568
|
+
type="argument",
|
|
569
|
+
mode="both",
|
|
570
|
+
adding_validation_function=bool_adding_validation_function
|
|
571
|
+
),
|
|
572
|
+
"disable_breakpad": FlagDefinition(
|
|
573
|
+
name="disable_breakpad",
|
|
574
|
+
command="--disable-breakpad",
|
|
575
|
+
type="argument",
|
|
576
|
+
mode="both",
|
|
577
|
+
adding_validation_function=bool_adding_validation_function
|
|
578
|
+
),
|
|
579
|
+
"disable_component_update": FlagDefinition(
|
|
580
|
+
name="disable_component_update",
|
|
581
|
+
command="--disable-component-update",
|
|
582
|
+
type="argument",
|
|
583
|
+
mode="both",
|
|
584
|
+
adding_validation_function=bool_adding_validation_function
|
|
585
|
+
),
|
|
586
|
+
"disable_domain_reliability": FlagDefinition(
|
|
587
|
+
name="disable_domain_reliability",
|
|
588
|
+
command="--disable-domain-reliability",
|
|
589
|
+
type="argument",
|
|
590
|
+
mode="both",
|
|
591
|
+
adding_validation_function=bool_adding_validation_function
|
|
592
|
+
),
|
|
593
|
+
"disable_sync": FlagDefinition(
|
|
594
|
+
name="disable_sync",
|
|
595
|
+
command="--disable-sync",
|
|
596
|
+
type="argument",
|
|
597
|
+
mode="both",
|
|
598
|
+
adding_validation_function=bool_adding_validation_function
|
|
599
|
+
),
|
|
600
|
+
"enable_crash_reporter_for_testing": FlagDefinition(
|
|
601
|
+
name="enable_crash_reporter_for_testing",
|
|
602
|
+
command="--enable-crash-reporter-for-testing",
|
|
603
|
+
type="argument",
|
|
604
|
+
mode="both",
|
|
605
|
+
adding_validation_function=bool_adding_validation_function
|
|
606
|
+
),
|
|
607
|
+
"metrics_recording_only": FlagDefinition(
|
|
608
|
+
name="metrics_recording_only",
|
|
609
|
+
command="--metrics-recording-only",
|
|
610
|
+
type="argument",
|
|
611
|
+
mode="both",
|
|
612
|
+
adding_validation_function=bool_adding_validation_function
|
|
613
|
+
),
|
|
614
|
+
"no_pings": FlagDefinition(
|
|
615
|
+
name="no_pings",
|
|
616
|
+
command="--no-pings",
|
|
617
|
+
type="argument",
|
|
618
|
+
mode="both",
|
|
619
|
+
adding_validation_function=bool_adding_validation_function
|
|
620
|
+
),
|
|
621
|
+
"allow_pre_commit_input": FlagDefinition(
|
|
622
|
+
name="allow_pre_commit_input",
|
|
623
|
+
command="--allow-pre-commit-input",
|
|
624
|
+
type="argument",
|
|
625
|
+
mode="both",
|
|
626
|
+
adding_validation_function=bool_adding_validation_function
|
|
627
|
+
),
|
|
628
|
+
"deterministic_mode": FlagDefinition(
|
|
629
|
+
name="deterministic_mode",
|
|
630
|
+
command="--deterministic-mode",
|
|
631
|
+
type="argument",
|
|
632
|
+
mode="both",
|
|
633
|
+
adding_validation_function=bool_adding_validation_function
|
|
634
|
+
),
|
|
635
|
+
"run_all_compositor_stages_before_draw": FlagDefinition(
|
|
636
|
+
name="run_all_compositor_stages_before_draw",
|
|
637
|
+
command="--run-all-compositor-stages-before-draw",
|
|
638
|
+
type="argument",
|
|
639
|
+
mode="both",
|
|
640
|
+
adding_validation_function=bool_adding_validation_function
|
|
641
|
+
),
|
|
642
|
+
"disable_new_content_rendering_timeout": FlagDefinition(
|
|
643
|
+
name="disable_new_content_rendering_timeout",
|
|
644
|
+
command="--disable-new-content-rendering-timeout",
|
|
645
|
+
type="argument",
|
|
646
|
+
mode="both",
|
|
647
|
+
adding_validation_function=bool_adding_validation_function
|
|
648
|
+
),
|
|
649
|
+
"enable_begin_frame_control": FlagDefinition(
|
|
650
|
+
name="enable_begin_frame_control",
|
|
651
|
+
command="--enable-begin-frame-control",
|
|
652
|
+
type="argument",
|
|
653
|
+
mode="both",
|
|
654
|
+
adding_validation_function=bool_adding_validation_function
|
|
655
|
+
),
|
|
656
|
+
"disable_threaded_animation": FlagDefinition(
|
|
657
|
+
name="disable_threaded_animation",
|
|
658
|
+
command="--disable-threaded-animation",
|
|
659
|
+
type="argument",
|
|
660
|
+
mode="both",
|
|
661
|
+
adding_validation_function=bool_adding_validation_function
|
|
662
|
+
),
|
|
663
|
+
"disable_threaded_scrolling": FlagDefinition(
|
|
664
|
+
name="disable_threaded_scrolling",
|
|
665
|
+
command="--disable-threaded-scrolling",
|
|
666
|
+
type="argument",
|
|
667
|
+
mode="both",
|
|
668
|
+
adding_validation_function=bool_adding_validation_function
|
|
669
|
+
),
|
|
670
|
+
"disable_checker_imaging": FlagDefinition(
|
|
671
|
+
name="disable_checker_imaging",
|
|
672
|
+
command="--disable-checker-imaging",
|
|
673
|
+
type="argument",
|
|
674
|
+
mode="both",
|
|
675
|
+
adding_validation_function=bool_adding_validation_function
|
|
676
|
+
),
|
|
677
|
+
"disable_image_animation_resync": FlagDefinition(
|
|
678
|
+
name="disable_image_animation_resync",
|
|
679
|
+
command="--disable-image-animation-resync",
|
|
680
|
+
type="argument",
|
|
681
|
+
mode="both",
|
|
682
|
+
adding_validation_function=bool_adding_validation_function
|
|
683
|
+
),
|
|
684
|
+
"disable_partial_raster": FlagDefinition(
|
|
685
|
+
name="disable_partial_raster",
|
|
686
|
+
command="--disable-partial-raster",
|
|
687
|
+
type="argument",
|
|
688
|
+
mode="both",
|
|
689
|
+
adding_validation_function=bool_adding_validation_function
|
|
690
|
+
),
|
|
691
|
+
"disable_skia_runtime_opts": FlagDefinition(
|
|
692
|
+
name="disable_skia_runtime_opts",
|
|
693
|
+
command="--disable-skia-runtime-opts",
|
|
694
|
+
type="argument",
|
|
695
|
+
mode="both",
|
|
696
|
+
adding_validation_function=bool_adding_validation_function
|
|
697
|
+
),
|
|
698
|
+
"in_process_gpu": FlagDefinition(
|
|
699
|
+
name="in_process_gpu",
|
|
700
|
+
command="--in-process-gpu",
|
|
701
|
+
type="argument",
|
|
702
|
+
mode="both",
|
|
703
|
+
adding_validation_function=bool_adding_validation_function
|
|
704
|
+
),
|
|
705
|
+
"use_gl": FlagDefinition(
|
|
706
|
+
name="use_gl",
|
|
707
|
+
command='--use-gl={value}',
|
|
708
|
+
type="argument",
|
|
709
|
+
mode="both",
|
|
710
|
+
adding_validation_function=str_adding_validation_function
|
|
711
|
+
),
|
|
712
|
+
"block_new_web_contents": FlagDefinition(
|
|
713
|
+
name="block_new_web_contents",
|
|
714
|
+
command="--block-new-web-contents",
|
|
715
|
+
type="argument",
|
|
716
|
+
mode="both",
|
|
717
|
+
adding_validation_function=bool_adding_validation_function
|
|
718
|
+
),
|
|
719
|
+
"force_color_profile": FlagDefinition(
|
|
720
|
+
name="force_color_profile",
|
|
721
|
+
command='--force-color-profile={value}',
|
|
722
|
+
type="argument",
|
|
723
|
+
mode="both",
|
|
724
|
+
adding_validation_function=str_adding_validation_function
|
|
725
|
+
),
|
|
726
|
+
"new_window": FlagDefinition(
|
|
727
|
+
name="new_window",
|
|
728
|
+
command="--new-window",
|
|
729
|
+
type="argument",
|
|
730
|
+
mode="both",
|
|
731
|
+
adding_validation_function=bool_adding_validation_function
|
|
732
|
+
),
|
|
733
|
+
"no_service_autorun": FlagDefinition(
|
|
734
|
+
name="no_service_autorun",
|
|
735
|
+
command="--no-service-autorun",
|
|
736
|
+
type="argument",
|
|
737
|
+
mode="both",
|
|
738
|
+
adding_validation_function=bool_adding_validation_function
|
|
739
|
+
),
|
|
740
|
+
"process_per_tab": FlagDefinition(
|
|
741
|
+
name="process_per_tab",
|
|
742
|
+
command="--process-per-tab",
|
|
743
|
+
type="argument",
|
|
744
|
+
mode="both",
|
|
745
|
+
adding_validation_function=bool_adding_validation_function
|
|
746
|
+
),
|
|
747
|
+
"single_process": FlagDefinition(
|
|
748
|
+
name="single_process",
|
|
749
|
+
command="--single-process",
|
|
750
|
+
type="argument",
|
|
751
|
+
mode="both",
|
|
752
|
+
adding_validation_function=bool_adding_validation_function
|
|
753
|
+
),
|
|
754
|
+
"no_sandbox": FlagDefinition(
|
|
755
|
+
name="no_sandbox",
|
|
756
|
+
command="--no-sandbox",
|
|
757
|
+
type="argument",
|
|
758
|
+
mode="both",
|
|
759
|
+
adding_validation_function=bool_adding_validation_function
|
|
760
|
+
),
|
|
761
|
+
"disable_dev_shm_usage": FlagDefinition(
|
|
762
|
+
name="disable_dev_shm_usage",
|
|
763
|
+
command="--disable-dev-shm-usage",
|
|
764
|
+
type="argument",
|
|
765
|
+
mode="both",
|
|
766
|
+
adding_validation_function=bool_adding_validation_function
|
|
767
|
+
),
|
|
768
|
+
"disable_gpu": FlagDefinition(
|
|
769
|
+
name="disable_gpu",
|
|
770
|
+
command="--disable-gpu",
|
|
771
|
+
type="argument",
|
|
772
|
+
mode="both",
|
|
773
|
+
adding_validation_function=bool_adding_validation_function
|
|
774
|
+
),
|
|
775
|
+
"no_first_run": FlagDefinition(
|
|
776
|
+
name="no_first_run",
|
|
777
|
+
command="--no-first-run",
|
|
778
|
+
type="argument",
|
|
779
|
+
mode="both",
|
|
780
|
+
adding_validation_function=bool_adding_validation_function
|
|
781
|
+
),
|
|
782
|
+
"calculate_native_win_occlusion": FlagDefinition(
|
|
783
|
+
name="calculate_native_win_occlusion",
|
|
784
|
+
command="CalculateNativeWinOcclusion",
|
|
785
|
+
type="blink_feature",
|
|
786
|
+
mode="both",
|
|
787
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
788
|
+
),
|
|
789
|
+
"accept_ch_frame": FlagDefinition(
|
|
790
|
+
name="accept_ch_frame",
|
|
791
|
+
command="AcceptCHFrame",
|
|
792
|
+
type="blink_feature",
|
|
793
|
+
mode="both",
|
|
794
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
795
|
+
),
|
|
796
|
+
"avoid_unload_check_sync": FlagDefinition(
|
|
797
|
+
name="avoid_unload_check_sync",
|
|
798
|
+
command="AvoidUnnecessaryBeforeUnloadCheckSync",
|
|
799
|
+
type="blink_feature",
|
|
800
|
+
mode="both",
|
|
801
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
802
|
+
),
|
|
803
|
+
"bfcache_feature": FlagDefinition(
|
|
804
|
+
name="bfcache_feature",
|
|
805
|
+
command="BackForwardCache",
|
|
806
|
+
type="blink_feature",
|
|
807
|
+
mode="both",
|
|
808
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
809
|
+
),
|
|
810
|
+
"heavy_ad_mitigations": FlagDefinition(
|
|
811
|
+
name="heavy_ad_mitigations",
|
|
812
|
+
command="HeavyAdPrivacyMitigations",
|
|
813
|
+
type="blink_feature",
|
|
814
|
+
mode="both",
|
|
815
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
816
|
+
),
|
|
817
|
+
"isolate_origins": FlagDefinition(
|
|
818
|
+
name="isolate_origins",
|
|
819
|
+
command="IsolateOrigins",
|
|
820
|
+
type="blink_feature",
|
|
821
|
+
mode="both",
|
|
822
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
823
|
+
),
|
|
824
|
+
"lazy_frame_loading": FlagDefinition(
|
|
825
|
+
name="lazy_frame_loading",
|
|
826
|
+
command="LazyFrameLoading",
|
|
827
|
+
type="blink_feature",
|
|
828
|
+
mode="both",
|
|
829
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
830
|
+
),
|
|
831
|
+
"script_streaming": FlagDefinition(
|
|
832
|
+
name="script_streaming",
|
|
833
|
+
command="ScriptStreaming",
|
|
834
|
+
type="blink_feature",
|
|
835
|
+
mode="both",
|
|
836
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
837
|
+
),
|
|
838
|
+
"global_media_controls": FlagDefinition(
|
|
839
|
+
name="global_media_controls",
|
|
840
|
+
command="GlobalMediaControls",
|
|
841
|
+
type="blink_feature",
|
|
842
|
+
mode="both",
|
|
843
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
844
|
+
),
|
|
845
|
+
"improved_cookie_controls": FlagDefinition(
|
|
846
|
+
name="improved_cookie_controls",
|
|
847
|
+
command="ImprovedCookieControls",
|
|
848
|
+
type="blink_feature",
|
|
849
|
+
mode="both",
|
|
850
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
851
|
+
),
|
|
852
|
+
"privacy_sandbox_settings4": FlagDefinition(
|
|
853
|
+
name="privacy_sandbox_settings4",
|
|
854
|
+
command="PrivacySandboxSettings4",
|
|
855
|
+
type="blink_feature",
|
|
856
|
+
mode="both",
|
|
857
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
858
|
+
),
|
|
859
|
+
"media_router": FlagDefinition(
|
|
860
|
+
name="media_router",
|
|
861
|
+
command="MediaRouter",
|
|
862
|
+
type="blink_feature",
|
|
863
|
+
mode="both",
|
|
864
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
865
|
+
),
|
|
866
|
+
"autofill_server_comm": FlagDefinition(
|
|
867
|
+
name="autofill_server_comm",
|
|
868
|
+
command="AutofillServerCommunication",
|
|
869
|
+
type="blink_feature",
|
|
870
|
+
mode="both",
|
|
871
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
872
|
+
),
|
|
873
|
+
"cert_transparency_updater": FlagDefinition(
|
|
874
|
+
name="cert_transparency_updater",
|
|
875
|
+
command="CertificateTransparencyComponentUpdater",
|
|
876
|
+
type="blink_feature",
|
|
877
|
+
mode="both",
|
|
878
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
879
|
+
),
|
|
880
|
+
"optimization_hints": FlagDefinition(
|
|
881
|
+
name="optimization_hints",
|
|
882
|
+
command="OptimizationHints",
|
|
883
|
+
type="blink_feature",
|
|
884
|
+
mode="both",
|
|
885
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
886
|
+
),
|
|
887
|
+
"dial_media_route_provider": FlagDefinition(
|
|
888
|
+
name="dial_media_route_provider",
|
|
889
|
+
command="DialMediaRouteProvider",
|
|
890
|
+
type="blink_feature",
|
|
891
|
+
mode="both",
|
|
892
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
893
|
+
),
|
|
894
|
+
"paint_holding": FlagDefinition(
|
|
895
|
+
name="paint_holding",
|
|
896
|
+
command="PaintHolding",
|
|
897
|
+
type="blink_feature",
|
|
898
|
+
mode="both",
|
|
899
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
900
|
+
),
|
|
901
|
+
"destroy_profile_on_browser_close": FlagDefinition(
|
|
902
|
+
name="destroy_profile_on_browser_close",
|
|
903
|
+
command="DestroyProfileOnBrowserClose",
|
|
904
|
+
type="blink_feature",
|
|
905
|
+
mode="both",
|
|
906
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
907
|
+
),
|
|
908
|
+
"site_per_process": FlagDefinition(
|
|
909
|
+
name="site_per_process",
|
|
910
|
+
command="site-per-process",
|
|
911
|
+
type="blink_feature",
|
|
912
|
+
mode="both",
|
|
913
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
914
|
+
),
|
|
915
|
+
"automation_controlled": FlagDefinition(
|
|
916
|
+
name="automation_controlled",
|
|
917
|
+
command="AutomationControlled",
|
|
918
|
+
type="blink_feature",
|
|
919
|
+
mode="both",
|
|
920
|
+
adding_validation_function=optional_bool_adding_validation_function
|
|
921
|
+
),
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
if flags_definitions is not None:
|
|
925
|
+
blink_flags_definitions.update(flags_definitions)
|
|
926
|
+
|
|
927
|
+
super().__init__(
|
|
928
|
+
flags_types=blink_flags_types,
|
|
929
|
+
flags_definitions=blink_flags_definitions
|
|
930
|
+
)
|
|
931
|
+
|
|
932
|
+
self._browser_exe = browser_exe
|
|
933
|
+
self._start_page_url = start_page_url
|
|
934
|
+
self._enable_blink_features: dict[str, str] = {}
|
|
935
|
+
self._disable_blink_features: dict[str, str] = {}
|
|
936
|
+
|
|
937
|
+
def build_start_args_blink_features(self) -> list[str]:
|
|
938
|
+
"""
|
|
939
|
+
Builds a list of Blink feature arguments for browser startup.
|
|
940
|
+
|
|
941
|
+
Returns:
|
|
942
|
+
list[str]: A list of startup arguments for Blink features.
|
|
943
|
+
"""
|
|
944
|
+
|
|
945
|
+
start_args = []
|
|
946
|
+
|
|
947
|
+
enable_blink_features = dict(
|
|
948
|
+
filter(
|
|
949
|
+
lambda item: self._flags_definitions_by_types["blink_feature"][item[0]]["mode"] in ["startup_argument", "both"],
|
|
950
|
+
self._enable_blink_features.items()
|
|
951
|
+
)
|
|
952
|
+
)
|
|
953
|
+
disable_blink_features = dict(
|
|
954
|
+
filter(
|
|
955
|
+
lambda item: self._flags_definitions_by_types["blink_feature"][item[0]]["mode"] in ["startup_argument", "both"],
|
|
956
|
+
self._disable_blink_features.items()
|
|
957
|
+
)
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
if enable_blink_features:
|
|
961
|
+
start_args.append("--enable-blink-features=" + ",".join(enable_blink_features.values()))
|
|
962
|
+
|
|
963
|
+
if disable_blink_features:
|
|
964
|
+
start_args.append("--disable-blink-features=" + ",".join(disable_blink_features.values()))
|
|
965
|
+
|
|
966
|
+
return start_args
|
|
967
|
+
|
|
968
|
+
def build_options_blink_features(self, options: _blink_webdriver_option_type) -> _blink_webdriver_option_type:
|
|
969
|
+
"""
|
|
970
|
+
Adds configured Blink features (`--enable-blink-features` and `--disable-blink-features`) to the WebDriver options.
|
|
971
|
+
|
|
972
|
+
Args:
|
|
973
|
+
options (_blink_webdriver_option_type): The WebDriver options object to modify.
|
|
974
|
+
|
|
975
|
+
Returns:
|
|
976
|
+
_blink_webdriver_option_type: The modified WebDriver options object.
|
|
977
|
+
"""
|
|
978
|
+
|
|
979
|
+
enable_blink_features = dict(
|
|
980
|
+
filter(
|
|
981
|
+
lambda item: self._flags_definitions_by_types["blink_feature"][item[0]]["mode"] in ["webdriver_option", "both"],
|
|
982
|
+
self._enable_blink_features.items()
|
|
983
|
+
)
|
|
984
|
+
)
|
|
985
|
+
disable_blink_features = dict(
|
|
986
|
+
filter(
|
|
987
|
+
lambda item: self._flags_definitions_by_types["blink_feature"][item[0]]["mode"] in ["webdriver_option", "both"],
|
|
988
|
+
self._disable_blink_features.items()
|
|
989
|
+
)
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
if enable_blink_features:
|
|
993
|
+
options.add_argument("--enable-blink-features=" + ",".join(enable_blink_features.values()))
|
|
994
|
+
|
|
995
|
+
if disable_blink_features:
|
|
996
|
+
options.add_argument("--disable-blink-features=" + ",".join(disable_blink_features.values()))
|
|
997
|
+
|
|
998
|
+
return options
|
|
999
|
+
|
|
1000
|
+
def clear_blink_features(self):
|
|
1001
|
+
"""Clears all configured Blink features."""
|
|
1002
|
+
|
|
1003
|
+
self._enable_blink_features = {}
|
|
1004
|
+
self._disable_blink_features = {}
|
|
1005
|
+
|
|
1006
|
+
def remove_blink_feature(self, blink_feature_name: str):
|
|
1007
|
+
"""
|
|
1008
|
+
Removes a configured Blink feature.
|
|
1009
|
+
|
|
1010
|
+
This removes the feature from both the enabled and disabled lists.
|
|
1011
|
+
|
|
1012
|
+
Args:
|
|
1013
|
+
blink_feature_name (str): The name of the Blink feature to remove.
|
|
1014
|
+
"""
|
|
1015
|
+
|
|
1016
|
+
self._enable_blink_features.pop(blink_feature_name, None)
|
|
1017
|
+
self._disable_blink_features.pop(blink_feature_name, None)
|
|
1018
|
+
|
|
1019
|
+
def set_blink_feature(self, blink_feature: FlagDefinition, enable: Optional[bool]):
|
|
1020
|
+
"""
|
|
1021
|
+
Sets a Blink feature to be either enabled or disabled.
|
|
1022
|
+
|
|
1023
|
+
Args:
|
|
1024
|
+
blink_feature (FlagDefinition): The definition of the Blink feature.
|
|
1025
|
+
enable (Optional[bool]): `True` to enable, `False` to disable. If `None`, the feature is removed.
|
|
1026
|
+
"""
|
|
1027
|
+
|
|
1028
|
+
blink_feature_name = blink_feature["name"]
|
|
1029
|
+
blink_feature_command = blink_feature["command"]
|
|
1030
|
+
adding_validation_function = blink_feature["adding_validation_function"]
|
|
1031
|
+
|
|
1032
|
+
self.remove_blink_feature(blink_feature_command)
|
|
1033
|
+
|
|
1034
|
+
if adding_validation_function(enable):
|
|
1035
|
+
if enable:
|
|
1036
|
+
self._enable_blink_features[blink_feature_name] = blink_feature_command
|
|
1037
|
+
else:
|
|
1038
|
+
self._disable_blink_features[blink_feature_name] = blink_feature_command
|
|
1039
|
+
|
|
1040
|
+
def update_blink_features(self, blink_features: Union[BlinkFeatures, dict[str, Optional[bool]]]):
|
|
1041
|
+
"""
|
|
1042
|
+
Updates Blink features from a dictionary without clearing existing ones.
|
|
1043
|
+
|
|
1044
|
+
Args:
|
|
1045
|
+
blink_features (Union[BlinkFeatures, dict[str, Optional[bool]]]): A dictionary of Blink features to set or update.
|
|
1046
|
+
|
|
1047
|
+
Raises:
|
|
1048
|
+
ValueError: If an unknown Blink feature key is provided.
|
|
1049
|
+
"""
|
|
1050
|
+
|
|
1051
|
+
for key, value in blink_features.items():
|
|
1052
|
+
flag_definition = self._flags_definitions_by_types["blink_feature"].get(key, FlagNotDefined())
|
|
1053
|
+
|
|
1054
|
+
if isinstance(flag_definition, FlagNotDefined):
|
|
1055
|
+
raise ValueError(f"Unknown blink feature: {key}.")
|
|
1056
|
+
|
|
1057
|
+
self.set_blink_feature(flag_definition, value)
|
|
1058
|
+
|
|
1059
|
+
def set_blink_features(self, blink_features: Union[BlinkFeatures, dict[str, Optional[bool]]]):
|
|
1060
|
+
"""
|
|
1061
|
+
Clears existing and sets new Blink features from a dictionary.
|
|
1062
|
+
|
|
1063
|
+
Args:
|
|
1064
|
+
blink_features (Union[BlinkFeatures, dict[str, Optional[bool]]]): A dictionary of Blink features to set.
|
|
1065
|
+
|
|
1066
|
+
Raises:
|
|
1067
|
+
ValueError: If an unknown Blink feature key is provided.
|
|
1068
|
+
"""
|
|
1069
|
+
|
|
1070
|
+
self.clear_blink_features()
|
|
1071
|
+
self.update_blink_features(blink_features)
|
|
1072
|
+
|
|
1073
|
+
def _renew_webdriver_options(self) -> _blink_webdriver_option_type:
|
|
1074
|
+
"""
|
|
1075
|
+
Abstract method to renew WebDriver options. Must be implemented in child classes.
|
|
1076
|
+
|
|
1077
|
+
This method is intended to be overridden in subclasses to provide
|
|
1078
|
+
browser-specific WebDriver options instances (e.g., ChromeOptions, EdgeOptions).
|
|
1079
|
+
|
|
1080
|
+
Returns:
|
|
1081
|
+
_blink_webdriver_option_type: A new instance of WebDriver options (e.g., ChromeOptions, EdgeOptions).
|
|
1082
|
+
|
|
1083
|
+
Raises:
|
|
1084
|
+
NotImplementedError: If the method is not implemented in a subclass.
|
|
1085
|
+
"""
|
|
1086
|
+
|
|
1087
|
+
raise NotImplementedError("This function must be implemented in child classes.")
|
|
1088
|
+
|
|
1089
|
+
@property
|
|
1090
|
+
def browser_exe(self) -> Optional[Union[str, pathlib.Path]]:
|
|
1091
|
+
"""
|
|
1092
|
+
Returns the browser executable path.
|
|
1093
|
+
|
|
1094
|
+
This property retrieves the path to the browser executable that will be used to start the browser instance.
|
|
1095
|
+
|
|
1096
|
+
Returns:
|
|
1097
|
+
Optional[Union[str, pathlib.Path]]: The path to the browser executable.
|
|
1098
|
+
"""
|
|
1099
|
+
|
|
1100
|
+
return self._browser_exe
|
|
1101
|
+
|
|
1102
|
+
@browser_exe.setter
|
|
1103
|
+
def browser_exe(self, value: Optional[Union[str, pathlib.Path]]):
|
|
1104
|
+
"""
|
|
1105
|
+
Sets the path to the browser executable.
|
|
1106
|
+
|
|
1107
|
+
Args:
|
|
1108
|
+
value (Optional[Union[str, pathlib.Path]]): The new path for the browser executable.
|
|
1109
|
+
"""
|
|
1110
|
+
|
|
1111
|
+
self._browser_exe = value
|
|
1112
|
+
|
|
1113
|
+
def build_options_arguments(self, options: _blink_webdriver_option_type) -> _blink_webdriver_option_type:
|
|
1114
|
+
"""
|
|
1115
|
+
Adds configured command-line arguments to the WebDriver options.
|
|
1116
|
+
|
|
1117
|
+
Args:
|
|
1118
|
+
options (_blink_webdriver_option_type): The WebDriver options object.
|
|
1119
|
+
|
|
1120
|
+
Returns:
|
|
1121
|
+
_blink_webdriver_option_type: The modified WebDriver options object.
|
|
1122
|
+
"""
|
|
1123
|
+
|
|
1124
|
+
return super().build_options_arguments(options)
|
|
1125
|
+
|
|
1126
|
+
def build_options_attributes(self, options: _blink_webdriver_option_type) -> _blink_webdriver_option_type:
|
|
1127
|
+
"""
|
|
1128
|
+
Applies configured attributes to the WebDriver options.
|
|
1129
|
+
|
|
1130
|
+
Args:
|
|
1131
|
+
options (_blink_webdriver_option_type): The WebDriver options object.
|
|
1132
|
+
|
|
1133
|
+
Returns:
|
|
1134
|
+
_blink_webdriver_option_type: The modified WebDriver options object.
|
|
1135
|
+
"""
|
|
1136
|
+
|
|
1137
|
+
return super().build_options_attributes(options)
|
|
1138
|
+
|
|
1139
|
+
def build_options_experimental_options(self, options: _blink_webdriver_option_type) -> _blink_webdriver_option_type:
|
|
1140
|
+
"""
|
|
1141
|
+
Adds experimental options to the WebDriver options.
|
|
1142
|
+
|
|
1143
|
+
Args:
|
|
1144
|
+
options (_blink_webdriver_option_type): The WebDriver options object.
|
|
1145
|
+
|
|
1146
|
+
Returns:
|
|
1147
|
+
_blink_webdriver_option_type: The modified WebDriver options object.
|
|
1148
|
+
"""
|
|
1149
|
+
|
|
1150
|
+
return super().build_options_experimental_options(options)
|
|
1151
|
+
|
|
1152
|
+
def build_start_args_arguments(self) -> list[str]:
|
|
1153
|
+
"""
|
|
1154
|
+
Builds a list of command-line arguments for browser startup.
|
|
1155
|
+
|
|
1156
|
+
Returns:
|
|
1157
|
+
list[str]: A list of startup arguments.
|
|
1158
|
+
"""
|
|
1159
|
+
|
|
1160
|
+
return super().build_start_args_arguments()
|
|
1161
|
+
|
|
1162
|
+
def clear_flags(self):
|
|
1163
|
+
"""Clears all configured flags and resets the start page URL."""
|
|
1164
|
+
|
|
1165
|
+
super().clear_flags()
|
|
1166
|
+
self._start_page_url = None
|
|
1167
|
+
|
|
1168
|
+
@property
|
|
1169
|
+
def options(self) -> _blink_webdriver_option_type:
|
|
1170
|
+
"""
|
|
1171
|
+
Builds and returns a Blink-specific WebDriver options object.
|
|
1172
|
+
|
|
1173
|
+
Returns:
|
|
1174
|
+
_blink_webdriver_option_type: A configured Blink-based WebDriver options object.
|
|
1175
|
+
"""
|
|
1176
|
+
|
|
1177
|
+
return super().options
|
|
1178
|
+
|
|
1179
|
+
def set_arguments(self, arguments: Union[BlinkArguments, dict[str, Any]]):
|
|
1180
|
+
"""
|
|
1181
|
+
Clears existing and sets new command-line arguments from a dictionary.
|
|
1182
|
+
|
|
1183
|
+
Args:
|
|
1184
|
+
arguments (Union[BlinkArguments, dict[str, Any]]): A dictionary of arguments to set.
|
|
1185
|
+
|
|
1186
|
+
Raises:
|
|
1187
|
+
ValueError: If an unknown argument key is provided.
|
|
1188
|
+
"""
|
|
1189
|
+
|
|
1190
|
+
super().set_arguments(arguments)
|
|
1191
|
+
|
|
1192
|
+
def set_attributes(self, attributes: Union[BlinkAttributes, dict[str, Any]]):
|
|
1193
|
+
"""
|
|
1194
|
+
Clears existing and sets new browser attributes from a dictionary.
|
|
1195
|
+
|
|
1196
|
+
Args:
|
|
1197
|
+
attributes (Union[BlinkAttributes, dict[str, Any]]): A dictionary of attributes to set.
|
|
1198
|
+
|
|
1199
|
+
Raises:
|
|
1200
|
+
ValueError: If an unknown attribute key is provided.
|
|
1201
|
+
"""
|
|
1202
|
+
|
|
1203
|
+
super().set_attributes(attributes)
|
|
1204
|
+
|
|
1205
|
+
def set_experimental_options(
|
|
1206
|
+
self,
|
|
1207
|
+
experimental_options: Union[BlinkExperimentalOptions, dict[str, Any]]
|
|
1208
|
+
):
|
|
1209
|
+
"""
|
|
1210
|
+
Clears existing and sets new experimental options from a dictionary.
|
|
1211
|
+
|
|
1212
|
+
Args:
|
|
1213
|
+
experimental_options (Union[BlinkExperimentalOptions, dict[str, Any]]): A dictionary of experimental options to set.
|
|
1214
|
+
|
|
1215
|
+
Raises:
|
|
1216
|
+
ValueError: If an unknown experimental option key is provided.
|
|
1217
|
+
"""
|
|
1218
|
+
|
|
1219
|
+
super().set_experimental_options(experimental_options)
|
|
1220
|
+
|
|
1221
|
+
def set_flags(self, flags: Union[BlinkFlags, dict[str, dict[str, Any]]]):
|
|
1222
|
+
"""
|
|
1223
|
+
Clears all existing flags and sets new ones, including Blink features.
|
|
1224
|
+
|
|
1225
|
+
This method delegates to the parent `set_flags` method, allowing it to handle
|
|
1226
|
+
all flag types defined in this manager, including 'arguments', 'experimental_options',
|
|
1227
|
+
'attributes', and 'blink_features'.
|
|
1228
|
+
|
|
1229
|
+
Args:
|
|
1230
|
+
flags (Union[BlinkFlags, dict[str, dict[str, Any]]]): A dictionary where keys are flag types
|
|
1231
|
+
and values are dictionaries of flags to set for that type.
|
|
1232
|
+
"""
|
|
1233
|
+
|
|
1234
|
+
super().set_flags(flags)
|
|
1235
|
+
|
|
1236
|
+
@property
|
|
1237
|
+
def start_args(self) -> list[str]:
|
|
1238
|
+
"""
|
|
1239
|
+
Builds and returns a list of all command-line arguments for browser startup.
|
|
1240
|
+
|
|
1241
|
+
Returns:
|
|
1242
|
+
list[str]: A list of startup arguments.
|
|
1243
|
+
"""
|
|
1244
|
+
|
|
1245
|
+
args = []
|
|
1246
|
+
|
|
1247
|
+
for type_name, type_functions in self._flags_types.items():
|
|
1248
|
+
args += type_functions["build_start_args_function"]()
|
|
1249
|
+
|
|
1250
|
+
return args
|
|
1251
|
+
|
|
1252
|
+
@property
|
|
1253
|
+
def start_command(self) -> str:
|
|
1254
|
+
"""
|
|
1255
|
+
Generates the full browser start command.
|
|
1256
|
+
|
|
1257
|
+
Composes the command line arguments based on the current settings
|
|
1258
|
+
(debugging port, profile directory, headless mode, etc.) and the browser executable path.
|
|
1259
|
+
|
|
1260
|
+
Returns:
|
|
1261
|
+
str: The complete command string to start the browser with specified arguments.
|
|
1262
|
+
"""
|
|
1263
|
+
|
|
1264
|
+
start_args = [build_first_start_argument(self._browser_exe)]
|
|
1265
|
+
start_args += self.start_args
|
|
1266
|
+
|
|
1267
|
+
if self._start_page_url is not None:
|
|
1268
|
+
start_args.append(self._start_page_url)
|
|
1269
|
+
|
|
1270
|
+
return " ".join(start_args)
|
|
1271
|
+
|
|
1272
|
+
@property
|
|
1273
|
+
def start_page_url(self) -> Optional[str]:
|
|
1274
|
+
"""
|
|
1275
|
+
Gets the initial URL to open when the browser starts.
|
|
1276
|
+
|
|
1277
|
+
Returns:
|
|
1278
|
+
Optional[str]: The start page URL.
|
|
1279
|
+
"""
|
|
1280
|
+
|
|
1281
|
+
return self._start_page_url
|
|
1282
|
+
|
|
1283
|
+
@start_page_url.setter
|
|
1284
|
+
def start_page_url(self, value: Optional[str]):
|
|
1285
|
+
"""
|
|
1286
|
+
Sets the initial URL to open when the browser starts.
|
|
1287
|
+
|
|
1288
|
+
Args:
|
|
1289
|
+
value (Optional[str]): The URL to set as the start page.
|
|
1290
|
+
"""
|
|
1291
|
+
|
|
1292
|
+
self._start_page_url = value
|
|
1293
|
+
|
|
1294
|
+
def update_arguments(self, arguments: Union[BlinkArguments, dict[str, Any]]):
|
|
1295
|
+
"""
|
|
1296
|
+
Updates command-line arguments from a dictionary without clearing existing ones.
|
|
1297
|
+
|
|
1298
|
+
Args:
|
|
1299
|
+
arguments (Union[BlinkArguments, dict[str, Any]]): A dictionary of arguments to set or update.
|
|
1300
|
+
|
|
1301
|
+
Raises:
|
|
1302
|
+
ValueError: If an unknown argument key is provided.
|
|
1303
|
+
"""
|
|
1304
|
+
|
|
1305
|
+
super().update_arguments(arguments)
|
|
1306
|
+
|
|
1307
|
+
def update_attributes(self, attributes: Union[BlinkAttributes, dict[str, Any]]):
|
|
1308
|
+
"""
|
|
1309
|
+
Updates browser attributes from a dictionary without clearing existing ones.
|
|
1310
|
+
|
|
1311
|
+
Args:
|
|
1312
|
+
attributes (Union[BlinkAttributes, dict[str, Any]]): A dictionary of attributes to set or update.
|
|
1313
|
+
|
|
1314
|
+
Raises:
|
|
1315
|
+
ValueError: If an unknown attribute key is provided.
|
|
1316
|
+
"""
|
|
1317
|
+
|
|
1318
|
+
super().update_attributes(attributes)
|
|
1319
|
+
|
|
1320
|
+
def update_experimental_options(
|
|
1321
|
+
self,
|
|
1322
|
+
experimental_options: Union[BlinkExperimentalOptions, dict[str, Any]]
|
|
1323
|
+
):
|
|
1324
|
+
"""
|
|
1325
|
+
Updates experimental options from a dictionary without clearing existing ones.
|
|
1326
|
+
|
|
1327
|
+
Args:
|
|
1328
|
+
experimental_options (Union[BlinkExperimentalOptions, dict[str, Any]]): A dictionary of experimental options to set or update.
|
|
1329
|
+
|
|
1330
|
+
Raises:
|
|
1331
|
+
ValueError: If an unknown experimental option key is provided.
|
|
1332
|
+
"""
|
|
1333
|
+
|
|
1334
|
+
super().update_experimental_options(experimental_options)
|
|
1335
|
+
|
|
1336
|
+
def update_flags(self, flags: Union[BlinkFlags, dict[str, dict[str, Any]]]):
|
|
1337
|
+
"""
|
|
1338
|
+
Updates all flags, including Blink features, without clearing existing ones.
|
|
1339
|
+
|
|
1340
|
+
This method delegates to the parent `update_flags` method, allowing it to handle
|
|
1341
|
+
all flag types defined in this manager, including 'arguments', 'experimental_options',
|
|
1342
|
+
'attributes', and 'blink_features'.
|
|
1343
|
+
|
|
1344
|
+
Args:
|
|
1345
|
+
flags (Union[BlinkFlags, dict[str, dict[str, Any]]]): A dictionary where keys are flag types
|
|
1346
|
+
and values are dictionaries of flags to update for that type.
|
|
1347
|
+
"""
|
|
1348
|
+
|
|
1349
|
+
super().update_flags(flags)
|