Skip to content

Commit

Permalink
Desobekify BrowserContext.Viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 6, 2024
1 parent 0f88d4f commit ea585de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/browser_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func parseBrowserContextOptions(ctx context.Context, opts sobek.Value) (*common.
case "userAgent":
b.UserAgent = o.Get(k).String()
case "viewport":
var viewport common.Viewport
if err := viewport.Parse(ctx, o.Get(k).ToObject(rt)); err != nil {
var err error
b.Viewport, err = exportTo[common.Viewport](rt, o.Get(k))
if err != nil {
return nil, fmt.Errorf("parsing viewport options: %w", err)
}
b.Viewport = viewport
}
}

Expand Down

0 comments on commit ea585de

Please sign in to comment.