Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Validate SetGeolocation geolocation
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 6, 2024
1 parent 879dbbb commit ed1488e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/browser_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ func (b *BrowserContext) SetDefaultTimeout(timeout int64) {
func (b *BrowserContext) SetGeolocation(g *Geolocation) error {
b.logger.Debugf("BrowserContext:SetGeolocation", "bctxid:%v", b.id)

if err := g.Validate(); err != nil {
return fmt.Errorf("validating geo location: %w", err)
}

b.opts.Geolocation = g
for _, p := range b.browser.getPages() {
if err := p.updateGeolocation(); err != nil {
Expand Down

0 comments on commit ed1488e

Please sign in to comment.