Skip to content

Commit 4dbaa7a

Browse files
committed
Merge remote-tracking branch 'origin/docs_updates'
2 parents 4881346 + dca77a4 commit 4dbaa7a

33 files changed

Lines changed: 1038 additions & 517 deletions

cdp/accessibility.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,14 @@ def get_partial_ax_tree(
417417
fetch_relatives: typing.Optional[bool] = None
418418
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List['AXNode']]:
419419
'''
420+
**EXPERIMENTAL**
421+
420422
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
421423
422-
:param node_id: Identifier of the node to get the partial accessibility tree for.
423-
:param backend_node_id: Identifier of the backend node to get the partial accessibility tree for.
424-
:param object_id: JavaScript object id of the node wrapper to get the partial accessibility tree for.
425-
:param fetch_relatives: Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
424+
:param node_id: *(Optional)* Identifier of the node to get the partial accessibility tree for.
425+
:param backend_node_id: *(Optional)* Identifier of the backend node to get the partial accessibility tree for.
426+
:param object_id: *(Optional)* JavaScript object id of the node wrapper to get the partial accessibility tree for.
427+
:param fetch_relatives: *(Optional)* Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
426428
:returns: The ``Accessibility.AXNode`` for this DOM node, if it exists, plus its ancestors, siblings and
427429
children, if requested.
428430
'''
@@ -445,6 +447,8 @@ def get_partial_ax_tree(
445447

446448
def get_full_ax_tree() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List['AXNode']]:
447449
'''
450+
**EXPERIMENTAL**
451+
448452
Fetches the entire accessibility tree
449453
450454
:returns:

cdp/audits.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ def get_encoded_response(
2828
2929
:param request_id: Identifier of the network request to get content for.
3030
:param encoding: The encoding to use.
31-
:param quality: The quality of the encoding (0-1). (defaults to 1)
32-
:param size_only: Whether to only return the size information (defaults to false).
33-
:returns: a tuple with the following items:
34-
0. body: (Optional) The encoded body as a base64 string. Omitted if sizeOnly is true.
35-
1. originalSize: Size before re-encoding.
36-
2. encodedSize: Size after re-encoding.
31+
:param quality: *(Optional)* The quality of the encoding (0-1). (defaults to 1)
32+
:param size_only: *(Optional)* Whether to only return the size information (defaults to false).
33+
:returns: A tuple with the following items:
34+
35+
1. **body** - *(Optional)* The encoded body as a base64 string. Omitted if sizeOnly is true.
36+
2. **originalSize** - Size before re-encoding.
37+
3. **encodedSize** - Size after re-encoding.
3738
'''
3839
params: T_JSON_DICT = dict()
3940
params['requestId'] = request_id.to_json()

cdp/browser.py

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ def grant_permissions(
191191
browser_context_id: typing.Optional['target.BrowserContextID'] = None
192192
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
193193
'''
194+
**EXPERIMENTAL**
195+
194196
Grant specific permissions to the given origin and reject all others.
195197
196198
:param origin:
197199
:param permissions:
198-
:param browser_context_id: BrowserContext to override permissions. When omitted, default browser context is used.
200+
:param browser_context_id: *(Optional)* BrowserContext to override permissions. When omitted, default browser context is used.
199201
'''
200202
params: T_JSON_DICT = dict()
201203
params['origin'] = origin
@@ -213,9 +215,11 @@ def reset_permissions(
213215
browser_context_id: typing.Optional['target.BrowserContextID'] = None
214216
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
215217
'''
218+
**EXPERIMENTAL**
219+
216220
Reset all permission management for all origins.
217221
218-
:param browser_context_id: BrowserContext to reset permissions. When omitted, default browser context is used.
222+
:param browser_context_id: *(Optional)* BrowserContext to reset permissions. When omitted, default browser context is used.
219223
'''
220224
params: T_JSON_DICT = dict()
221225
if browser_context_id is not None:
@@ -239,6 +243,8 @@ def close() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
239243

240244
def crash() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
241245
'''
246+
**EXPERIMENTAL**
247+
242248
Crashes browser on the main thread.
243249
'''
244250
cmd_dict: T_JSON_DICT = {
@@ -249,6 +255,8 @@ def crash() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
249255

250256
def crash_gpu_process() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
251257
'''
258+
**EXPERIMENTAL**
259+
252260
Crashes GPU process.
253261
'''
254262
cmd_dict: T_JSON_DICT = {
@@ -261,12 +269,13 @@ def get_version() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str,
261269
'''
262270
Returns version information.
263271
264-
:returns: a tuple with the following items:
265-
0. protocolVersion: Protocol version.
266-
1. product: Product name.
267-
2. revision: Product revision.
268-
3. userAgent: User-Agent.
269-
4. jsVersion: V8 version.
272+
:returns: A tuple with the following items:
273+
274+
1. **protocolVersion** - Protocol version.
275+
2. **product** - Product name.
276+
3. **revision** - Product revision.
277+
4. **userAgent** - User-Agent.
278+
5. **jsVersion** - V8 version.
270279
'''
271280
cmd_dict: T_JSON_DICT = {
272281
'method': 'Browser.getVersion',
@@ -283,6 +292,8 @@ def get_version() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str,
283292

284293
def get_browser_command_line() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]:
285294
'''
295+
**EXPERIMENTAL**
296+
286297
Returns the command line switches for the browser process if, and only if
287298
--enable-automation is on the commandline.
288299
@@ -300,10 +311,12 @@ def get_histograms(
300311
delta: typing.Optional[bool] = None
301312
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List['Histogram']]:
302313
'''
314+
**EXPERIMENTAL**
315+
303316
Get Chrome histograms.
304317
305-
:param query: Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
306-
:param delta: If true, retrieve delta since last call.
318+
:param query: *(Optional)* Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
319+
:param delta: *(Optional)* If true, retrieve delta since last call.
307320
:returns: Histograms.
308321
'''
309322
params: T_JSON_DICT = dict()
@@ -324,10 +337,12 @@ def get_histogram(
324337
delta: typing.Optional[bool] = None
325338
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,'Histogram']:
326339
'''
340+
**EXPERIMENTAL**
341+
327342
Get a Chrome histogram by name.
328343
329344
:param name: Requested histogram name.
330-
:param delta: If true, retrieve delta since last call.
345+
:param delta: *(Optional)* If true, retrieve delta since last call.
331346
:returns: Histogram.
332347
'''
333348
params: T_JSON_DICT = dict()
@@ -346,6 +361,8 @@ def get_window_bounds(
346361
window_id: 'WindowID'
347362
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,'Bounds']:
348363
'''
364+
**EXPERIMENTAL**
365+
349366
Get position and size of the browser window.
350367
351368
:param window_id: Browser window id.
@@ -366,12 +383,15 @@ def get_window_for_target(
366383
target_id: typing.Optional['target.TargetID'] = None
367384
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple['WindowID', 'Bounds']]:
368385
'''
386+
**EXPERIMENTAL**
387+
369388
Get the browser window that contains the devtools target.
370389
371-
:param target_id: Devtools agent host id. If called as a part of the session, associated targetId is used.
372-
:returns: a tuple with the following items:
373-
0. windowId: Browser window id.
374-
1. bounds: Bounds information of the window. When window state is 'minimized', the restored window
390+
:param target_id: *(Optional)* Devtools agent host id. If called as a part of the session, associated targetId is used.
391+
:returns: A tuple with the following items:
392+
393+
1. **windowId** - Browser window id.
394+
2. **bounds** - Bounds information of the window. When window state is 'minimized', the restored window
375395
position and size are returned.
376396
'''
377397
params: T_JSON_DICT = dict()
@@ -393,6 +413,8 @@ def set_window_bounds(
393413
bounds: 'Bounds'
394414
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
395415
'''
416+
**EXPERIMENTAL**
417+
396418
Set position and/or size of the browser window.
397419
398420
:param window_id: Browser window id.
@@ -413,10 +435,12 @@ def set_dock_tile(
413435
image: typing.Optional[str] = None
414436
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
415437
'''
438+
**EXPERIMENTAL**
439+
416440
Set dock tile details, platform-specific.
417441
418-
:param badge_label:
419-
:param image: Png encoded image.
442+
:param badge_label: *(Optional)*
443+
:param image: *(Optional)* Png encoded image.
420444
'''
421445
params: T_JSON_DICT = dict()
422446
if badge_label is not None:

cdp/cache_storage.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ def request_entries(
266266
:param cache_id: ID of cache to get entries from.
267267
:param skip_count: Number of records to skip.
268268
:param page_size: Number of records to fetch.
269-
:param path_filter: If present, only return the entries containing this substring in the path
270-
:returns: a tuple with the following items:
271-
0. cacheDataEntries: Array of object store data entries.
272-
1. returnCount: Count of returned entries from this storage. If pathFilter is empty, it
269+
:param path_filter: *(Optional)* If present, only return the entries containing this substring in the path
270+
:returns: A tuple with the following items:
271+
272+
1. **cacheDataEntries** - Array of object store data entries.
273+
2. **returnCount** - Count of returned entries from this storage. If pathFilter is empty, it
273274
is the count of all entries from this storage.
274275
'''
275276
params: T_JSON_DICT = dict()

cdp/cast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def enable(
5151
Also starts observing for issue messages. When an issue is added or removed,
5252
an |issueUpdated| event is fired.
5353
54-
:param presentation_url:
54+
:param presentation_url: *(Optional)*
5555
'''
5656
params: T_JSON_DICT = dict()
5757
if presentation_url is not None:

cdp/css.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -937,14 +937,15 @@ def get_background_colors(
937937
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[typing.List[str]], typing.Optional[str], typing.Optional[str]]]:
938938
'''
939939
:param node_id: Id of the node to get background colors for.
940-
:returns: a tuple with the following items:
941-
0. backgroundColors: (Optional) The range of background colors behind this element, if it contains any visible text. If no
940+
:returns: A tuple with the following items:
941+
942+
1. **backgroundColors** - *(Optional)* The range of background colors behind this element, if it contains any visible text. If no
942943
visible text is present, this will be undefined. In the case of a flat background color,
943944
this will consist of simply that color. In the case of a gradient, this will consist of each
944945
of the color stops. For anything more complicated, this will be an empty array. Images will
945946
be ignored (as if the image had failed to load).
946-
1. computedFontSize: (Optional) The computed font size for this node, as a CSS computed value string (e.g. '12px').
947-
2. computedFontWeight: (Optional) The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or
947+
2. **computedFontSize** - *(Optional)* The computed font size for this node, as a CSS computed value string (e.g. '12px').
948+
3. **computedFontWeight** - *(Optional)* The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or
948949
'100').
949950
'''
950951
params: T_JSON_DICT = dict()
@@ -988,9 +989,10 @@ def get_inline_styles_for_node(
988989
attributes) for a DOM node identified by `nodeId`.
989990
990991
:param node_id:
991-
:returns: a tuple with the following items:
992-
0. inlineStyle: (Optional) Inline style for the specified DOM node.
993-
1. attributesStyle: (Optional) Attribute-defined element style (e.g. resulting from "width=20 height=100%").
992+
:returns: A tuple with the following items:
993+
994+
1. **inlineStyle** - *(Optional)* Inline style for the specified DOM node.
995+
2. **attributesStyle** - *(Optional)* Attribute-defined element style (e.g. resulting from "width=20 height=100%").
994996
'''
995997
params: T_JSON_DICT = dict()
996998
params['nodeId'] = node_id.to_json()
@@ -1012,13 +1014,14 @@ def get_matched_styles_for_node(
10121014
Returns requested styles for a DOM node identified by `nodeId`.
10131015
10141016
:param node_id:
1015-
:returns: a tuple with the following items:
1016-
0. inlineStyle: (Optional) Inline style for the specified DOM node.
1017-
1. attributesStyle: (Optional) Attribute-defined element style (e.g. resulting from "width=20 height=100%").
1018-
2. matchedCSSRules: (Optional) CSS rules matching this node, from all applicable stylesheets.
1019-
3. pseudoElements: (Optional) Pseudo style matches for this node.
1020-
4. inherited: (Optional) A chain of inherited styles (from the immediate node parent up to the DOM tree root).
1021-
5. cssKeyframesRules: (Optional) A list of CSS keyframed animations matching this node.
1017+
:returns: A tuple with the following items:
1018+
1019+
1. **inlineStyle** - *(Optional)* Inline style for the specified DOM node.
1020+
2. **attributesStyle** - *(Optional)* Attribute-defined element style (e.g. resulting from "width=20 height=100%").
1021+
3. **matchedCSSRules** - *(Optional)* CSS rules matching this node, from all applicable stylesheets.
1022+
4. **pseudoElements** - *(Optional)* Pseudo style matches for this node.
1023+
5. **inherited** - *(Optional)* A chain of inherited styles (from the immediate node parent up to the DOM tree root).
1024+
6. **cssKeyframesRules** - *(Optional)* A list of CSS keyframed animations matching this node.
10221025
'''
10231026
params: T_JSON_DICT = dict()
10241027
params['nodeId'] = node_id.to_json()
@@ -1197,7 +1200,7 @@ def set_style_sheet_text(
11971200
11981201
:param style_sheet_id:
11991202
:param text:
1200-
:returns: (Optional) URL of source map associated with script (if any).
1203+
:returns: *(Optional)* URL of source map associated with script (if any).
12011204
'''
12021205
params: T_JSON_DICT = dict()
12031206
params['styleSheetId'] = style_sheet_id.to_json()

cdp/database.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ def execute_sql(
116116
'''
117117
:param database_id:
118118
:param query:
119-
:returns: a tuple with the following items:
120-
0. columnNames:
121-
1. values:
122-
2. sqlError:
119+
:returns: A tuple with the following items:
120+
121+
1. **columnNames** -
122+
2. **values** -
123+
3. **sqlError** -
123124
'''
124125
params: T_JSON_DICT = dict()
125126
params['databaseId'] = database_id.to_json()

0 commit comments

Comments
 (0)