[docs]: add docs for `setDomainPolicy`
Merged
SE
4mo ago+110+110+012345678901234567890123456789-0-0-0123456789
why
- adds documentation for
setDomainPolicy()
what changed
Summary by cubic
Adds docs for context.setDomainPolicy() and context.getDomainPolicy() to control HTTP(S) requests by domain across a context, with examples and error details. Addresses Linear STG-2426.
- New Features
- Documented
setDomainPolicy(policy: DomainPolicy | null)andgetDomainPolicy()with TypeScript signatures, behavior, scope (pages, iframes, subresources), and how to clear. - Clarified domain-only patterns: exact vs wildcard, subdomain rules (
*.example.comdoesn’t matchexample.com), case-insensitive matching, duplicate patterns ignored, and no schemes/paths/ports;blockedDomainsoverridesallowedDomains; non-HTTP(S) unaffected; blocked requests show Chrome “BlockedByClient”. - Added a “Domain Policy” example tab using
@browserbasehq/stagehand, and updated API reference with new errors (StagehandInvalidArgumentError,StagehandSetDomainPolicyError) plusV3ContextandDomainPolicyinterface snippets.
- Documented