Documentation
    Preparing search index...

    Interface BrowserApprovalUiOptions

    Host-provided labels and live runtime grant management for one browser UI.

    interface BrowserApprovalUiOptions {
        getPermissions: () => RuntimePermissions | undefined;
        labelForPrincipal: (principal: PermissionPrincipal) => string;
        mount: HTMLElement;
        onAnswer?: (answer: ApprovalAnswer, userGesture: boolean) => void;
        onGrantRevoked?: (grant: PermissionGrant, durable: boolean) => void;
        onRulesChanged?: () => void;
        onStorageStateChanged?: (available: boolean) => void;
        openOriginLimit?: number | (() => number);
        promptMount?: HTMLElement;
        rules?: BrowserApprovalRules;
    }
    Index

    Properties

    getPermissions: () => RuntimePermissions | undefined

    Read the active runtime, which may be constructed after this UI.

    labelForPrincipal: (principal: PermissionPrincipal) => string

    Host display name; the technical verified identity is always available too.

    mount: HTMLElement
    onAnswer?: (answer: ApprovalAnswer, userGesture: boolean) => void

    Observe each answered prompt. userGesture is true only for a real pointer or key press, so a host can run a gesture-gated browser action, such as opening a tab, from the approving click. It cannot change the answer.

    onGrantRevoked?: (grant: PermissionGrant, durable: boolean) => void

    Host lifecycle observer; it cannot grant authority.

    onRulesChanged?: () => void

    Called after a rule change was reported to the runtime, e.g. to relaunch a retired target.

    onStorageStateChanged?: (available: boolean) => void

    Observe whether the runtime can safely accept new grants.

    openOriginLimit?: number | (() => number)

    Largest group of same-operation network origins (such as an outbox plan's relays) shown open in a prompt; larger groups start collapsed. A number or a getter read at each prompt, default DEFAULT_PROMPT_OPEN_ORIGINS.

    promptMount?: HTMLElement

    Optional always-visible mount for prompts when grant management can be hidden. Defaults to mount.

    Host default rules. When present the UI shows a rule editor, offers a standing rule from each prompt, and resets grants a changed rule no longer allows.