ElectronIpcRenderer.sendSync method
ElectronIpcRenderer › sendSync
Unofficial
Reads or sets Obsidian's "Command line interface" setting.Signature:
sendSync(channel: "cli", isEnabled?: boolean | null | undefined): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | "cli" | The cli channel of Obsidian's main process. |
| isEnabled? | boolean | null | undefined | true or false to set the setting; anything else only reads it. |
Returns: boolean — Whether the setting is on, after applying isEnabled.
Unofficial
Reads or sets Obsidian's "Hardware acceleration" setting, stored as its inverse.Signature:
sendSync(channel: "disable-gpu", isDisabled?: boolean | null | undefined): true | undefinedParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | "disable-gpu" | The disable-gpu channel of Obsidian's main process. |
| isDisabled? | boolean | null | undefined | true or false to set the setting; anything else only reads it. |
Returns: true | undefined — true when hardware acceleration is disabled, undefined when it is not. Never false, because Obsidian deletes the stored flag rather than storing false.
Unofficial
Reads or sets Obsidian's "Automatic updates" setting, stored as its inverse.Signature:
sendSync(channel: "disable-update", isDisabled?: boolean | null | undefined): true | undefinedParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | "disable-update" | The disable-update channel of Obsidian's main process. |
| isDisabled? | boolean | null | undefined | true or false to set the setting; anything else only reads it. |
Returns: true | undefined — true when automatic updates are disabled, undefined when they are not. Never false, because Obsidian deletes the stored flag rather than storing false.
Unofficial
Reads or sets Obsidian's "Receive early access versions" setting.Signature:
sendSync(channel: "insider-build", isEnabled?: boolean | null | undefined): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | "insider-build" | The insider-build channel of Obsidian's main process. |
| isEnabled? | boolean | null | undefined | true or false to set the setting; anything else only reads it. true is ignored where an organization policy (the insider key) forbids early access. |
Returns: boolean — Whether early access versions are received, after applying isEnabled.
Unofficial
Sends a message to the main process viachannel and expects a result synchronously.The main process handles it by listening for
channel with the ipcMain module and replies by setting event.returnValue. Sending a synchronous message blocks the whole renderer process until the reply is received, so use this only as a last resort.Signature:
sendSync(channel: string, args?: unknown[]): unknownParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | string | The IPC channel name. |
| args? | unknown[] | Arguments to send. |
Returns: unknown — The value sent back by the ipcMain handler.