Skip to content

main/permission-prompt

Defined in: app/src/main/permission-prompt.ts:20

The questions of sites for permissions and screens, in the overlay of their window.

askForPermissions(window, contents, origin, permissions): Promise<PermissionDecision | undefined>

Defined in: app/src/main/permission-prompt.ts:30

Asks whether a site may use some permissions. Questions wait for the one before them in the window; the same question of a page shares one prompt.

BrowserWindowController

The window of the page.

WebContents

The page, the window’s visible tab.

string

The origin of the page.

readonly SitePermission[]

What the site wants.

Promise<PermissionDecision | undefined>

The answer, or nothing when the prompt closed without one.

chooseScreen(window, contents, origin, callback): void

Defined in: app/src/main/permission-prompt.ts:43

Lets the user choose a screen or a window for a site to see, or nothing.

BrowserWindowController

The window of the page.

WebContents

The page, the window’s visible tab.

string

The origin of the page.

(streams) => void

Electron’s answer; null refuses.

void


Defined in: app/src/main/permission-prompt.ts:74

The system that the browser runs on, as Chromium reads it to pick how to share screens.

readonly env: Readonly<Record<string, string | undefined>>

Defined in: app/src/main/permission-prompt.ts:76

readonly platform: Platform

Defined in: app/src/main/permission-prompt.ts:75

SourceLister = (options) => Promise<DesktopCapturerSource[]>

Defined in: app/src/main/permission-prompt.ts:71

Lists screens and windows, as Electron’s desktop capturer does.

Electron.SourcesOptions

Promise<DesktopCapturerSource[]>

listScreenSources(logger, list?, system?): Promise<DesktopCapturerSource[]>

Defined in: app/src/main/permission-prompt.ts:85

Lists the screens and windows that a site may see.

Logger

Records windows that could not be listed.

SourceLister = ...

Lists sources; Electron’s desktop capturer by default.

ScreenSystem = ...

The system; the running one by default.

Promise<DesktopCapturerSource[]>


permissionPrompts(overlay, router, logger): PermissionPrompts

Defined in: app/src/main/permission-prompt.ts:115

The prompts for permissions. They load with the first question of a site.

OverlayOptions

What the overlays of all windows share.

IpcRouter

IPC router.

Logger

Logger.

PermissionPrompts