@@ -87,6 +87,19 @@ func (r *BrowserService) DeleteByID(ctx context.Context, id string, opts ...opti
8787 return
8888}
8989
90+ // Get browser session replay.
91+ func (r * BrowserService ) GetReplay (ctx context.Context , id string , opts ... option.RequestOption ) (res * http.Response , err error ) {
92+ opts = append (r .Options [:], opts ... )
93+ opts = append ([]option.RequestOption {option .WithHeader ("Accept" , "video/mp4" )}, opts ... )
94+ if id == "" {
95+ err = errors .New ("missing required id parameter" )
96+ return
97+ }
98+ path := fmt .Sprintf ("browsers/%s/replay" , id )
99+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & res , opts ... )
100+ return
101+ }
102+
90103// Optional persistence configuration for the browser session.
91104type BrowserPersistence struct {
92105 // Unique identifier for the persistent browser session.
@@ -141,12 +154,15 @@ type BrowserNewResponse struct {
141154 BrowserLiveViewURL string `json:"browser_live_view_url"`
142155 // Optional persistence configuration for the browser session.
143156 Persistence BrowserPersistence `json:"persistence"`
157+ // Remote URL for viewing the browser session replay if enabled
158+ ReplayViewURL string `json:"replay_view_url"`
144159 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
145160 JSON struct {
146161 CdpWsURL respjson.Field
147162 SessionID respjson.Field
148163 BrowserLiveViewURL respjson.Field
149164 Persistence respjson.Field
165+ ReplayViewURL respjson.Field
150166 ExtraFields map [string ]respjson.Field
151167 raw string
152168 } `json:"-"`
@@ -168,12 +184,15 @@ type BrowserGetResponse struct {
168184 BrowserLiveViewURL string `json:"browser_live_view_url"`
169185 // Optional persistence configuration for the browser session.
170186 Persistence BrowserPersistence `json:"persistence"`
187+ // Remote URL for viewing the browser session replay if enabled
188+ ReplayViewURL string `json:"replay_view_url"`
171189 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
172190 JSON struct {
173191 CdpWsURL respjson.Field
174192 SessionID respjson.Field
175193 BrowserLiveViewURL respjson.Field
176194 Persistence respjson.Field
195+ ReplayViewURL respjson.Field
177196 ExtraFields map [string ]respjson.Field
178197 raw string
179198 } `json:"-"`
@@ -195,12 +214,15 @@ type BrowserListResponse struct {
195214 BrowserLiveViewURL string `json:"browser_live_view_url"`
196215 // Optional persistence configuration for the browser session.
197216 Persistence BrowserPersistence `json:"persistence"`
217+ // Remote URL for viewing the browser session replay if enabled
218+ ReplayViewURL string `json:"replay_view_url"`
198219 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
199220 JSON struct {
200221 CdpWsURL respjson.Field
201222 SessionID respjson.Field
202223 BrowserLiveViewURL respjson.Field
203224 Persistence respjson.Field
225+ ReplayViewURL respjson.Field
204226 ExtraFields map [string ]respjson.Field
205227 raw string
206228 } `json:"-"`
@@ -218,6 +240,8 @@ type BrowserNewParams struct {
218240 Headless param.Opt [bool ] `json:"headless,omitzero"`
219241 // action invocation ID
220242 InvocationID param.Opt [string ] `json:"invocation_id,omitzero"`
243+ // If true, enables replay recording of the browser session. Defaults to false.
244+ Replay param.Opt [bool ] `json:"replay,omitzero"`
221245 // If true, launches the browser in stealth mode to reduce detection by anti-bot
222246 // mechanisms.
223247 Stealth param.Opt [bool ] `json:"stealth,omitzero"`
0 commit comments