diff --git a/browser/browser_context_mapping.go b/browser/browser_context_mapping.go index 72cbe48a6..f36a53629 100644 --- a/browser/browser_context_mapping.go +++ b/browser/browser_context_mapping.go @@ -87,12 +87,12 @@ func mapBrowserContext(vu moduleVU, bc *common.BrowserContext) mapping { //nolin "setDefaultNavigationTimeout": bc.SetDefaultNavigationTimeout, "setDefaultTimeout": bc.SetDefaultTimeout, "setGeolocation": func(geolocation sobek.Value) (*sobek.Promise, error) { - gl := common.NewGeolocation() - if err := gl.Parse(vu.Context(), geolocation); err != nil { + gl, err := exportTo[common.Geolocation](vu.Runtime(), geolocation) + if err != nil { return nil, fmt.Errorf("parsing geo location: %w", err) } return k6ext.Promise(vu.Context(), func() (any, error) { - return nil, bc.SetGeolocation(gl) + return nil, bc.SetGeolocation(&gl) }), nil }, "setHTTPCredentials": func(httpCredentials sobek.Value) (*sobek.Promise, error) {