CustomDomain™ docs
Cloud browser

Tell the server the popup's new size

Tell the server the popup's new size: CustomDomain™ API reference in the cloud browser group. Covers parameters, request body, responses and error codes.

POST
/browser-sessions/{sid}:viewport

The popup's live area after a resize, a turn or full screen, in CSS pixels. Each side is clamped to 320 to 1600 wide and 400 to 1200 high and divided by the scale the session shows the provider's page at (the provider's fit for the kind of device the popup started as), and the page the customer sees is set to that size (device scale factor 1, not mobile) after a read that says the page is not loading; the view's signals.viewport reports it once it took, and sign_in_viewport is the new size. Allowed only while the customer is in control: signing in (a code or link wait included) or a page the agent handed back. At most 6 a minute per session; send one when a resize has settled.

Authorization

browserSession
AuthorizationBearer <token>

The session token of one cloud browser sign in, returned by POST /browser-sessions:redeem. It binds one session, one connection and one workspace, lives at most as long as the session, and stops working the moment the session ends. It lives in the popup's memory only.

In: header

Path Parameters

sid*string

The cloud browser session id, bs_ and 32 hex characters.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/browser-sessions/string:viewport" \  -H "Content-Type: application/json" \  -d '{    "w": 0,    "h": 0  }'
{  "viewport": {    "width": 0,    "height": 0  }}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}