Skip to content

Commit

Permalink
Add strictModeOff const for clarity
Browse files Browse the repository at this point in the history
Resolves: #1107 (comment)
  • Loading branch information
ankur22 committed Nov 23, 2023
1 parent 8f949c6 commit d7f3f53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions browser/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func mapElementHandle(vu moduleVU, eh *common.ElementHandle) mapping {
},
}
maps["$"] = func(selector string) (mapping, error) {
eh, err := eh.Query(selector, false)
eh, err := eh.Query(selector, common.StrictModeOff)
if err != nil {
return nil, err //nolint:wrapcheck
}
Expand Down Expand Up @@ -398,7 +398,7 @@ func mapFrame(vu moduleVU, f *common.Frame) mapping {
"waitForTimeout": f.WaitForTimeout,
}
maps["$"] = func(selector string) (mapping, error) {
eh, err := f.Query(selector, false)
eh, err := f.Query(selector, common.StrictModeOff)
if err != nil {
return nil, err //nolint:wrapcheck
}
Expand Down
4 changes: 4 additions & 0 deletions common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ const (
// Life-cycle consts

LifeCycleNetworkIdleTimeout time.Duration = 500 * time.Millisecond

// API default consts

Check failure on line 17 in common/consts.go

View workflow job for this annotation

GitHub Actions / lint

Comment should end in a period (godot)

StrictModeOff = false
)
2 changes: 1 addition & 1 deletion common/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ func (p *Page) Press(selector string, key string, opts goja.Value) {
func (p *Page) Query(selector string) (*ElementHandle, error) {
p.logger.Debugf("Page:Query", "sid:%v selector:%s", p.sessionID(), selector)

return p.frameManager.MainFrame().Query(selector, false)
return p.frameManager.MainFrame().Query(selector, StrictModeOff)
}

// QueryAll returns all elements matching the specified selector.
Expand Down

0 comments on commit d7f3f53

Please sign in to comment.