Skip to content

Commit 406a399

Browse files
feat: Allow hot loading profiles into sessions
1 parent cee2050 commit 406a399

3 files changed

Lines changed: 17 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: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-7427d4bcaba5cad07910da7a222bdd2650b5280e6b889132ed38d230adafb8a5.yml
3-
openapi_spec_hash: e8e3dc1ae54666d544d1fc848b25e7cf
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d430a8e3407ceb608d912cabadbcb016b4fcf057ca56b3bbd179ea3b3121b484.yml
3+
openapi_spec_hash: 8adbf013baf77abacaf04ed067749397
44
config_hash: b470456b217bb9502f5212311d395a6f

browser.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ type BrowserUpdateParams struct {
550550
// ID of the proxy to use. Omit to leave unchanged, set to empty string to remove
551551
// proxy.
552552
ProxyID param.Opt[string] `json:"proxy_id,omitzero"`
553+
// Profile to load into the browser session. Only allowed if the session does not
554+
// already have a profile loaded.
555+
Profile shared.BrowserProfileParam `json:"profile,omitzero"`
556+
// Viewport configuration to apply to the browser session.
557+
Viewport shared.BrowserViewportParam `json:"viewport,omitzero"`
553558
paramObj
554559
}
555560

browser_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,17 @@ func TestBrowserUpdateWithOptionalParams(t *testing.T) {
109109
context.TODO(),
110110
"htzv5orfit78e1m2biiifpbv",
111111
kernel.BrowserUpdateParams{
112+
Profile: shared.BrowserProfileParam{
113+
ID: kernel.String("id"),
114+
Name: kernel.String("name"),
115+
SaveChanges: kernel.Bool(true),
116+
},
112117
ProxyID: kernel.String("proxy_id"),
118+
Viewport: shared.BrowserViewportParam{
119+
Height: 800,
120+
Width: 1280,
121+
RefreshRate: kernel.Int(60),
122+
},
113123
},
114124
)
115125
if err != nil {

0 commit comments

Comments
 (0)