ffctl/cmd/scrape/main.go

33 lines
773 B
Go

package main
import (
"context"
"fmt"
"os"
"time"
"git.mothstuff.lol/lukeshu/ffctl/lib/marionette"
)
func main() {
if err := marionette.WithGecko(context.Background(), func(ctx context.Context, t *marionette.TCPTransport) error {
if err := t.CmdPerformActions(marionette.ActionSequence{
Type: marionette.ActionSourceKeyboard,
ID: "my_keyboard",
Actions: []any{
marionette.ActionPause(1 * time.Second),
marionette.ActionKeyDown(marionette.KeyF12),
marionette.ActionPause(15 * time.Millisecond),
marionette.ActionKeyUp(marionette.KeyF12),
marionette.ActionPause(1 * time.Second),
},
}); err != nil {
return err
}
return nil
}); err != nil {
fmt.Fprintf(os.Stderr, "%s: error: %v\n", os.Args[0], err)
os.Exit(1)
}
}