downloadItem.savePath property
A string property that determines the save file path of the download item. The property is only available in the session's 'will-download' callback function. If the user doesn't set the save path via this property, Electron will use the original routine to determine the save path, which usually prompts a save dialog.
languageModelUtility.contextWindow property
contextWindow is an experimental instance property of type number that represents the size of the context window, measured in tokens.
languageModelUtility.contextUsage property
contextUsage is an experimental instance property of type number that represents how many tokens are currently in the context window.
menu.items property
A read-only property that is a MenuItem[] array containing the menu's items. Each Menu consists of multiple MenuItem instances and each MenuItem can nest a Menu into its submenu property.
nativeTheme.inForcedColorsMode property
inForcedColorsMode is a readonly boolean property available on Windows that indicates whether Chromium is in forced colors mode, controlled by system accessibility settings. Currently, Windows high contrast is the only system setting that triggers forced colors mode.
nativeTheme.shouldUseInvertedColorScheme property
shouldUseInvertedColorScheme is a readonly boolean property available on macOS and Windows that indicates whether the OS or Chromium currently has an inverted color scheme or is being instructed to use an inverted color scheme.
nativeTheme.shouldUseDarkColors property
shouldUseDarkColors is a readonly boolean property that indicates whether the OS or Chromium currently has a dark mode enabled or is being instructed to show a dark-style UI. To modify this value, use the themeSource property instead.
nativeTheme.shouldDifferentiateWithoutColor property
shouldDifferentiateWithoutColor is a readonly boolean property available on macOS that indicates whether the user prefers UI that differentiates items using something other than color alone (such as shapes or labels). This maps to NSWorkspace.accessibilityDisplayShouldDifferentiateWithoutColor.
nativeTheme.shouldUseHighContrastColors property
shouldUseHighContrastColors is a readonly boolean property available on macOS and Windows that indicates whether the OS or Chromium currently has high-contrast mode enabled or is being instructed to show a high-contrast UI.
nativeTheme.themeSource property
themeSource is a string property that can be 'system', 'light', or 'dark'. It is used to override the value that Chromium has chosen internally. The default value is 'system'. Setting themeSource to 'system' removes the override and resets everything to the OS default.
nativeTheme.themeSource recommended usage pattern
The usage of themeSource should align with a classic dark mode state machine in your application where the user has three options: 'Follow OS' (themeSource = 'system'), 'Dark Mode' (themeSource = 'dark'), and 'Light Mode' (themeSource = 'light'). Your application should always use shouldUseDarkColors to determine what CSS to apply.
nativeTheme.prefersReducedTransparency property
prefersReducedTransparency is a readonly boolean property that indicates whether the user has chosen via system accessibility settings to reduce transparency at the OS level.
nativeTheme.shouldUseDarkColorsForSystemIntegratedUI property
shouldUseDarkColorsForSystemIntegratedUI is a readonly boolean property available on macOS and Windows that indicates whether the system theme has been set to dark or light. On Windows it distinguishes between system and app light/dark theme, returning true if the system theme is set to dark and false otherwise. On macOS the return value will be the same as shouldUseDarkColors.
nativeTheme.themeSource = 'light' effects
When themeSource is set to 'light', shouldUseDarkColors will be false when accessed, any UI Electron renders on Linux and Windows (including context menus and DevTools) will use light UI, any UI the OS renders on macOS (including menus and window frames) will use light UI, the CSS prefers-color-scheme query will match 'light' mode, and the 'updated' event will be emitted.
netLog.currentlyLogging property
netLog.currentlyLogging is a readonly boolean property that indicates whether network logs are currently being recorded.
net.online property
net.online is a readonly boolean property indicating whether there is currently internet connection. A return value of false is a strong indicator that the user won't be able to connect to remote sites. However, a return value of true is inconclusive; even if some link is up, it is uncertain whether a particular connection attempt to a particular remote site will be successful.
net.WebSocket property
net.WebSocket is available only in the main process and provides a reference to the WebSocket class. It can be used to create WHATWG-compatible WebSocket connections through Chromium's network stack from the main process.
net.WebSocket example
const { app, net } = require('electron')
app.whenReady().then(() => {
const ws = new net.WebSocket('wss://echo.websocket.events')
ws.onmessage = (event) => console.log(event.data)
})
This example shows how to create a WHATWG-compatible WebSocket connection using net.WebSocket from the main process.
powerMonitor.onBatteryPower property
powerMonitor.onBatteryPower is a boolean property that is true if the system is on battery power. This property has the same meaning as the result of powerMonitor.isOnBatteryPower().
process.traceProcessWarnings property
process.traceProcessWarnings is a boolean that controls whether process warnings printed to stderr include their stack trace. Setting this to true will print stack traces for process warnings including deprecations. This property is used instead of the --trace-warnings command line flag.
process.throwDeprecation property
process.throwDeprecation is a boolean that controls whether deprecation warnings will be thrown as exceptions. Setting this to true will throw errors for deprecations. This property is used instead of the --throw-deprecation command line flag.
process.traceDeprecation property
process.traceDeprecation is a boolean that controls whether deprecations printed to stderr include their stack trace. Setting this to true will print stack traces for deprecations. This property is used instead of the --trace-deprecation command line flag.
process.contextIsolated property
process.contextIsolated is a readonly boolean that indicates whether the current renderer context has contextIsolation enabled. It is undefined in the main process.
process.noDeprecation property
process.noDeprecation is an optional boolean that controls whether deprecation warnings are printed to stderr. Setting this to true will silence deprecation warnings. This property is used instead of the --no-deprecation command line flag.
process.resourcesPath property
process.resourcesPath is a readonly string representing the path to the resources directory.
process.sandboxed property
process.sandboxed is a readonly boolean. When the renderer process is sandboxed, this property is true; otherwise it is undefined.
process.noAsar property
process.noAsar is a boolean that controls ASAR support inside the application. Setting this to true will disable support for asar archives in Node's built-in modules.
process.mas property
process.mas is a readonly boolean. For Mac App Store build, this property is true; for other builds it is undefined.
process.versions.chrome property
process.versions.chrome is a readonly string representing Chrome's version string.
process.type property values
process.type is a readonly string representing the current process type. Possible values are: 'browser' (the main process), 'renderer' (a renderer process), 'service-worker' (in a service worker), 'worker' (in a web worker), or 'utility' (in a node process launched as a service).
process.isMainFrame property
process.isMainFrame is a readonly boolean that is true when the current renderer context is the main renderer frame. To get the ID of the current frame, use webFrame.routingId.
process.parentPort property
process.parentPort is an Electron.ParentPort property if this is a UtilityProcess (or null otherwise) allowing communication with the parent process.
process.defaultApp property
process.defaultApp is a readonly boolean. When the app is started by being passed as a parameter to the default Electron executable, this property is true in the main process, otherwise it is undefined. For example when running with 'electron .', it is true, even if the app is packaged. This can be useful to determine how many arguments need to be sliced off from process.argv.
process.contextId property
process.contextId is a readonly optional string representing a globally unique ID of the current JavaScript context. Each frame has its own JavaScript context. When contextIsolation is enabled, the isolated world also has a separate JavaScript context. This property is only available in the renderer process.
process.windowsStore property
process.windowsStore is a readonly boolean. If the app is running as an MSIX package (including AppX for Windows Store), this property is true; otherwise it is undefined.
process.versions.electron property
process.versions.electron is a readonly string representing Electron's version string.
serviceWorker.scope property
A read-only string property representing the scope URL of the service worker. This property is experimental.
serviceWorker.ipc property
A read-only property that is an IpcMainServiceWorker instance scoped to the service worker. This property is experimental.
serviceWorker.versionId property
A read-only number property representing the ID of the specific version of the service worker script in its scope. This property is experimental.
serviceWorker.scriptURL property
A read-only string property representing the script URL of the service worker. This property is experimental.
ServiceWorkers access pattern
ServiceWorkers instances are accessed through the serviceWorkers property of a Session object. Example: session.defaultSession.serviceWorkers
ActivationArguments Windows-only platform
The ActivationArguments object is used on Windows only.
BluetoothDevice deviceId property
The deviceId property of BluetoothDevice is a string containing the unique identifier of the Bluetooth device.
BluetoothDevice deviceName property
The deviceName property of BluetoothDevice is a string containing the name of the Bluetooth device.
CPUUsage Object percentCPUUsage property
The percentCPUUsage property is a number representing the percentage of CPU used since the last call to getCPUUsage. On the first call, it returns 0.
CPUUsage Object idleWakeupsPerSecond property
The idleWakeupsPerSecond property is a number representing the average number of idle CPU wakeups per second since the last call to getCPUUsage. On the first call, it returns 0. On Windows, it always returns 0.
CPUUsage Object cumulativeCPUUsage property
The cumulativeCPUUsage property is an optional number representing the total seconds of CPU time used since process startup.
Display object structure and properties
The Display object represents a physical display connected to the system. A fake Display may exist on a headless system, or a Display may correspond to a remote, virtual display. Properties: accelerometerSupport (string: 'available', 'unavailable', 'unknown'), bounds (Rectangle in DIP points), colorDepth (number of bits per pixel), colorSpace (string representing color space for color conversions), depthPerComponent (number of bits per color component), detected (boolean, true if detected by system), displayFrequency (number for refresh rate), id (number, unique identifier; -1 means invalid or unknown, -10 means virtual display on unified desktop), internal (boolean, true for internal display, false for external), label (string, user-friendly platform-determined name), maximumCursorSize (Size in native pixels), nativeOrigin (Point in pixel coordinates, only on X11-like systems), rotation (number: 0, 90, 180, or 270 for clockwise degrees), scaleFactor (number for pixel scale factor), touchSupport (string: 'available', 'unavailable', 'unknown'), monochrome (boolean), size (Size), workArea (Rectangle in DIP points), workAreaSize (Size).
EnableHeapProfilingOptions mode property
The mode property is an optional string that controls which processes are profiled, equivalent to the --memlog Chrome flag. Default value is 'all'. Valid values are: 'all' (profile all processes), 'browser' (profile only the browser process), 'gpu' (profile only the GPU process), 'minimal' (profile only the browser and GPU processes), 'renderer-sampling' (profile at most 1 renderer process with fixed probability), 'all-renderers' (profile all renderer processes), 'utility-sampling' (each utility process has fixed probability of being profiled), 'all-utilities' (profile all utility processes), 'utility-and-browser' (profile all utility processes and the browser process).
EnableHeapProfilingOptions stackMode property
The stackMode property is an optional string that controls the type of metadata recorded for each allocation, equivalent to the --memlog-stack-mode Chrome flag. Default value is 'native'. Valid values are: 'native' (instruction addresses from unwinding the stack) and 'native-with-thread-names' (instruction addresses from unwinding the stack, includes thread name as the first frame).
EnableHeapProfilingOptions samplingRate property
The samplingRate property is an optional number that controls the sampling interval in bytes. It must be an integer between 1000 and 10000000. Default value is 100000 (100KB). Lower intervals produce more precise profiles but at the cost of performance. This is equivalent to the --memlog-sampling-rate Chrome flag. A sampling rate of 100KB is sufficient to observe allocation sites that make allocations greater than 500KB total.
GPUFeatureStatus property value possibilities
Each GPUFeatureStatus property can have one of these string values: disabled_software (Software only, hardware acceleration disabled - yellow), disabled_off (Disabled - red), disabled_off_ok (Disabled - yellow), unavailable_software (Software only, hardware acceleration unavailable - yellow), unavailable_off (Unavailable - red), unavailable_off_ok (Unavailable - yellow), enabled_readback (Hardware accelerated but at reduced performance - yellow), enabled_force (Hardware accelerated on all pages - green), enabled (Hardware accelerated - green), enabled_on (Enabled - green), enabled_force_on (Force enabled - green).
GPUFeatureStatus object properties
The GPUFeatureStatus object contains the following string properties: 2d_canvas (Canvas), flash_3d (Flash), flash_stage3d (Flash Stage3D), flash_stage3d_baseline (Flash Stage3D Baseline profile), gpu_compositing (Compositing), multiple_raster_threads (Multiple Raster Threads), native_gpu_memory_buffers (Native GpuMemoryBuffers), rasterization (Rasterization), video_decode (Video Decode), video_encode (Video Encode), vpx_decode (VPx Video Decode), webgl (WebGL), webgl2 (WebGL2).
LanguageModelExpected type values
The `type` property of LanguageModelExpected accepts three possible values: 'text' for text content, 'image' for image content, and 'audio' for audio content.
LanguageModelExpected object structure
The LanguageModelExpected object has two properties: `type` (required string) and `languages` (optional string array). The `type` property can have one of three values: 'text', 'image', or 'audio'.
LanguageModelPromptOptions responseConstraint property
The responseConstraint property is optional and accepts either a JSON schema object or a RegExp to constrain the response to match specified constraints.
LanguageModelPromptOptions signal property
The signal property accepts an AbortSignal from Node.js globals, used to abort the language model operation.
MemoryUsageDetails object properties
The MemoryUsageDetails object contains three properties: count (number), size (number), and liveSize (number).
MemoryInfo peakWorkingSetSize property
The peakWorkingSetSize property of MemoryInfo is an Integer representing the maximum amount of memory that has ever been pinned to actual physical RAM, measured in Kilobytes.
MemoryInfo workingSetSize property
The workingSetSize property of MemoryInfo is an Integer representing the amount of memory currently pinned to actual physical RAM, measured in Kilobytes.