ffctl/cmd/scrape/main.go

33 lines
773 B
Go
Raw Permalink Normal View History

2024-02-09 08:59:56 +00:00
package main
import (
"context"
"fmt"
"os"
"time"
2024-02-09 17:40:02 +00:00
"git.mothstuff.lol/lukeshu/ffctl/lib/marionette"
2024-02-09 08:59:56 +00:00
)
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)
}
}