Skip to content

Commit 3a75e81

Browse files
feat: Add disable_default_proxy for stealth browsers
1 parent c798c39 commit 3a75e81

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 104
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-aeb5ea5c2632fe7fd905d509bc6cbb06999d17c458ec44ffd713935ba5b848f9.yml
3-
openapi_spec_hash: fef45a8569f1d3de04c86e95b1112665
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-20310988401243aa5c4a2e2ac6cba5dd90873fb7b83497a2d50c691352c0dd7b.yml
3+
openapi_spec_hash: e19e650b4b2c8c8fde1f739c4aab6b33
44
config_hash: 16e4457a0bb26e98a335a1c2a572290a

src/kernel/resources/browsers/browsers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ def update(
286286
self,
287287
id: str,
288288
*,
289+
disable_default_proxy: bool | Omit = omit,
289290
profile: BrowserProfile | Omit = omit,
290291
proxy_id: Optional[str] | Omit = omit,
291292
viewport: browser_update_params.Viewport | Omit = omit,
@@ -300,6 +301,9 @@ def update(
300301
Update a browser session.
301302
302303
Args:
304+
disable_default_proxy: If true, stealth browsers connect directly instead of using the default stealth
305+
proxy.
306+
303307
profile: Profile to load into the browser session. Only allowed if the session does not
304308
already have a profile loaded.
305309
@@ -322,6 +326,7 @@ def update(
322326
path_template("/browsers/{id}", id=id),
323327
body=maybe_transform(
324328
{
329+
"disable_default_proxy": disable_default_proxy,
325330
"profile": profile,
326331
"proxy_id": proxy_id,
327332
"viewport": viewport,
@@ -717,6 +722,7 @@ async def update(
717722
self,
718723
id: str,
719724
*,
725+
disable_default_proxy: bool | Omit = omit,
720726
profile: BrowserProfile | Omit = omit,
721727
proxy_id: Optional[str] | Omit = omit,
722728
viewport: browser_update_params.Viewport | Omit = omit,
@@ -731,6 +737,9 @@ async def update(
731737
Update a browser session.
732738
733739
Args:
740+
disable_default_proxy: If true, stealth browsers connect directly instead of using the default stealth
741+
proxy.
742+
734743
profile: Profile to load into the browser session. Only allowed if the session does not
735744
already have a profile loaded.
736745
@@ -753,6 +762,7 @@ async def update(
753762
path_template("/browsers/{id}", id=id),
754763
body=await async_maybe_transform(
755764
{
765+
"disable_default_proxy": disable_default_proxy,
756766
"profile": profile,
757767
"proxy_id": proxy_id,
758768
"viewport": viewport,

src/kernel/types/browser_update_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212

1313

1414
class BrowserUpdateParams(TypedDict, total=False):
15+
disable_default_proxy: bool
16+
"""
17+
If true, stealth browsers connect directly instead of using the default stealth
18+
proxy.
19+
"""
20+
1521
profile: BrowserProfile
1622
"""Profile to load into the browser session.
1723

tests/api_resources/test_browsers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def test_method_update(self, client: Kernel) -> None:
148148
def test_method_update_with_all_params(self, client: Kernel) -> None:
149149
browser = client.browsers.update(
150150
id="htzv5orfit78e1m2biiifpbv",
151+
disable_default_proxy=True,
151152
profile={
152153
"id": "id",
153154
"name": "name",
@@ -512,6 +513,7 @@ async def test_method_update(self, async_client: AsyncKernel) -> None:
512513
async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> None:
513514
browser = await async_client.browsers.update(
514515
id="htzv5orfit78e1m2biiifpbv",
516+
disable_default_proxy=True,
515517
profile={
516518
"id": "id",
517519
"name": "name",

0 commit comments

Comments
 (0)