1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
U
[±d'Qã@s~ddlmZddlmZmZddlmZddlZddlZddl    m
Z
ddl    m Z ddl    m Z eGd    d
„d
ƒƒZ eGd d „d ƒƒZGd d„dejƒZeGdd„dƒƒZeGdd„dƒƒZddœdd„Zddœdd„Zddœdd„Zddœdd„Zdddœd d!„Zd"dd#œd$d%„Zdid&dd'œd(d)„Zdjd*d*d"dd+d,d,d,d,d-d.d/dd0œ d1d2„Zddd3œd4d5„Zddd6œd7d8„Zdkdd9dd:œd;d<„Zdld9d=dd>œd?d@„ZdAddBœdCdD„Zdmd+d+d+ddEœdFdG„Z dAddHœdIdJ„Z!d"ddKœdLdM„Z"dddNœdOdP„Z#dndd,ddQœdRdS„Z$dodd+d,d-dTdUdVœdWdX„Z%dpd9ddYœdZd[„Z&dAdd\œd]d^„Z'd*d*dd_œd`da„Z(dqdAd9d9dbddcœddde„Z)edfƒeGdgdh„dhƒƒƒZ*dS)ré)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassN)Údom)Únetwork)Úpagec@s6eZdZUdZded<ded<dd„Zedd    „ƒZd
S) ÚScreenOrientationz
    Screen orientation.
    ÚstrÚtype_ÚintÚanglecCstƒ}|j|d<|j|d<|S)NÚtyper)Údictr r©ÚselfÚjson©rúgd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v85/emulation.pyÚto_jsons
 
zScreenOrientation.to_jsoncCs|t|dƒt|dƒdS)Nrr)r r)r r ©ÚclsrrrrÚ    from_json"s
 
þzScreenOrientation.from_jsonN©Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú__annotations__rÚ classmethodrrrrrr
s
r
c@s2eZdZUded<ded<dd„Zedd„ƒZdS)    Ú MediaFeaturer ÚnameÚvaluecCstƒ}|j|d<|j|d<|S)Nr"r#)rr"r#rrrrr0s
 
zMediaFeature.to_jsoncCs|t|dƒt|dƒdS)Nr"r#)r"r#©r rrrrr6s
 
þzMediaFeature.from_jsonN)rrrrrr rrrrrr!*s
 
r!c@s0eZdZdZdZdZdZdd„Zedd„ƒZ    d    S)
ÚVirtualTimePolicya?
    advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to
    allow the next delayed task (if any) to run; pause: The virtual time base may not advance;
    pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending
    resource fetches.
    ZadvanceZpauseZpauseIfNetworkFetchesPendingcCs|jS©N)r#)rrrrrIszVirtualTimePolicy.to_jsoncCs||ƒSr&rrrrrrLszVirtualTimePolicy.from_jsonN)
rrrrZADVANCEZPAUSEZ PAUSE_IF_NETWORK_FETCHES_PENDINGrr rrrrrr%>sr%c@s6eZdZUdZded<ded<dd„Zedd„ƒZd    S)
ÚUserAgentBrandVersionúg
    Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints
    r ÚbrandÚversioncCstƒ}|j|d<|j|d<|S)Nr)r*)rr)r*rrrrrZs
 
zUserAgentBrandVersion.to_jsoncCs|t|dƒt|dƒdS)Nr)r*)r)r*r$rrrrr`s
 
þzUserAgentBrandVersion.from_jsonNrrrrrr'Qs
r'c@s^eZdZUdZded<ded<ded<ded<ded<ded    <d
ed <d d „Zedd„ƒZdS)ÚUserAgentMetadatar(z"typing.List[UserAgentBrandVersion]Úbrandsr Ú full_versionÚplatformÚplatform_versionÚ architectureÚmodelÚboolÚmobilecCsZtƒ}dd„|jDƒ|d<|j|d<|j|d<|j|d<|j|d<|j|d<|j|d    <|S)
NcSsg|] }| ¡‘qSr©r©Ú.0ÚirrrÚ
<listcomp>}sz-UserAgentMetadata.to_json.<locals>.<listcomp>r,Ú fullVersionr.ÚplatformVersionr0r1r3)rr,r-r.r/r0r1r3rrrrr{s
 
 
 
 
 
zUserAgentMetadata.to_jsonc
CsT|dd„|dDƒt|dƒt|dƒt|dƒt|dƒt|dƒt|d    ƒd
S) NcSsg|]}t |¡‘qSr)r'rr5rrrr8‰sz/UserAgentMetadata.from_json.<locals>.<listcomp>r,r9r.r:r0r1r3)r,r-r.r/r0r1r3)r r2rrrrr†s
 
 
 
 
 
ùzUserAgentMetadata.from_jsonNrrrrrr+hs
 r+z0typing.Generator[T_JSON_DICT, T_JSON_DICT, bool])Úreturnccsddi}|V}t|dƒS)z^
    Tells whether emulation is supported.
 
    :returns: True if emulation is supported.
    ÚmethodzEmulation.canEmulateÚresult)r2©Úcmd_dictrrrrÚ can_emulate“s
ÿr@z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]ccsddi}|V}dS)z/
    Clears the overridden device metrics.
    r<z$Emulation.clearDeviceMetricsOverrideNrr>rrrÚclear_device_metrics_override sÿrAccsddi}|V}dS)z?
    Clears the overridden Geolocation Position and Error.
    r<z"Emulation.clearGeolocationOverrideNrr>rrrÚclear_geolocation_overrideªsÿrBccsddi}|V}dS)z[
    Requests that page scale factor is reset to initial values.
 
    **EXPERIMENTAL**
    r<zEmulation.resetPageScaleFactorNrr>rrrÚreset_page_scale_factor´sÿrCr2)Úenabledr;ccs"tƒ}||d<d|dœ}|V}dS)zœ
    Enables or disables simulating a focused and active page.
 
    **EXPERIMENTAL**
 
    :param enabled: Whether to enable to disable focus emulation.
    rDz"Emulation.setFocusEmulationEnabled©r<ÚparamsN©r)rDrFr?rrrrÚset_focus_emulation_enabledÀs
þrHÚfloat)Úrater;ccs"tƒ}||d<d|dœ}|V}dS)z®
    Enables CPU throttling to emulate slow CPUs.
 
    **EXPERIMENTAL**
 
    :param rate: Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
    rJzEmulation.setCPUThrottlingRaterENrG)rJrFr?rrrrÚset_cpu_throttling_rateÓs
þrKztyping.Optional[dom.RGBA])Úcolorr;ccs.tƒ}|dk    r| ¡|d<d|dœ}|V}dS)a
    Sets or clears an override of the default background color of the frame. This override is used
    if the content does not specify one.
 
    :param color: *(Optional)* RGBA of the default background color. If not specified, any existing override will be cleared.
    NrLz+Emulation.setDefaultBackgroundColorOverriderE©rr)rLrFr?rrrrÚ%set_default_background_color_overrideæs     þrNr ztyping.Optional[float]ztyping.Optional[int]ztyping.Optional[bool]z"typing.Optional[ScreenOrientation]ztyping.Optional[page.Viewport]) ÚwidthÚheightÚdevice_scale_factorr3ÚscaleÚ screen_widthÚ screen_heightÚ
position_xÚ
position_yÚdont_set_visible_sizeÚscreen_orientationÚviewportr;c csÂtƒ} || d<|| d<|| d<|| d<|dk    r6|| d<|dk    rF|| d<|dk    rV|| d<|dk    rf|| d    <|dk    rv|| d
<|    dk    r†|    | d <|
dk    rš|
 ¡| d <| dk    r®|  ¡| d <d| dœ} | V}dS)a·
    Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
    query results).
 
    :param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param device_scale_factor: Overriding device scale factor value. 0 disables the override.
    :param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
    :param scale: **(EXPERIMENTAL)** *(Optional)* Scale to apply to resulting view image.
    :param screen_width: **(EXPERIMENTAL)** *(Optional)* Overriding screen width value in pixels (minimum 0, maximum 10000000).
    :param screen_height: **(EXPERIMENTAL)** *(Optional)* Overriding screen height value in pixels (minimum 0, maximum 10000000).
    :param position_x: **(EXPERIMENTAL)** *(Optional)* Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
    :param position_y: **(EXPERIMENTAL)** *(Optional)* Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
    :param dont_set_visible_size: **(EXPERIMENTAL)** *(Optional)* Do not set visible view size, rely upon explicit setVisibleSize call.
    :param screen_orientation: *(Optional)* Screen orientation override.
    :param viewport: **(EXPERIMENTAL)** *(Optional)* If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
    rOrPZdeviceScaleFactorr3NrRZ screenWidthZ screenHeightZ    positionXZ    positionYZdontSetVisibleSizeZscreenOrientationrYz"Emulation.setDeviceMetricsOverriderErM)rOrPrQr3rRrSrTrUrVrWrXrYrFr?rrrrÚset_device_metrics_overrideùs2   þrZ)Úhiddenr;ccs"tƒ}||d<d|dœ}|V}dS)z\
 
 
    **EXPERIMENTAL**
 
    :param hidden: Whether scrollbars should be always hidden.
    r[zEmulation.setScrollbarsHiddenrENrG)r[rFr?rrrrÚset_scrollbars_hidden5s
þr\)Údisabledr;ccs"tƒ}||d<d|dœ}|V}dS)zc
 
 
    **EXPERIMENTAL**
 
    :param disabled: Whether document.coookie API should be disabled.
    r]z#Emulation.setDocumentCookieDisabledrENrG)r]rFr?rrrrÚset_document_cookie_disabledHs
þr^ztyping.Optional[str])rDÚ configurationr;ccs2tƒ}||d<|dk    r||d<d|dœ}|V}dS)z×
 
 
    **EXPERIMENTAL**
 
    :param enabled: Whether touch emulation based on mouse input should be enabled.
    :param configuration: *(Optional)* Touch/gesture events configuration. Default: current platform.
    rDNr_z$Emulation.setEmitTouchEventsForMouserErG)rDr_rFr?rrrrÚset_emit_touch_events_for_mouse[s þr`z*typing.Optional[typing.List[MediaFeature]])ÚmediaÚfeaturesr;ccsDtƒ}|dk    r||d<|dk    r0dd„|Dƒ|d<d|dœ}|V}dS)zç
    Emulates the given media type or media feature for CSS media queries.
 
    :param media: *(Optional)* Media type to emulate. Empty string disables the override.
    :param features: *(Optional)* Media features to emulate.
    NracSsg|] }| ¡‘qSrr4r5rrrr8€sz&set_emulated_media.<locals>.<listcomp>rbzEmulation.setEmulatedMediarErG)rarbrFr?rrrrÚset_emulated_mediars
þrcr )r r;ccs"tƒ}||d<d|dœ}|V}dS)zv
    Emulates the given vision deficiency.
 
    **EXPERIMENTAL**
 
    :param type_: Vision deficiency to emulate.
    rz%Emulation.setEmulatedVisionDeficiencyrENrG)r rFr?rrrrÚset_emulated_vision_deficiencyˆs
þrd)ÚlatitudeÚ    longitudeÚaccuracyr;ccsJtƒ}|dk    r||d<|dk    r&||d<|dk    r6||d<d|dœ}|V}dS)a 
    Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
    unavailable.
 
    :param latitude: *(Optional)* Mock latitude
    :param longitude: *(Optional)* Mock longitude
    :param accuracy: *(Optional)* Mock accuracy
    Nrerfrgz Emulation.setGeolocationOverriderErG)rerfrgrFr?rrrrÚset_geolocation_override›s þrh)r.r;ccs"tƒ}||d<d|dœ}|V}dS)z¡
    Overrides value returned by the javascript navigator object.
 
    **EXPERIMENTAL**
 
    :param platform: The platform navigator.platform should return.
    r.zEmulation.setNavigatorOverridesrENrG)r.rFr?rrrrÚset_navigator_overrides¶s
þri)Úpage_scale_factorr;ccs"tƒ}||d<d|dœ}|V}dS)zu
    Sets a specified page scale factor.
 
    **EXPERIMENTAL**
 
    :param page_scale_factor: Page scale factor.
    ZpageScaleFactorzEmulation.setPageScaleFactorrENrG)rjrFr?rrrrÚset_page_scale_factorÉs
þrk)r#r;ccs"tƒ}||d<d|dœ}|V}dS)z|
    Switches script execution in the page.
 
    :param value: Whether script execution should be disabled in the page.
    r#z$Emulation.setScriptExecutionDisabledrENrG)r#rFr?rrrrÚset_script_execution_disabledÜs þrl)rDÚmax_touch_pointsr;ccs2tƒ}||d<|dk    r||d<d|dœ}|V}dS)zä
    Enables touch on platforms which do not support them.
 
    :param enabled: Whether the touch event emulation should be enabled.
    :param max_touch_points: *(Optional)* Maximum touch points supported. Defaults to one.
    rDNZmaxTouchPointsz"Emulation.setTouchEmulationEnabledrErG)rDrmrFr?rrrrÚset_touch_emulation_enabledís
þrnz'typing.Optional[network.TimeSinceEpoch]z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])ÚpolicyÚbudgetÚ&max_virtual_time_task_starvation_countÚwait_for_navigationÚinitial_virtual_timer;ccsrtƒ}| ¡|d<|dk    r"||d<|dk    r2||d<|dk    rB||d<|dk    rV| ¡|d<d|dœ}|V}t|d    ƒS)
aä
    Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
    the current virtual time policy.  Note this supersedes any previous time budget.
 
    **EXPERIMENTAL**
 
    :param policy:
    :param budget: *(Optional)* If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
    :param max_virtual_time_task_starvation_count: *(Optional)* If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
    :param wait_for_navigation: *(Optional)* If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
    :param initial_virtual_time: *(Optional)* If set, base::Time::Now will be overridden to initially return this value.
    :returns: Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
    roNrpZ!maxVirtualTimeTaskStarvationCountZwaitForNavigationZinitialVirtualTimezEmulation.setVirtualTimePolicyrEZvirtualTimeTicksBase)rrrI)rorprqrrrsrFr?rrrrÚset_virtual_time_policys  þrt)Úlocaler;ccs*tƒ}|dk    r||d<d|dœ}|V}dS)zú
    Overrides default host system locale with the specified one.
 
    **EXPERIMENTAL**
 
    :param locale: *(Optional)* ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
    NruzEmulation.setLocaleOverriderErG)rurFr?rrrrÚset_locale_override(s
þrv)Ú timezone_idr;ccs"tƒ}||d<d|dœ}|V}dS)zÛ
    Overrides default host system timezone with the specified one.
 
    **EXPERIMENTAL**
 
    :param timezone_id: The timezone identifier. If empty, disables the override and restores default host system timezone.
    Z
timezoneIdzEmulation.setTimezoneOverriderENrG)rwrFr?rrrrÚset_timezone_override<s
þrx)rOrPr;ccs*tƒ}||d<||d<d|dœ}|V}dS)a<
    Resizes the frame/viewport of the page. Note that this does not affect the frame's container
    (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported
    on Android.
 
    **EXPERIMENTAL**
 
    :param width: Frame width (DIP).
    :param height: Frame height (DIP).
    rOrPzEmulation.setVisibleSizerENrG)rOrPrFr?rrrrÚset_visible_sizeOsþryz"typing.Optional[UserAgentMetadata])Ú
user_agentÚaccept_languager.Úuser_agent_metadatar;ccsVtƒ}||d<|dk    r||d<|dk    r.||d<|dk    rB| ¡|d<d|dœ}|V}dS)aŠ
    Allows overriding user agent with the given string.
 
    :param user_agent: User agent to use.
    :param accept_language: *(Optional)* Browser langugage to emulate.
    :param platform: *(Optional)* The platform navigator.platform should return.
    :param user_agent_metadata: **(EXPERIMENTAL)** *(Optional)* To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
    Z    userAgentNZacceptLanguager.ZuserAgentMetadatazEmulation.setUserAgentOverriderErM)rzr{r.r|rFr?rrrrÚset_user_agent_overridegs þr}z"Emulation.virtualTimeBudgetExpiredc@s$eZdZdZedddœdd„ƒZdS)ÚVirtualTimeBudgetExpiredz~
    **EXPERIMENTAL**
 
    Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
    r)rr;cCs|ƒSr&rrrrrrŽsz"VirtualTimeBudgetExpired.from_jsonN)rrrrr rrrrrr~„sr~)N)NNNNNNNN)N)NN)NNN)N)NNNN)N)NNN)+Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingÚrrr    r
r!ÚEnumr%r'r+r@rArBrCrHrKrNrZr\r^r`rcrdrhrirkrlrnrtrvrxryr}r~rrrrÚ<module>s„     * 
 
 ÿô(<þþýþû'ÿü