| 5646 | } |
| 5647 | |
| 5648 | func (w *InternetContents) makeMouseAction(x, y float64, inputType input.MouseType, opts ...chromedp.MouseOption) chromedp.ActionFunc { |
| 5649 | |
| 5650 | return chromedp.ActionFunc(func(ctx context.Context) error { |
| 5651 | p := &input.DispatchMouseEventParams{ |
| 5652 | Type: inputType, |
| 5653 | X: x, |
| 5654 | Y: y, |
| 5655 | Button: input.Left, |
| 5656 | ClickCount: 1, |
| 5657 | } |
| 5658 | |
| 5659 | // apply opts |
| 5660 | for _, o := range opts { |
| 5661 | p = o(p) |
| 5662 | } |
| 5663 | |
| 5664 | if err := p.Do(ctx); err != nil { |
| 5665 | return err |
| 5666 | } |
| 5667 | |
| 5668 | return nil |
| 5669 | |
| 5670 | // p.Type = input.MouseReleased |
| 5671 | // return p.Do(ctx) |
| 5672 | }) |
| 5673 | |
| 5674 | } |
| 5675 | |
| 5676 | func (w *InternetContents) ToggleRecordInput() { |
| 5677 | w.RecordInput = !w.RecordInput |