Skip to content

Commit 126cf6d

Browse files
docs: document and un-gate allowedDomains session setting
1 parent 2930a99 commit 126cf6d

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-a896c28015c625eaa4efd6319489dc91c932a6ab17780c5e1bf3648bd4bed9c7.yml
3-
openapi_spec_hash: a1ee972826c5331971d4d9b437f9e6d5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-325727e382d1635cdcff3d81e93432c314290a644a5252095fc9d23350e8fbae.yml
3+
openapi_spec_hash: 1c0874c5d6253bdf144e617203d788c7
44
config_hash: d4b0c534eaf7665ea25168e0e824c9d3

src/browserbase/types/session_create_params.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ class BrowserSettings(TypedDict, total=False):
9090
advanced_stealth: Annotated[bool, PropertyInfo(alias="advancedStealth")]
9191
"""Advanced Browser Stealth Mode"""
9292

93+
allowed_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="allowedDomains")]
94+
"""An optional list of allowed domains for the session.
95+
96+
If you pass one or more domains, Browserbase restricts top-level (main-frame)
97+
page navigations to the listed domains and their subdomains. For example,
98+
`example.com` also permits `www.example.com` and `a.b.example.com`, but not
99+
`notexample.com`. Matching is domain-based, not full-URL. An empty list (the
100+
default) disables the restriction entirely. Browserbase enforces only main-frame
101+
navigations; it does not block iframe/subframe loads or other in-page resource
102+
requests (images, scripts, XHR, etc.).
103+
"""
104+
93105
block_ads: Annotated[bool, PropertyInfo(alias="blockAds")]
94106
"""Enable or disable ad blocking in the browser. Defaults to `false`."""
95107

tests/api_resources/test_sessions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None:
3333
session = client.sessions.create(
3434
browser_settings={
3535
"advanced_stealth": True,
36+
"allowed_domains": ["string"],
3637
"block_ads": True,
3738
"captcha_image_selector": "captchaImageSelector",
3839
"captcha_input_selector": "captchaInputSelector",
@@ -269,6 +270,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas
269270
session = await async_client.sessions.create(
270271
browser_settings={
271272
"advanced_stealth": True,
273+
"allowed_domains": ["string"],
272274
"block_ads": True,
273275
"captcha_image_selector": "captchaImageSelector",
274276
"captcha_input_selector": "captchaInputSelector",

0 commit comments

Comments
 (0)