docs: recommend calling renderer process modules from preload script (#48427)

This commit is contained in:
Niklas Wenzel
2025-10-04 18:44:10 +02:00
committed by GitHub
parent 497b5a68a4
commit 6e2be00f0f
6 changed files with 36 additions and 0 deletions

View File

@@ -4,6 +4,12 @@
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
> [!IMPORTANT]
> If you want to call this API from a renderer process with context isolation enabled,
> place the API call in your preload script and
> [expose](../tutorial/context-isolation.md#after-context-isolation-enabled) it using the
> [`contextBridge`](context-bridge.md) API.
The `nativeImage` module provides a unified interface for manipulating
system images. These can be handy if you want to provide multiple scaled
versions of the same icon or take advantage of macOS [template images][template-image].