Files
orca/src/shared/browser-guest-events.ts
T
Jinjing 404e45f022 Improve built-in browser downloads (#5940)
* Improve built-in browser downloads

Implements docs/browser-normal-download-behavior.md with automatic OS Downloads saving, collision-safe destinations, and renderer download controls.

* Clean up browser downloads on tab closure and guest destruction

- Cancel and drop pending download records when webview guests are destroyed or closed to prevent memory leaks and dangling state.
- Purge tracking entries for cancelled downloads lacking an active tab.
- Document filename normalization and reservation assumptions in download builder.
- Translate "Copy Terminal ID" context menu action in Spanish and Chinese locales.
2026-06-20 16:33:20 -07:00

61 lines
1.6 KiB
TypeScript

export type BrowserPermissionDeniedEvent = {
browserPageId: string
/** Electron permission string (e.g. "media", "notifications"). */
permission: string
/** Sanitized to origin/host so auth query params never leak into UI state. */
origin: string
}
export type BrowserPopupEvent = {
browserPageId: string
/** Sanitized to origin/host so auth query params never leak into UI state. */
origin: string
/** Whether Orca opened the target in Orca, opened it externally, or blocked it as unsafe. */
action: 'opened-in-orca' | 'opened-external' | 'blocked'
}
export type BrowserDownloadRequestedEvent = {
browserPageId: string
downloadId: string
/** Sanitized to origin/host so auth query params never leak into UI state. */
origin: string
filename: string
totalBytes: number | null
mimeType: string | null
savePath: string
status: 'downloading'
}
export type BrowserDownloadProgressEvent = {
browserPageId?: string
downloadId: string
receivedBytes: number
totalBytes: number | null
state: 'progressing' | 'interrupted' | null
}
export type BrowserDownloadFinishedEvent = {
browserPageId?: string
downloadId: string
status: 'completed' | 'canceled' | 'failed'
savePath: string | null
/** Human-readable UI copy only; must never contain secrets. */
error: string | null
}
export type BrowserContextMenuRequestedEvent = {
browserPageId: string
x: number
y: number
screenX: number
screenY: number
pageUrl: string
linkUrl: string | null
canGoBack: boolean
canGoForward: boolean
}
export type BrowserContextMenuDismissedEvent = {
browserPageId: string
}