mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* fix(browser): let agents and users answer page alert, confirm and prompt dialogs on their page * fix(browser): watch a replacement guest for dialogs and ignore the opening keypress * fix(browser): ignore a repeated Enter in a guarded prompt field
19 lines
599 B
TypeScript
19 lines
599 B
TypeScript
/** A page's open `alert()`, `confirm()` or `prompt()` in the built-in browser. */
|
|
export type BrowserJavaScriptDialog = {
|
|
type: 'alert' | 'confirm' | 'prompt'
|
|
message: string
|
|
/** The text a prompt starts with; empty for alert and confirm. */
|
|
defaultPromptText: string
|
|
}
|
|
|
|
export type BrowserJavaScriptDialogPrompt = BrowserJavaScriptDialog & {
|
|
/** Origin of the page that opened it; null when it has none, e.g. `about:blank`. */
|
|
origin: string | null
|
|
}
|
|
|
|
export type BrowserJavaScriptDialogAnswer = {
|
|
accept: boolean
|
|
/** What a prompt returns when accepted. */
|
|
promptText: string
|
|
}
|