Skip to content

ElectronContextBridge

Unofficial

Electron ContextBridge for exposing APIs from an isolated preload script to the main world.

Import:

import type { ElectronContextBridge } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface ElectronContextBridge

Methods

Method Returns Description
exposeInMainWorld(apiKey, api) void Exposes an API to the main world under window[apiKey]. The api is proxied across the context bridge so that the main world cannot mutate the isolated world's objects.

Links to this page: