@@ -92,8 +92,6 @@ def resource_type(self) -> str:
92
92
following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`, `eventsource`,
93
93
`websocket`, `manifest`, `other`.
94
94
95
- > NOTE: The resource types are available as constants in [ResourceTypes].
96
-
97
95
Returns
98
96
-------
99
97
str
@@ -8641,11 +8639,14 @@ async def new_context(
8641
8639
option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example
8642
8640
`launch({ proxy: { server: 'per-context' } })`.
8643
8641
record_har_path : Union[pathlib.Path, str, NoneType]
8644
- Path on the filesystem to write the HAR file to.
8642
+ Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the
8643
+ filesystem. If not specified, the HAR is not recorded. Make sure to call `browser_context.close()` for the HAR to
8644
+ be saved.
8645
8645
record_har_omit_content : Union[bool, NoneType]
8646
8646
Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
8647
8647
record_video_dir : Union[pathlib.Path, str, NoneType]
8648
- Path to the directory to put videos into.
8648
+ Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure
8649
+ to call `browser_context.close()` for videos to be saved.
8649
8650
record_video_size : Union[{width: int, height: int}, NoneType]
8650
8651
Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into
8651
8652
800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will
@@ -8778,11 +8779,14 @@ async def new_page(
8778
8779
option to work. If all contexts override the proxy, global proxy will be never used and can be any string, for example
8779
8780
`launch({ proxy: { server: 'per-context' } })`.
8780
8781
record_har_path : Union[pathlib.Path, str, NoneType]
8781
- Path on the filesystem to write the HAR file to.
8782
+ Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the
8783
+ filesystem. If not specified, the HAR is not recorded. Make sure to call `browser_context.close()` for the HAR to
8784
+ be saved.
8782
8785
record_har_omit_content : Union[bool, NoneType]
8783
8786
Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
8784
8787
record_video_dir : Union[pathlib.Path, str, NoneType]
8785
- Path to the directory to put videos into.
8788
+ Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure
8789
+ to call `browser_context.close()` for videos to be saved.
8786
8790
record_video_size : Union[{width: int, height: int}, NoneType]
8787
8791
Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into
8788
8792
800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will
@@ -8882,7 +8886,16 @@ async def launch(
8882
8886
self ,
8883
8887
* ,
8884
8888
executable_path : typing .Union [str , pathlib .Path ] = None ,
8885
- channel : str = None ,
8889
+ channel : Literal [
8890
+ "chrome" ,
8891
+ "chrome-beta" ,
8892
+ "chrome-canary" ,
8893
+ "chrome-dev" ,
8894
+ "msedge" ,
8895
+ "msedge-beta" ,
8896
+ "msedge-canary" ,
8897
+ "msedge-dev" ,
8898
+ ] = None ,
8886
8899
args : typing .List [str ] = None ,
8887
8900
ignore_default_args : typing .Union [bool , typing .List [str ]] = None ,
8888
8901
handle_sigint : bool = None ,
@@ -8933,16 +8946,8 @@ async def launch(
8933
8946
Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is
8934
8947
resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox
8935
8948
or WebKit, use at your own risk.
8936
- channel : Union[str, NoneType]
8937
- Chromium distribution channel, one of
8938
- - chrome
8939
- - chrome-beta
8940
- - chrome-dev
8941
- - chrome-canary
8942
- - msedge
8943
- - msedge-beta
8944
- - msedge-dev
8945
- - msedge-canary
8949
+ channel : Union["chrome", "chrome-beta", "chrome-canary", "chrome-dev", "msedge", "msedge-beta", "msedge-canary", "msedge-dev", NoneType]
8950
+ Browser distribution channel.
8946
8951
args : Union[List[str], NoneType]
8947
8952
Additional arguments to pass to the browser instance. The list of Chromium flags can be found
8948
8953
[here](http://peter.sh/experiments/chromium-command-line-switches/).
@@ -9014,7 +9019,16 @@ async def launch_persistent_context(
9014
9019
self ,
9015
9020
user_data_dir : typing .Union [str , pathlib .Path ],
9016
9021
* ,
9017
- channel : str = None ,
9022
+ channel : Literal [
9023
+ "chrome" ,
9024
+ "chrome-beta" ,
9025
+ "chrome-canary" ,
9026
+ "chrome-dev" ,
9027
+ "msedge" ,
9028
+ "msedge-beta" ,
9029
+ "msedge-canary" ,
9030
+ "msedge-dev" ,
9031
+ ] = None ,
9018
9032
executable_path : typing .Union [str , pathlib .Path ] = None ,
9019
9033
args : typing .List [str ] = None ,
9020
9034
ignore_default_args : typing .Union [bool , typing .List [str ]] = None ,
@@ -9066,16 +9080,8 @@ async def launch_persistent_context(
9066
9080
[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
9067
9081
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's user
9068
9082
data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`.
9069
- channel : Union[str, NoneType]
9070
- Chromium distribution channel, one of
9071
- - chrome
9072
- - chrome-beta
9073
- - chrome-dev
9074
- - chrome-canary
9075
- - msedge
9076
- - msedge-beta
9077
- - msedge-dev
9078
- - msedge-canary
9083
+ channel : Union["chrome", "chrome-beta", "chrome-canary", "chrome-dev", "msedge", "msedge-beta", "msedge-canary", "msedge-dev", NoneType]
9084
+ Browser distribution channel.
9079
9085
executable_path : Union[pathlib.Path, str, NoneType]
9080
9086
Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is
9081
9087
resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled
@@ -9157,11 +9163,14 @@ async def launch_persistent_context(
9157
9163
chromium_sandbox : Union[bool, NoneType]
9158
9164
Enable Chromium sandboxing. Defaults to `true`.
9159
9165
record_har_path : Union[pathlib.Path, str, NoneType]
9160
- Path on the filesystem to write the HAR file to.
9166
+ Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the
9167
+ filesystem. If not specified, the HAR is not recorded. Make sure to call `browser_context.close()` for the HAR to
9168
+ be saved.
9161
9169
record_har_omit_content : Union[bool, NoneType]
9162
9170
Optional setting to control whether to omit request content from the HAR. Defaults to `false`.
9163
9171
record_video_dir : Union[pathlib.Path, str, NoneType]
9164
- Path to the directory to put videos into.
9172
+ Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure
9173
+ to call `browser_context.close()` for videos to be saved.
9165
9174
record_video_size : Union[{width: int, height: int}, NoneType]
9166
9175
Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into
9167
9176
800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will
0 commit comments