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

Commit 136cc5f

Browse files
committed
Fix jshandle.evaluate
Adding itself as the first argument which is the expected behaviour.
1 parent ffcc1f5 commit 136cc5f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

common/js_handle.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func (h *BaseJSHandle) dispose() error {
124124

125125
// Evaluate will evaluate provided page function within an execution context.
126126
func (h *BaseJSHandle) Evaluate(pageFunc string, args ...any) (any, error) {
127+
args = append([]any{h}, args...)
127128
res, err := h.execCtx.Eval(h.ctx, pageFunc, args...)
128129
if err != nil {
129130
return nil, fmt.Errorf("evaluating element: %w", err)

0 commit comments

Comments
 (0)