Skip to content

Commit bec63d3

Browse files
feat(api): headless browsers
1 parent 8892a60 commit bec63d3

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
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: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-0ac9428eb663361184124cdd6a6e80ae8dc72c927626c949f22aacc4f40095de.yml
3-
openapi_spec_hash: 27707667d706ac33f2d9ccb23c0f15c3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3ec96d0022acb32aa2676c2e7ae20152b899a776ccd499380c334c955b9ba071.yml
3+
openapi_spec_hash: b64c095d82185c1cd0355abea88b606f
44
config_hash: 00ec9df250b9dc077f8d3b93a442d252

src/resources/browsers.ts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ export interface BrowserPersistence {
9797
}
9898

9999
export interface BrowserCreateResponse {
100-
/**
101-
* Remote URL for live viewing the browser session
102-
*/
103-
browser_live_view_url: string;
104-
105100
/**
106101
* Websocket URL for Chrome DevTools Protocol connections to the browser session
107102
*/
@@ -112,18 +107,19 @@ export interface BrowserCreateResponse {
112107
*/
113108
session_id: string;
114109

110+
/**
111+
* Remote URL for live viewing the browser session. Only available for non-headless
112+
* browsers.
113+
*/
114+
browser_live_view_url?: string;
115+
115116
/**
116117
* Optional persistence configuration for the browser session.
117118
*/
118119
persistence?: BrowserPersistence;
119120
}
120121

121122
export interface BrowserRetrieveResponse {
122-
/**
123-
* Remote URL for live viewing the browser session
124-
*/
125-
browser_live_view_url: string;
126-
127123
/**
128124
* Websocket URL for Chrome DevTools Protocol connections to the browser session
129125
*/
@@ -134,6 +130,12 @@ export interface BrowserRetrieveResponse {
134130
*/
135131
session_id: string;
136132

133+
/**
134+
* Remote URL for live viewing the browser session. Only available for non-headless
135+
* browsers.
136+
*/
137+
browser_live_view_url?: string;
138+
137139
/**
138140
* Optional persistence configuration for the browser session.
139141
*/
@@ -144,11 +146,6 @@ export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseI
144146

145147
export namespace BrowserListResponse {
146148
export interface BrowserListResponseItem {
147-
/**
148-
* Remote URL for live viewing the browser session
149-
*/
150-
browser_live_view_url: string;
151-
152149
/**
153150
* Websocket URL for Chrome DevTools Protocol connections to the browser session
154151
*/
@@ -159,6 +156,12 @@ export namespace BrowserListResponse {
159156
*/
160157
session_id: string;
161158

159+
/**
160+
* Remote URL for live viewing the browser session. Only available for non-headless
161+
* browsers.
162+
*/
163+
browser_live_view_url?: string;
164+
162165
/**
163166
* Optional persistence configuration for the browser session.
164167
*/
@@ -167,6 +170,12 @@ export namespace BrowserListResponse {
167170
}
168171

169172
export interface BrowserCreateParams {
173+
/**
174+
* If true, launches the browser using a headless image (no VNC/GUI). Defaults to
175+
* false.
176+
*/
177+
headless?: boolean;
178+
170179
/**
171180
* action invocation ID
172181
*/

tests/api-resources/browsers.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('resource browsers', () => {
2626
await expect(
2727
client.browsers.create(
2828
{
29+
headless: false,
2930
invocation_id: 'rr33xuugxj9h0bkf1rdt2bet',
3031
persistence: { id: 'my-awesome-browser-for-user-1234' },
3132
stealth: true,

0 commit comments

Comments
 (0)