summaryrefslogtreecommitdiff
path: root/tools/pw.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-15 11:50:22 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-15 11:50:22 +0300
commite47657533453270565caa5e94cfa59307d2a7970 (patch)
tree30fae510369e8d86c65f613302d08fc2221d10eb /tools/pw.go
parent7e346b5e1971c21d24945c2f09c60b7463a619d1 (diff)
Chore: linter complaints
Diffstat (limited to 'tools/pw.go')
-rw-r--r--tools/pw.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/tools/pw.go b/tools/pw.go
index 936da1a..05b1390 100644
--- a/tools/pw.go
+++ b/tools/pw.go
@@ -386,8 +386,6 @@ func pwDragBySelector(args map[string]string) []byte {
if !browserStarted || page == nil {
return []byte(`{"error": "Browser not started. Call pw_start first."}`)
}
-
- // Get center coordinates of both elements using JavaScript
fromJS := fmt.Sprintf(`
function getCenter(selector) {
const el = document.querySelector(selector);
@@ -406,7 +404,6 @@ func pwDragBySelector(args map[string]string) []byte {
}
getCenter(%q)
`, toSelector)
-
fromResult, err := page.Evaluate(fromJS)
if err != nil {
return []byte(fmt.Sprintf(`{"error": "failed to get from element: %s"}`, err.Error()))
@@ -417,7 +414,6 @@ func pwDragBySelector(args map[string]string) []byte {
}
fromX := fromMap["x"].(float64)
fromY := fromMap["y"].(float64)
-
toResult, err := page.Evaluate(toJS)
if err != nil {
return []byte(fmt.Sprintf(`{"error": "failed to get to element: %s"}`, err.Error()))
@@ -428,8 +424,6 @@ func pwDragBySelector(args map[string]string) []byte {
}
toX := toMap["x"].(float64)
toY := toMap["y"].(float64)
-
- // Perform the drag using coordinates
mouse := page.Mouse()
err = mouse.Move(fromX, fromY)
if err != nil {