|
31 | 31 | from ..types.browser_pool import BrowserPool |
32 | 32 | from ..types.browser_network_config_param import BrowserNetworkConfigParam |
33 | 33 | from ..types.browser_pool_acquire_response import BrowserPoolAcquireResponse |
| 34 | +from ..types.shared_params.browser_profile import BrowserProfile |
34 | 35 | from ..types.shared_params.browser_viewport import BrowserViewport |
35 | 36 | from ..types.shared_params.browser_extension import BrowserExtension |
36 | 37 |
|
@@ -509,6 +510,7 @@ def acquire( |
509 | 510 | *, |
510 | 511 | acquire_timeout_seconds: int | Omit = omit, |
511 | 512 | name: str | Omit = omit, |
| 513 | + profile: BrowserProfile | Omit = omit, |
512 | 514 | start_url: str | Omit = omit, |
513 | 515 | tags: TagsParam | Omit = omit, |
514 | 516 | telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, |
@@ -536,6 +538,10 @@ def acquire( |
536 | 538 | project. Applies to this lease only and is cleared when the browser is released |
537 | 539 | back to the pool. |
538 | 540 |
|
| 541 | + profile: Profile selection for the browser session. Provide either id or name. If |
| 542 | + specified, the matching profile will be loaded into the browser session. |
| 543 | + Profiles must be created beforehand. |
| 544 | +
|
539 | 545 | start_url: Optional URL to navigate the acquired browser to. Overrides the pool's start_url |
540 | 546 | for this acquire only. Best-effort: failures to navigate do not fail the |
541 | 547 | acquire. |
@@ -569,6 +575,7 @@ def acquire( |
569 | 575 | { |
570 | 576 | "acquire_timeout_seconds": acquire_timeout_seconds, |
571 | 577 | "name": name, |
| 578 | + "profile": profile, |
572 | 579 | "start_url": start_url, |
573 | 580 | "tags": tags, |
574 | 581 | "telemetry": telemetry, |
@@ -638,7 +645,8 @@ def release( |
638 | 645 | Defaults to true. A reused browser keeps the configuration it was created with, |
639 | 646 | so it does not pick up pool configuration changes made while it was in use. |
640 | 647 | Release with `reuse: false`, or flush the pool afterward, to rebuild it with the |
641 | | - current configuration. |
| 648 | + current configuration. Browsers loaded with an acquire-time profile are always |
| 649 | + destroyed and replaced, even when reuse is true. |
642 | 650 |
|
643 | 651 | extra_headers: Send extra headers |
644 | 652 |
|
@@ -1139,6 +1147,7 @@ async def acquire( |
1139 | 1147 | *, |
1140 | 1148 | acquire_timeout_seconds: int | Omit = omit, |
1141 | 1149 | name: str | Omit = omit, |
| 1150 | + profile: BrowserProfile | Omit = omit, |
1142 | 1151 | start_url: str | Omit = omit, |
1143 | 1152 | tags: TagsParam | Omit = omit, |
1144 | 1153 | telemetry: Optional[browser_pool_acquire_params.Telemetry] | Omit = omit, |
@@ -1166,6 +1175,10 @@ async def acquire( |
1166 | 1175 | project. Applies to this lease only and is cleared when the browser is released |
1167 | 1176 | back to the pool. |
1168 | 1177 |
|
| 1178 | + profile: Profile selection for the browser session. Provide either id or name. If |
| 1179 | + specified, the matching profile will be loaded into the browser session. |
| 1180 | + Profiles must be created beforehand. |
| 1181 | +
|
1169 | 1182 | start_url: Optional URL to navigate the acquired browser to. Overrides the pool's start_url |
1170 | 1183 | for this acquire only. Best-effort: failures to navigate do not fail the |
1171 | 1184 | acquire. |
@@ -1199,6 +1212,7 @@ async def acquire( |
1199 | 1212 | { |
1200 | 1213 | "acquire_timeout_seconds": acquire_timeout_seconds, |
1201 | 1214 | "name": name, |
| 1215 | + "profile": profile, |
1202 | 1216 | "start_url": start_url, |
1203 | 1217 | "tags": tags, |
1204 | 1218 | "telemetry": telemetry, |
@@ -1268,7 +1282,8 @@ async def release( |
1268 | 1282 | Defaults to true. A reused browser keeps the configuration it was created with, |
1269 | 1283 | so it does not pick up pool configuration changes made while it was in use. |
1270 | 1284 | Release with `reuse: false`, or flush the pool afterward, to rebuild it with the |
1271 | | - current configuration. |
| 1285 | + current configuration. Browsers loaded with an acquire-time profile are always |
| 1286 | + destroyed and replaced, even when reuse is true. |
1272 | 1287 |
|
1273 | 1288 | extra_headers: Send extra headers |
1274 | 1289 |
|
|
0 commit comments