Skip to content

Commit d107fa0

Browse files
authored
Kiosk mode (#29)
1 parent 31b883a commit d107fa0

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
152152
- `-p, --persistence-id <id>` - Unique identifier for browser session persistence
153153
- `-s, --stealth` - Launch browser in stealth mode to avoid detection
154154
- `-H, --headless` - Launch browser without GUI access
155+
- `--kiosk` - Launch browser in kiosk mode
155156
- `kernel browsers delete <id or persistent id>` - Delete a browser
156157
- `-y, --yes` - Skip confirmation prompt
157158
- `kernel browsers view <id or persistent id>` - Get live view URL for a browser
@@ -306,6 +307,9 @@ kernel browsers create --persistence-id my-browser-session
306307
# Create a headless browser in stealth mode
307308
kernel browsers create --headless --stealth
308309

310+
# Create a browser in kiosk mode
311+
kernel browsers create --kiosk
312+
309313
# Delete a persistent browser
310314
kernel browsers delete --by-persistent-id my-browser-session --yes
311315

cmd/browsers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ type BrowsersCreateInput struct {
135135
TimeoutSeconds int
136136
Stealth BoolFlag
137137
Headless BoolFlag
138+
Kiosk BoolFlag
138139
ProfileID string
139140
ProfileName string
140141
ProfileSaveChanges BoolFlag
@@ -241,6 +242,9 @@ func (b BrowsersCmd) Create(ctx context.Context, in BrowsersCreateInput) error {
241242
if in.Headless.Set {
242243
params.Headless = kernel.Opt(in.Headless.Value)
243244
}
245+
if in.Kiosk.Set {
246+
params.KioskMode = kernel.Opt(in.Kiosk.Value)
247+
}
244248

245249
// Validate profile selection: at most one of profile-id or profile-name must be provided
246250
if in.ProfileID != "" && in.ProfileName != "" {
@@ -1541,6 +1545,7 @@ func init() {
15411545
browsersCreateCmd.Flags().StringP("persistent-id", "p", "", "Unique identifier for browser session persistence")
15421546
browsersCreateCmd.Flags().BoolP("stealth", "s", false, "Launch browser in stealth mode to avoid detection")
15431547
browsersCreateCmd.Flags().BoolP("headless", "H", false, "Launch browser without GUI access")
1548+
browsersCreateCmd.Flags().Bool("kiosk", false, "Launch browser in kiosk mode")
15441549
browsersCreateCmd.Flags().IntP("timeout", "t", 60, "Timeout in seconds for the browser session")
15451550
browsersCreateCmd.Flags().String("profile-id", "", "Profile ID to load into the browser session (mutually exclusive with --profile-name)")
15461551
browsersCreateCmd.Flags().String("profile-name", "", "Profile name to load into the browser session (mutually exclusive with --profile-id)")
@@ -1571,6 +1576,7 @@ func runBrowsersCreate(cmd *cobra.Command, args []string) error {
15711576
persistenceID, _ := cmd.Flags().GetString("persistent-id")
15721577
stealthVal, _ := cmd.Flags().GetBool("stealth")
15731578
headlessVal, _ := cmd.Flags().GetBool("headless")
1579+
kioskVal, _ := cmd.Flags().GetBool("kiosk")
15741580
timeout, _ := cmd.Flags().GetInt("timeout")
15751581
profileID, _ := cmd.Flags().GetString("profile-id")
15761582
profileName, _ := cmd.Flags().GetString("profile-name")
@@ -1602,6 +1608,7 @@ func runBrowsersCreate(cmd *cobra.Command, args []string) error {
16021608
TimeoutSeconds: timeout,
16031609
Stealth: BoolFlag{Set: cmd.Flags().Changed("stealth"), Value: stealthVal},
16041610
Headless: BoolFlag{Set: cmd.Flags().Changed("headless"), Value: headlessVal},
1611+
Kiosk: BoolFlag{Set: cmd.Flags().Changed("kiosk"), Value: kioskVal},
16051612
ProfileID: profileID,
16061613
ProfileName: profileName,
16071614
ProfileSaveChanges: BoolFlag{Set: cmd.Flags().Changed("save-changes"), Value: saveChanges},

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/charmbracelet/fang v0.2.0
99
github.com/golang-jwt/jwt/v5 v5.2.2
1010
github.com/joho/godotenv v1.5.1
11-
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f
11+
github.com/onkernel/kernel-go-sdk v0.14.2
1212
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
1313
github.com/pterm/pterm v0.12.80
1414
github.com/samber/lo v1.51.0

go.sum

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ github.com/muesli/mango-pflag v0.1.0 h1:UADqbYgpUyRoBja3g6LUL+3LErjpsOwaC9ywvBWe
9191
github.com/muesli/mango-pflag v0.1.0/go.mod h1:YEQomTxaCUp8PrbhFh10UfbhbQrM/xJ4i2PB8VTLLW0=
9292
github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8=
9393
github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig=
94-
github.com/onkernel/kernel-go-sdk v0.14.1 h1:r4drk5uM1phiXl0dZXhnH1zz5iTmApPC0cGSSiNKbVk=
95-
github.com/onkernel/kernel-go-sdk v0.14.1/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
96-
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f h1:/cXzVNPxWryqNsIo2Kvc5fYLBlk7CHus3JZIv1JVoU4=
97-
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
94+
github.com/onkernel/kernel-go-sdk v0.14.2 h1:femYawCgMHCeRDlFlhGxOM3KuBUvrZhaGOfWxdn2YUY=
95+
github.com/onkernel/kernel-go-sdk v0.14.2/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
9896
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
9997
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
10098
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -131,7 +129,6 @@ github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD
131129
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
132130
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
133131
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
134-
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
135132
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
136133
github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM=
137134
github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=

0 commit comments

Comments
 (0)