Skip to content

platform/electron/app-protocol-routes

Defined in: app/src/platform/electron/app-protocol-routes.ts:39

A route for protocol.registerSource: matching URLs are served from a directory.

readonly match: object

Defined in: app/src/platform/electron/app-protocol-routes.ts:40

readonly host: string

readonly optional path?: string

readonly source: object

Defined in: app/src/platform/electron/app-protocol-routes.ts:41

readonly headers: Record<string, string>

readonly optional index?: string

readonly root: string

readonly type: "directory"

const appContentSecurityPolicy: string

Defined in: app/src/platform/electron/app-protocol-routes.ts:10

Content Security Policy of every internal page. Scripts and styles only come from the page’s own origin, nothing can be framed or posted, and DOM sinks require Trusted Types.


const appResponseHeaders: Readonly<Record<string, string>>

Defined in: app/src/platform/electron/app-protocol-routes.ts:31

Response headers of every internal page and file. There is no Cross-Origin-Opener-Policy: a page with one cannot stay in the renderer that its view started with its empty first document, so every view would start a second renderer before its page could run. Internal pages have no openers to keep apart: they cannot open windows, and web pages can neither open nor navigate to them.


const appScheme: "app" = 'app'

Defined in: app/src/platform/electron/app-protocol-routes.ts:4

The browser’s internal scheme.

appSourceRoutes(root, hosts): AppSourceRoute[]

Defined in: app/src/platform/electron/app-protocol-routes.ts:57

Maps every internal host to its folder of the renderer build. Paths below /assets/ of every host come from the shared asset folder, because the bundler writes one. The files are streamed without the main thread, so internal pages load at full speed even while the main process is busy; paths that leave a folder are never served.

string

Directory that contains one folder per host and the assets folder.

Iterable<string>

Hosts that exist, such as shell.

AppSourceRoute[]