Files
orca/src/shared/browser-javascript-dialog.ts
T
Kelvin Amoaba 4410ef318e fix(browser): let agents and users answer page alert, confirm and prompt dialogs on their page (#36268)
* 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
2026-10-30 07:39:38 +00:00

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
}