The InteractiveBrowser interface currently has MouseClick (which does mousedown+mouseup at the same position), MouseMove, and MouseWheel. However, there's no way to perform a drag operation, which requires:
MouseDown at position A
MouseMove to position B
MouseUp at position B
This is needed for slider captchas (e.g., DataDome's GeeTest slider used by NYT) where the user must drag a slider handle from left to right.
Proposed Change
Add two new methods to InteractiveBrowser:
// MouseDown presses the mouse button at the given coordinates without releasing.MouseDown(x,yfloat64,buttonstring)error// MouseUp releases the mouse button at the given coordinates.MouseUp(x,yfloat64,buttonstring)error
Implementation would use Playwright's existing page.Mouse().Down() and page.Mouse().Up():
Mort's captcha proxy and browser proxy use InteractiveBrowser for remote browser control. Without drag support, users cannot solve slider captchas through the proxy. The mort-side changes (JS client + Go handler) are ready and will use an optional interface check so they work automatically once this is implemented.
## Problem
The `InteractiveBrowser` interface currently has `MouseClick` (which does mousedown+mouseup at the same position), `MouseMove`, and `MouseWheel`. However, there's no way to perform a **drag** operation, which requires:
1. `MouseDown` at position A
2. `MouseMove` to position B
3. `MouseUp` at position B
This is needed for slider captchas (e.g., DataDome's GeeTest slider used by NYT) where the user must drag a slider handle from left to right.
## Proposed Change
Add two new methods to `InteractiveBrowser`:
```go
// MouseDown presses the mouse button at the given coordinates without releasing.
MouseDown(x, y float64, button string) error
// MouseUp releases the mouse button at the given coordinates.
MouseUp(x, y float64, button string) error
```
Implementation would use Playwright's existing `page.Mouse().Down()` and `page.Mouse().Up()`:
```go
func (ib *interactiveBrowser) MouseDown(x, y float64, button string) error {
if err := ib.page.Mouse().Move(x, y); err != nil {
return err
}
var btn *playwright.MouseButton
switch button {
case "right":
btn = playwright.MouseButtonRight
case "middle":
btn = playwright.MouseButtonMiddle
default:
btn = playwright.MouseButtonLeft
}
return ib.page.Mouse().Down(playwright.MouseDownOptions{Button: btn})
}
func (ib *interactiveBrowser) MouseUp(x, y float64, button string) error {
if err := ib.page.Mouse().Move(x, y); err != nil {
return err
}
var btn *playwright.MouseButton
switch button {
case "right":
btn = playwright.MouseButtonRight
case "middle":
btn = playwright.MouseButtonMiddle
default:
btn = playwright.MouseButtonLeft
}
return ib.page.Mouse().Up(playwright.MouseUpOptions{Button: btn})
}
```
## Context
Mort's captcha proxy and browser proxy use `InteractiveBrowser` for remote browser control. Without drag support, users cannot solve slider captchas through the proxy. The mort-side changes (JS client + Go handler) are ready and will use an optional interface check so they work automatically once this is implemented.
Starting work on this. Plan: add MouseDown and MouseUp to the InteractiveBrowser interface and implement them on interactiveBrowser, following the pattern from the issue description. Will also update the mock in promote_test.go.
Starting work on this. Plan: add `MouseDown` and `MouseUp` to the `InteractiveBrowser` interface and implement them on `interactiveBrowser`, following the pattern from the issue description. Will also update the mock in `promote_test.go`.
Resolved — MouseDown and MouseUp are now part of InteractiveBrowser. Updated mort in PR steve/mort#862 to use them directly for drag gesture support (slider captchas).
Resolved — `MouseDown` and `MouseUp` are now part of `InteractiveBrowser`. Updated mort in PR steve/mort#862 to use them directly for drag gesture support (slider captchas).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The
InteractiveBrowserinterface currently hasMouseClick(which does mousedown+mouseup at the same position),MouseMove, andMouseWheel. However, there's no way to perform a drag operation, which requires:MouseDownat position AMouseMoveto position BMouseUpat position BThis is needed for slider captchas (e.g., DataDome's GeeTest slider used by NYT) where the user must drag a slider handle from left to right.
Proposed Change
Add two new methods to
InteractiveBrowser:Implementation would use Playwright's existing
page.Mouse().Down()andpage.Mouse().Up():Context
Mort's captcha proxy and browser proxy use
InteractiveBrowserfor remote browser control. Without drag support, users cannot solve slider captchas through the proxy. The mort-side changes (JS client + Go handler) are ready and will use an optional interface check so they work automatically once this is implemented.Starting work on this. Plan: add
MouseDownandMouseUpto theInteractiveBrowserinterface and implement them oninteractiveBrowser, following the pattern from the issue description. Will also update the mock inpromote_test.go.Done. PR #80 has been merged. Added
MouseDownandMouseUpto theInteractiveBrowserinterface and implementation.Resolved —
MouseDownandMouseUpare now part ofInteractiveBrowser. Updated mort in PR steve/mort#862 to use them directly for drag gesture support (slider captchas).