2019-05-21 02:15:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Breaking Changes
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:15:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-28 14:19:18 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version ](tutorial/electron-versioning.md#semver ) before the change is made.
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:15:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Types of Breaking Changes
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:15:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								This document uses the following convention to categorize breaking changes:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  **API Changed:** An API was changed in such a way that code that has not been updated is guaranteed to throw an exception.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  **Behavior Changed:** The behavior of Electron has changed, but not in such a way that an exception will necessarily be thrown.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  **Default Changed:** Code depending on the old default may break, not necessarily throwing an exception. The old behavior can be restored by explicitly specifying the value.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  **Removed:** An API or feature was removed, and is no longer supported by Electron.
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:15:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-21 05:43:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (37.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-25 10:10:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Utility Process unhandled rejection behavior change
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Utility Processes will now warn with an error message when an unhandled
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								rejection occurs instead of crashing the process.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								To restore the previous behavior, you can use:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								process.on('unhandledRejection', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  process.exit(1)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-06-18 04:01:50 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `process.exit()` kills utility process synchronously
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Calling `process.exit()`  in a utility process will now kill the utility process synchronously.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This brings the behavior of `process.exit()`  in line with Node.js behavior.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Please refer to the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Node.js docs ](https://nodejs.org/docs/latest-v22.x/api/process.html#processexitcode ) and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[PR #45690 ](https://github.com/electron/electron/pull/45690 ) to understand the potential
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								implications of that, e.g., when calling `console.log()`  before `process.exit()` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-17 20:34:34 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: WebUSB and WebSerial Blocklist Support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[WebUSB ](https://developer.mozilla.org/en-US/docs/Web/API/WebUSB_API ) and [Web Serial ](https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API ) now support the [WebUSB Blocklist ](https://wicg.github.io/webusb/#blocklist ) and [Web Serial Blocklist ](https://wicg.github.io/serial/#blocklist ) used by Chromium and outlined in their respective specifications.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								To disable these, users can pass `disable-usb-blocklist`  and `disable-serial-blocklist`  as command line flags.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-01 08:52:12 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `null` value for `session` property in `ProtocolResponse`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This deprecated feature has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previously, setting the `ProtocolResponse.session`  property to `null` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								would create a random independent session. This is no longer supported.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Using single-purpose sessions here is discouraged due to overhead costs;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								however, old code that needs to preserve this behavior can emulate it by
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								creating a random session with `session.fromPartition(some_random_string)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								and then using it in `ProtocolResponse.session` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-21 05:43:47 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `BrowserWindow.IsVisibleOnAllWorkspaces()` on Linux
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.IsVisibleOnAllWorkspaces()`  will now return false on Linux if the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								window is not currently visible.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-25 11:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (36.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-26 14:14:03 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changes: `app.commandLine`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`app.commandLine`  will convert upper-cases switches and arguments to lowercase.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`app.commandLine`  was only meant to handle chromium switches (which aren't case-sensitive) and switches passed via `app.commandLine`  will not be passed down to any of the child processes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If you were using `app.commandLine`  to control the behavior of the  main process, you should do this via `process.argv` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-23 04:00:43 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `NativeImage.getBitmap()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`NativeImage.toBitmap()`  returns a newly-allocated copy of the bitmap. `NativeImage.getBitmap()`  was originally an alternative function that returned the original instead of a copy. This changed when sandboxing was introduced, so both return a copy and are functionally equivalent.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Client code should call `NativeImage.toBitmap()`  instead:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bitmap = image.getBitmap()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Use this instead
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bitmap = image.toBitmap()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-25 10:04:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `isDefault` and `status` properties on `PrinterInfo`
 
							 
						 
					
						
							
								
									
										
										
										
											2025-02-27 17:49:58 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								These properties have been removed from the PrinterInfo Object
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								because they have been removed from upstream Chromium.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-07 17:49:21 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `quota` type `syncable` in `Session.clearStorageData(options)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								When calling `Session.clearStorageData(options)` , the `options.quota`  type
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`syncable`  is no longer supported because it has been
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[removed ](https://chromium-review.googlesource.com/c/chromium/src/+/6309405 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								from upstream Chromium.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-25 10:04:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `null` value for `session` property in `ProtocolResponse`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previously, setting the ProtocolResponse.session property to `null` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Would create a random independent session. This is no longer supported.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Using single-purpose sessions here is discouraged due to overhead costs;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								however, old code that needs to preserve this behavior can emulate it by
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								creating a random session with `session.fromPartition(some_random_string)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								and then using it in `ProtocolResponse.session` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-03-07 17:49:21 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `quota` property in `Session.clearStorageData(options)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								When calling `Session.clearStorageData(options)` , the `options.quota` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								property is deprecated. Since the `syncable`  type was removed, there
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								is only type left -- `'temporary'`  -- so specifying it is unnecessary.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-21 18:36:51 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: Extension methods and events on `session`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`session.loadExtension` , `session.removeExtension` , `session.getExtension` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`session.getAllExtensions` , 'extension-loaded' event, 'extension-unloaded'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								event, and 'extension-ready' events have all moved to the new
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`session.extensions`  class.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-19 01:59:00 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `systemPreferences.isAeroGlassEnabled()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `systemPreferences.isAeroGlassEnabled()`  function has been removed without replacement.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It has been always returning `true`  since Electron 23, which only supports Windows 10+, where DWM composition can no longer be disabled.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw#disabling -dwm-composition-windows7-and-earlier
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-25 14:31:28 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Changed: GTK 4 is default when running GNOME
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								After an [upstream change ](https://chromium-review.googlesource.com/c/chromium/src/+/6310469 ), GTK 4 is now the default when running GNOME.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In rare cases, this may cause some applications or configurations to [error ](https://github.com/electron/electron/issues/46538 ) with the following message:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```stderr
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Gtk-ERROR ** : 11:30:38.382: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Affected users can work around this by specifying the `gtk-version`  command-line flag:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$ electron --gtk-version=3   # or --gtk-version=2
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The same can be done with the [`app.commandLine.appendSwitch` ](https://www.electronjs.org/docs/latest/api/command-line#commandlineappendswitchswitch-value ) function.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-13 15:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (35.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-18 16:07:06 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-27 22:01:26 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: Dialog API's `defaultPath` option on Linux
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								On Linux, the required portal version for file dialogs has been reverted
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to 3 from 4. Using the `defaultPath`  option of the Dialog API is not
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								supported when using portal file chooser dialogs unless the portal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								backend is version 4 or higher. The `--xdg-portal-required-version` 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-26 09:45:48 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								[command-line switch ](api/command-line-switches.md#--xdg-portal-required-versionversion )
							 
						 
					
						
							
								
									
										
										
										
											2025-02-27 22:01:26 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								can be used to force a required version for your application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [#44426 ](https://github.com/electron/electron/pull/44426 ) for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-24 08:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `getFromVersionID` on `session.serviceWorkers`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `session.serviceWorkers.fromVersionID(versionId)`  API has been deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								in favor of `session.serviceWorkers.getInfoFromVersionID(versionId)` . This was
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								changed to make it more clear which object is returned with the introduction
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								of the `session.serviceWorkers.getWorkerFromVersionID(versionId)`  API.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.serviceWorkers.fromVersionID(versionId)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.serviceWorkers.getInfoFromVersionID(versionId)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-23 21:12:23 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `setPreloads`, `getPreloads` on `Session`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`registerPreloadScript` , `unregisterPreloadScript` , and `getPreloadScripts`  are introduced as a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								replacement for the deprecated methods. These new APIs allow third-party libraries to register
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								preload scripts without replacing existing scripts. Also, the new `type`  option allows for
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								additional preload targets beyond `frame` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-24 08:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2025-01-23 21:12:23 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.setPreloads([path.join(__dirname, 'preload.js')])
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.registerPreloadScript({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  type: 'frame',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  id: 'app-preload',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  filePath: path.join(__dirname, 'preload.js')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-10-18 16:07:06 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `level`, `message`, `line`, and `sourceId` arguments in `console-message` event on `WebContents`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `console-message`  event on `WebContents`  has been updated to provide details on the `Event` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								argument.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.on('console-message', (event, level, message, line, sourceId) => {})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.on('console-message', ({ level, message, lineNumber, sourceId, frame }) => {})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Additionally, `level`  is now a string with possible values of `info` , `warning` , `error` , and `debug` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-17 12:40:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `urls` property of `WebRequestFilter`.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previously, an empty urls array was interpreted as including all URLs. To explicitly include all URLs, developers should now use the `<all_urls>`  pattern, which is a [designated URL pattern ](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns#all_urls ) that matches every possible URL. This change clarifies the intent and ensures more predictable behavior.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const deprecatedFilter = {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  urls: []
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const newFilter = {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  urls: ['< all_urls > ']
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-10 21:17:07 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `systemPreferences.isAeroGlassEnabled()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `systemPreferences.isAeroGlassEnabled()`  function has been deprecated without replacement.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It has been always returning `true`  since Electron 23, which only supports Windows 10+, where DWM composition can no longer be disabled.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw#disabling -dwm-composition-windows7-and-earlier
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-13 15:15:24 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (34.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Behavior Changed: menu bar will be hidden during fullscreen on Windows
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This brings the behavior to parity with Linux. Prior behavior: Menu bar is still visible during fullscreen on Windows. New behavior: Menu bar is hidden during fullscreen on Windows.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Correction**: This was previously listed as a breaking change in Electron 33, but was first released in Electron 34.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-24 14:38:22 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (33.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-05 15:13:29 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `document.execCommand("paste")`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The synchronous clipboard read API [document.execCommand("paste") ](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard ) has been
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								deprecated in favor of [async clipboard API ](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API ). This is to align with the browser defaults.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `enableDeprecatedPaste`  option on `WebPreferences`  that triggers the permission
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								checks for this API and the associated permission type `deprecated-sync-clipboard-read` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								are also deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-10-11 18:33:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: frame properties may retrieve detached WebFrameMain instances or none at all
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								APIs which provide access to a `WebFrameMain`  instance may return an instance
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								with `frame.detached`  set to `true` , or possibly return `null` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								When a frame performs a cross-origin navigation, it enters into a detached state
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								in which it's no longer attached to the page. In this state, it may be running
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[unload ](https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								handlers prior to being deleted. In the event of an IPC sent during this state,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`frame.detached`  will be set to `true`  with the frame being destroyed shortly
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								thereafter.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								When receiving an event, it's important to access WebFrameMain properties
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								immediately upon being received. Otherwise, it's not guaranteed to point to the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								same webpage as when received. To avoid misaligned expectations, Electron will
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								return `null`  in the case of late access where the webpage has changed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-24 08:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2024-10-11 18:33:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ipcMain.on('unload-event', (event) => {
							 
						 
					
						
							
								
									
										
										
										
											2025-01-24 08:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  event.senderFrame // ✅ accessed immediately
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
									
										
										
										
											2024-10-11 18:33:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcMain.on('unload-event', async (event) => {
							 
						 
					
						
							
								
									
										
										
										
											2025-01-24 08:33:44 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  await crossOriginNavigationPromise
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  event.senderFrame // ❌ returns `null`  due to late access
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
									
										
										
										
											2024-10-11 18:33:53 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-09-26 08:53:27 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: custom protocol URL handling on Windows
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Due to changes made in Chromium to support [Non-Special Scheme URLs ](http://bit.ly/url-non-special ), custom protocol URLs that use Windows file paths will no longer work correctly with the deprecated `protocol.registerFileProtocol`  and the `baseURLForDataURL`  property on `BrowserWindow.loadURL` , `WebContents.loadURL` , and `<webview>.loadURL` .  `protocol.handle`  will also not work with these types of URLs but this is not a change since it has always worked that way.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// No longer works
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerFileProtocol('other', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  callback({ filePath: '/path/to/my/file' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const mainWindow = new BrowserWindow()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mainWindow.loadURL('data:text/html,< script  src = "loaded-from-dataurl.js" ></ script > ', { baseURLForDataURL: 'other://C:\\myapp' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mainWindow.loadURL('other://C:\\myapp\\index.html')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const path = require('node:path')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const nodeUrl = require('node:url')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.handle(other, (req) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  const srcPath = 'C:\\myapp\\'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  const reqURL = new URL(req.url)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return net.fetch(nodeUrl.pathToFileURL(path.join(srcPath, reqURL.pathname)).toString())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mainWindow.loadURL('data:text/html,< script  src = "loaded-from-dataurl.js" > < / script > ', { baseURLForDataURL: 'other://' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mainWindow.loadURL('other://index.html')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-14 11:36:47 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `webContents` property on `login` on `app`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webContents`  property in the `login`  event from `app`  will be `null` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								when the event is triggered for requests from the [utility process ](api/utility-process.md )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								created with `respondToAuthRequestsFromMainProcess`  option.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-12 10:32:35 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `textured` option in `BrowserWindowConstructorOption.type`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `textured`  option of `type`  in `BrowserWindowConstructorOptions`  has been deprecated with no replacement. This option relied on the [`NSWindowStyleMaskTexturedBackground` ](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktexturedbackground ) style mask on macOS, which has been deprecated with no alternative.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-02 09:02:11 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: macOS 10.15 support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								macOS 10.15 (Catalina) is no longer supported by [Chromium ](https://chromium-review.googlesource.com/c/chromium/src/+/5734361 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Older versions of Electron will continue to run on Catalina, but macOS 11 (Big Sur)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								or later will be required to run Electron v33.0.0 and higher.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-03 22:19:26 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: Native modules now require C++20
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Due to changes made upstream, both
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[V8 ](https://chromium-review.googlesource.com/c/v8/v8/+/5587859 ) and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Node.js ](https://github.com/nodejs/node/pull/45427 ) now require C++20 as a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								minimum version. Developers using native node modules should build their
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								modules with `--std=c++20`  rather than `--std=c++17` . Images using gcc9 or
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								lower may need to update to gcc10 in order to compile. See
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[#43555 ](https://github.com/electron/electron/pull/43555 ) for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-24 14:38:22 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `systemPreferences.accessibilityDisplayShouldReduceTransparency`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `systemPreferences.accessibilityDisplayShouldReduceTransparency`  property is now deprecated in favor of the new `nativeTheme.prefersReducedTransparency` , which provides identical information and works cross-platform.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const shouldReduceTransparency = systemPreferences.accessibilityDisplayShouldReduceTransparency
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const prefersReducedTransparency = nativeTheme.prefersReducedTransparency
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-15 11:07:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (32.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `File.path`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The nonstandard `path`  property of the Web `File`  object was added in an early version of Electron as a convenience method for working with native files when doing everything in the renderer was more common. However, it represents a deviation from the standard and poses a minor security risk as well, so beginning in Electron 32.0 it has been removed in favor of the [`webUtils.getPathForFile` ](api/web-utils.md#webutilsgetpathforfilefile ) method.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Before (renderer)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-01 13:44:33 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const file = document.querySelector('input[type=file]').files[0]
							 
						 
					
						
							
								
									
										
										
										
											2024-05-15 11:07:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								alert(`Uploaded file path was: ${file.path}` )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// After (renderer)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-12-01 13:44:33 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const file = document.querySelector('input[type=file]').files[0]
							 
						 
					
						
							
								
									
										
										
										
											2024-05-15 11:07:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								electron.showFilePath(file)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// (preload)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { contextBridge, webUtils } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								contextBridge.exposeInMainWorld('electron', {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  showFilePath (file) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // It's best not to expose the full file path to the web content if
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // possible.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    const path = webUtils.getPathForFile(file)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    alert(`Uploaded file path was: ${path}` )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-06 17:07:36 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `clearHistory`, `canGoBack`, `goBack`, `canGoForward`, `goForward`, `goToIndex`, `canGoToOffset`, `goToOffset` on `WebContents`
 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-05 09:34:47 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The navigation-related APIs are now deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								These APIs have been moved to the `navigationHistory`  property of `WebContents`  to provide a more structured and intuitive interface for managing navigation history.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.clearHistory()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.canGoBack()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.goBack()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.canGoForward()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.goForward()
							 
						 
					
						
							
								
									
										
										
										
											2024-08-06 17:07:36 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								win.webContents.goToIndex(index)
							 
						 
					
						
							
								
									
										
										
										
											2024-06-05 09:34:47 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								win.webContents.canGoToOffset()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.goToOffset(index)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.clear()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.canGoBack()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.goBack()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.canGoForward()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.goForward()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.canGoToOffset()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.navigationHistory.goToOffset(index)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-03 22:28:44 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior changed: Directory `databases` in `userData` will be deleted
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If you have a directory called `databases`  in the directory returned by
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`app.getPath('userData')` , it will be deleted when Electron 32 is first run.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `databases`  directory was used by WebSQL, which was removed in Electron 31.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium now performs a cleanup that deletes this directory. See
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[issue #45396 ](https://github.com/electron/electron/issues/45396 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-15 18:10:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (31.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-10 11:21:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `WebSQL` support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium has removed support for WebSQL upstream, transitioning it to Android only. See
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Chromium's intent to remove discussion ](https://groups.google.com/a/chromium.org/g/blink-dev/c/fWYb6evVA-w/m/wGI863zaAAAJ )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								for more information.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-06-05 09:34:47 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `nativeImage.toDataURL` will preserve PNG colorspace
 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-15 18:10:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								PNG decoder implementation has been changed to preserve colorspace data, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								encoded data returned from this function now matches it.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [crbug.com/332584706 ](https://issues.chromium.org/issues/332584706 ) for more information.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-04-17 12:42:34 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `window.flashFrame(bool)` will flash dock icon continuously on macOS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This brings the behavior to parity with Windows and Linux. Prior behavior: The first `flashFrame(true)`  bounces the dock icon only once (using the [NSInformationalRequest ](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nsinformationalrequest ) level) and `flashFrame(false)`  does nothing. New behavior: Flash continuously until `flashFrame(false)`  is called. This uses the [NSCriticalRequest ](https://developer.apple.com/documentation/appkit/nsrequestuserattentiontype/nscriticalrequest ) level instead. To explicitly use `NSInformationalRequest`  to cause a single dock icon bounce, it is still possible to use [`dock.bounce('informational')` ](https://www.electronjs.org/docs/latest/api/dock#dockbouncetype-macos ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-03 09:52:49 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (30.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Behavior Changed: cross-origin iframes now use Permission Policy to access features
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Cross-origin iframes must now specify features available to a given `iframe`  via the `allow` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								attribute in order to access them.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [documentation ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#allow ) for
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								more information.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-11 19:33:40 +13:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: The `--disable-color-correct-rendering` switch
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This switch was never formally documented but it's removal is being noted here regardless. Chromium itself now has better support for color spaces so this flag should not be needed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-17 12:20:53 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `BrowserView.setAutoResize` behavior on macOS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 30, BrowserView is now a wrapper around the new [WebContentsView ](api/web-contents-view.md ) API.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previously, the `setAutoResize`  function of the `BrowserView`  API was backed by [autoresizing ](https://developer.apple.com/documentation/appkit/nsview/1483281-autoresizingmask?language=objc ) on macOS, and by a custom algorithm on Windows and Linux.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For simple use cases such as making a BrowserView fill the entire window, the behavior of these two approaches was identical.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								However, in more advanced cases, BrowserViews would be autoresized differently on macOS than they would be on other platforms, as the custom resizing algorithm for Windows and Linux did not perfectly match the behavior of macOS's autoresizing API.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The autoresizing behavior is now standardized across all platforms.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If your app uses `BrowserView.setAutoResize`  to do anything more complex than making a BrowserView fill the entire window, it's likely you already had custom logic in place to handle this difference in behavior on macOS.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If so, that logic will no longer be needed in Electron 30 as autoresizing behavior is consistent.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-06 17:07:36 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `BrowserView`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The [`BrowserView` ](./api/browser-view.md ) class has been deprecated and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								replaced by the new [`WebContentsView` ](./api/web-contents-view.md ) class.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserView`  related methods in [`BrowserWindow` ](./api/browser-window.md ) have
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								also been deprecated:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.fromBrowserView(browserView)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setBrowserView(browserView)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.getBrowserView()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.addBrowserView(browserView)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.removeBrowserView(browserView)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setTopBrowserView(browserView)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.getBrowserViews()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-26 13:47:16 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `params.inputFormType` property on `context-menu` on `WebContents`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `inputFormType`  property of the params object in the `context-menu` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								event from `WebContents`  has been removed. Use the new `formControlType` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								property instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-29 10:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `process.getIOCounters()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium has removed access to this information.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-18 12:05:41 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (29.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-31 14:29:40 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `ipcRenderer` can no longer be sent over the `contextBridge`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-02-21 11:25:53 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Attempting to send the entire `ipcRenderer`  module as an object over the `contextBridge`  will now result in
							 
						 
					
						
							
								
									
										
										
										
											2023-10-31 14:29:40 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								an empty object on the receiving side of the bridge. This change was made to remove / mitigate
							 
						 
					
						
							
								
									
										
										
										
											2024-02-21 11:25:53 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								a security footgun. You should not directly expose ipcRenderer or its methods over the bridge.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Instead, provide a safe wrapper like below:
							 
						 
					
						
							
								
									
										
										
										
											2023-10-31 14:29:40 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								contextBridge.exposeInMainWorld('app', {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  onEvent: (cb) => ipcRenderer.on('foo', (e, ...args) => cb(args))
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-18 12:05:41 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `renderer-process-crashed` event on `app`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `renderer-process-crashed`  event on `app`  has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `render-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('renderer-process-crashed', (event, webContents, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('render-process-gone', (event, webContents, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `crashed` event on `WebContents` and `<webview>`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `crashed`  events on `WebContents`  and `<webview>`  have been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `render-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('crashed', (event, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.addEventListener('crashed', (event) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('render-process-gone', (event, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.addEventListener('render-process-gone', (event) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-26 14:05:40 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `gpu-process-crashed` event on `app`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `gpu-process-crashed`  event on `app`  has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `child-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('gpu-process-crashed', (event, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('child-process-gone', (event, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-21 15:58:09 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (28.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 22:00:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `WebContents.backgroundThrottling` set to false affects all `WebContents` in the host `BrowserWindow`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`WebContents.backgroundThrottling`  set to false will disable frames throttling
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								in the `BrowserWindow`  for all `WebContents`  displayed by it.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-21 15:58:09 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `BrowserWindow.setTrafficLightPosition(position)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.setTrafficLightPosition(position)`  has been removed, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.setWindowButtonPosition(position)`  API should be used instead
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								which accepts `null`  instead of `{ x: 0, y: 0 }`  to reset the position to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								system default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 28
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setTrafficLightPosition({ x: 10, y: 10 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setTrafficLightPosition({ x: 0, y: 0 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setWindowButtonPosition({ x: 10, y: 10 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setWindowButtonPosition(null)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `BrowserWindow.getTrafficLightPosition()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.getTrafficLightPosition()`  has been removed, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.getWindowButtonPosition()`  API should be used instead
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								which returns `null`  instead of `{ x: 0, y: 0 }`  when there is no custom
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 28
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const pos = win.getTrafficLightPosition()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if (pos.x === 0 & &  pos.y === 0) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  // No custom position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const ret = win.getWindowButtonPosition()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if (ret === null) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  // No custom position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-28 16:29:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `ipcRenderer.sendTo()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `ipcRenderer.sendTo()`  API has been removed. It should be replaced by setting up a [`MessageChannel` ](tutorial/message-ports.md#setting-up-a-messagechannel-between-two-renderers ) between the renderers.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `senderId`  and `senderIsMainFrame`  properties of `IpcRendererEvent`  have been removed as well.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-02 10:55:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `app.runningUnderRosettaTranslation`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `app.runningUnderRosettaTranslation`  property has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use `app.runningUnderARM64Translation`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(app.runningUnderRosettaTranslation)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(app.runningUnderARM64Translation)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-11 01:49:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `renderer-process-crashed` event on `app`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `renderer-process-crashed`  event on `app`  has been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `render-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('renderer-process-crashed', (event, webContents, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('render-process-gone', (event, webContents, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-01 10:02:12 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `params.inputFormType` property on `context-menu` on `WebContents`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `inputFormType`  property of the params object in the `context-menu` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								event from `WebContents`  has been deprecated. Use the new `formControlType` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								property instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-11 01:49:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `crashed` event on `WebContents` and `<webview>`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `crashed`  events on `WebContents`  and `<webview>`  have been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `render-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('crashed', (event, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.addEventListener('crashed', (event) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('render-process-gone', (event, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.addEventListener('render-process-gone', (event) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-10-12 20:53:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `gpu-process-crashed` event on `app`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `gpu-process-crashed`  event on `app`  has been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `child-process-gone`  event instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('gpu-process-crashed', (event, killed) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.on('child-process-gone', (event, details) => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-26 12:29:00 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (27.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: macOS 10.13 / 10.14 support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								macOS 10.13 (High Sierra) and macOS 10.14 (Mojave) are no longer supported by [Chromium ](https://chromium-review.googlesource.com/c/chromium/src/+/4629466 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Older versions of Electron will continue to run on these operating systems, but macOS 10.15 (Catalina)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								or later will be required to run Electron v27.0.0 and higher.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-07-21 11:16:44 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `ipcRenderer.sendTo()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `ipcRenderer.sendTo()`  API has been deprecated. It should be replaced by setting up a [`MessageChannel` ](tutorial/message-ports.md#setting-up-a-messagechannel-between-two-renderers ) between the renderers.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-09 16:38:48 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The `senderId`  and `senderIsMainFrame`  properties of `IpcRendererEvent`  have been deprecated as well.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-14 01:37:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: color scheme events in `systemPreferences`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `systemPreferences`  events have been removed:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `inverted-color-scheme-changed` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `high-contrast-color-scheme-changed` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `updated`  event on the `nativeTheme`  module instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.on('updated', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-07 22:56:52 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: Some `window.setVibrancy` options on macOS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following vibrancy options have been removed:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  'light'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  'medium-light'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  'dark'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  'ultra-dark'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  'appearance-based'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								These were previously deprecated and have been removed by Apple in 10.15.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-05 01:16:41 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `webContents.getPrinters`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webContents.getPrinters`  method has been removed. Use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.getPrintersAsync`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(w.webContents.getPrinters())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.getPrintersAsync().then((printers) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(printers)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-11 08:34:13 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `systemPreferences.{get,set}AppLevelAppearance` and `systemPreferences.appLevelAppearance`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `systemPreferences.getAppLevelAppearance`  and `systemPreferences.setAppLevelAppearance` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								methods have been removed, as well as the `systemPreferences.appLevelAppearance`  property.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the `nativeTheme`  module instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getAppLevelAppearance()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.appLevelAppearance
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.setAppLevelAppearance('dark')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.themeSource = 'dark'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `alternate-selected-control-text` value for `systemPreferences.getColor`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `alternate-selected-control-text`  value for `systemPreferences.getColor` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								has been removed. Use `selected-content-background`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getColor('alternate-selected-control-text')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getColor('selected-content-background')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-10 02:50:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (26.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: `webContents.getPrinters`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webContents.getPrinters`  method has been deprecated. Use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.getPrintersAsync`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(w.webContents.getPrinters())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.getPrintersAsync().then((printers) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(printers)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-08-14 02:34:04 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `systemPreferences.{get,set}AppLevelAppearance` and `systemPreferences.appLevelAppearance`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `systemPreferences.getAppLevelAppearance`  and `systemPreferences.setAppLevelAppearance` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								methods have been deprecated, as well as the `systemPreferences.appLevelAppearance`  property.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the `nativeTheme`  module instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getAppLevelAppearance()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.appLevelAppearance
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.setAppLevelAppearance('dark')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.themeSource = 'dark'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: `alternate-selected-control-text` value for `systemPreferences.getColor`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `alternate-selected-control-text`  value for `systemPreferences.getColor` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								has been deprecated. Use `selected-content-background`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getColor('alternate-selected-control-text')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.getColor('selected-content-background')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-03-27 10:00:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (25.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-08-06 17:07:36 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `protocol.{un,}{register,intercept}{Buffer,String,Stream,File,Http}Protocol` and `protocol.isProtocol{Registered,Intercepted}`
 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-27 10:00:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `protocol.register*Protocol`  and `protocol.intercept*Protocol`  methods have
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								been replaced with [`protocol.handle` ](api/protocol.md#protocolhandlescheme-handler ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The new method can either register a new protocol or intercept an existing
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol, and responses can be of any type.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 25
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerBufferProtocol('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  callback({ mimeType: 'text/html', data: Buffer.from('< h5 > Response< / h5 > ') })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.handle('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return new Response(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    Buffer.from('< h5 > Response< / h5 > '), // Could also be a string or ReadableStream.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { headers: { 'content-type': 'text/html' } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 25
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerHttpProtocol('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  callback({ url: 'https://electronjs.org' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.handle('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return net.fetch('https://electronjs.org')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 25
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerFileProtocol('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  callback({ filePath: '/path/to/my/file' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.handle('some-protocol', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return net.fetch('file:///path/to/my/file')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-04-06 21:23:29 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `BrowserWindow.setTrafficLightPosition(position)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.setTrafficLightPosition(position)`  has been deprecated, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.setWindowButtonPosition(position)`  API should be used instead
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								which accepts `null`  instead of `{ x: 0, y: 0 }`  to reset the position to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								system default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 25
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setTrafficLightPosition({ x: 10, y: 10 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setTrafficLightPosition({ x: 0, y: 0 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setWindowButtonPosition({ x: 10, y: 10 })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setWindowButtonPosition(null)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: `BrowserWindow.getTrafficLightPosition()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.getTrafficLightPosition()`  has been deprecated, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindow.getWindowButtonPosition()`  API should be used instead
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								which returns `null`  instead of `{ x: 0, y: 0 }`  when there is no custom
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 25
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const pos = win.getTrafficLightPosition()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if (pos.x === 0 & &  pos.y === 0) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  // No custom position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const ret = win.getWindowButtonPosition()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if (ret === null) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  // No custom position.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-17 19:06:32 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (24.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-03-09 03:48:29 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `nativeImage.createThumbnailFromPath(path, size)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `maxSize`  parameter has been changed to `size`  to reflect that the size passed in will be the size the thumbnail created. Previously, Windows would not scale the image up if it were smaller than `maxSize` , and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								macOS would always set the size to `maxSize` . Behavior is now the same across platforms.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Updated Behavior:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// a 128x128 image.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const imagePath = path.join('path', 'to', 'capybara.png')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Scaling up a smaller image.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const upSize = { width: 256, height: 256 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeImage.createThumbnailFromPath(imagePath, upSize).then(result => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(result.getSize()) // { width: 256, height: 256 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Scaling down a larger image.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const downSize = { width: 64, height: 64 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeImage.createThumbnailFromPath(imagePath, downSize).then(result => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(result.getSize()) // { width: 64, height: 64 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previous Behavior (on Windows):
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// a 128x128 image
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const imagePath = path.join('path', 'to', 'capybara.png')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const size = { width: 256, height: 256 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeImage.createThumbnailFromPath(imagePath, size).then(result => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(result.getSize()) // { width: 128, height: 128 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-27 14:47:46 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (23.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-24 11:10:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: Draggable Regions on macOS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The implementation of draggable regions (using the CSS property `-webkit-app-region: drag` ) has changed on macOS to bring it in line with Windows and Linux. Previously, when a region with `-webkit-app-region: no-drag`  overlapped a region with `-webkit-app-region: drag` , the `no-drag`  region would always take precedence on macOS, regardless of CSS layering. That is, if a `drag`  region was above a `no-drag`  region, it would be ignored. Beginning in Electron 23, a `drag`  region on top of a `no-drag`  region will correctly cause the region to be draggable.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Additionally, the `customButtonsOnHover`  BrowserWindow property previously created a draggable region which ignored the `-webkit-app-region`  CSS property. This has now been fixed (see [#37210 ](https://github.com/electron/electron/issues/37210#issuecomment-1440509592 ) for discussion).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								As a result, if your app uses a frameless window with draggable regions on macOS, the regions which are draggable in your app may change in Electron 23.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-12-01 02:13:29 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: Windows 7 / 8 / 8.1 support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Windows 7, Windows 8, and Windows 8.1 are no longer supported ](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice ). Electron follows the planned Chromium deprecation policy, which will [deprecate Windows 7 support beginning in Chromium 109 ](https://support.google.com/chrome/thread/185534985/sunsetting-support-for-windows-7-8-8-1-in-early-2023?hl=en ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Older versions of Electron will continue to run on these operating systems, but Windows 10 or later will be required to run Electron v23.0.0 and higher.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-27 14:47:46 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: BrowserWindow `scroll-touch-*` events
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The deprecated `scroll-touch-begin` , `scroll-touch-end`  and `scroll-touch-edge` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								events on BrowserWindow have been removed. Instead, use the newly available
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[`input-event` event ](api/web-contents.md#event-input-event ) on WebContents.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 23.0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-begin', scrollTouchBegin)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-edge', scrollTouchEdge)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-end', scrollTouchEnd)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('input-event', (_, event) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (event.type === 'gestureScrollBegin') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchBegin()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  } else if (event.type === 'gestureScrollUpdate') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchEdge()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  } else if (event.type === 'gestureScrollEnd') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchEnd()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-05 10:51:33 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `webContents.incrementCapturerCount(stayHidden, stayAwake)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webContents.incrementCapturerCount(stayHidden, stayAwake)`  function has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It is now automatically handled by `webContents.capturePage`  when a page capture completes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 23
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.incrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  w.webContents.decrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `webContents.decrementCapturerCount(stayHidden, stayAwake)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webContents.decrementCapturerCount(stayHidden, stayAwake)`  function has been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It is now automatically handled by `webContents.capturePage`  when a page capture completes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 23
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.incrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  w.webContents.decrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-09 23:57:05 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (22.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-05 10:51:33 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `webContents.incrementCapturerCount(stayHidden, stayAwake)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.incrementCapturerCount(stayHidden, stayAwake)`  has been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It is now automatically handled by `webContents.capturePage`  when a page capture completes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 23
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.incrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  w.webContents.decrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-13 08:40:25 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `webContents.decrementCapturerCount(stayHidden, stayAwake)`
 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-05 10:51:33 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.decrementCapturerCount(stayHidden, stayAwake)`  has been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								It is now automatically handled by `webContents.capturePage`  when a page capture completes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({ show: false })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 23
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.webContents.incrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  w.webContents.decrementCapturerCount()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								w.capturePage().then(image => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(image.toDataURL())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-09 23:57:05 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: WebContents `new-window` event
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `new-window`  event of WebContents has been removed. It is replaced by [`webContents.setWindowOpenHandler()` ](api/web-contents.md#contentssetwindowopenhandlerhandler ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2022-10-05 10:51:33 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed in Electron 22
							 
						 
					
						
							
								
									
										
										
										
											2022-08-09 23:57:05 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webContents.on('new-window', (event) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  event.preventDefault()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.setWindowOpenHandler((details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return { action: 'deny' }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-31 16:47:08 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `<webview>` `new-window` event
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `new-window`  event of `<webview>`  has been removed. There is no direct replacement.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 22
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.addEventListener('new-window', (event) => {})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-20 23:50:08 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2023-05-31 16:47:08 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// main.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mainWindow.webContents.on('did-attach-webview', (event, wc) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  wc.setWindowOpenHandler((details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    mainWindow.webContents.send('webview-new-window', wc.id, details)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return { action: 'deny' }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// preload.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { ipcRenderer } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcRenderer.on('webview-new-window', (e, webContentsId, details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log('webview-new-window', webContentsId, details)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  document.getElementById('webview').dispatchEvent(new Event('new-window'))
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// renderer.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								document.getElementById('webview').addEventListener('new-window', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log('got new-window event')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-27 14:47:46 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: BrowserWindow `scroll-touch-*` events
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `scroll-touch-begin` , `scroll-touch-end`  and `scroll-touch-edge`  events on
							 
						 
					
						
							
								
									
										
										
										
											2024-05-28 11:15:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								BrowserWindow are deprecated. Instead, use the newly available
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[`input-event` event ](api/web-contents.md#event-input-event ) on WebContents.
							 
						 
					
						
							
								
									
										
										
										
											2022-09-27 14:47:46 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-begin', scrollTouchBegin)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-edge', scrollTouchEdge)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.on('scroll-touch-end', scrollTouchEnd)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.webContents.on('input-event', (_, event) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (event.type === 'gestureScrollBegin') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchBegin()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  } else if (event.type === 'gestureScrollUpdate') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchEdge()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  } else if (event.type === 'gestureScrollEnd') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    scrollTouchEnd()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-28 11:47:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (21.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-08 15:39:53 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-07-05 08:28:22 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: V8 Memory Cage enabled
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The V8 memory cage has been enabled, which has implications for native modules
							 
						 
					
						
							
								
									
										
										
										
											2024-05-28 11:15:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								which wrap non-V8 memory with `ArrayBuffer`  or `Buffer` . See the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[blog post about the V8 memory cage ](https://www.electronjs.org/blog/v8-memory-cage ) for
							 
						 
					
						
							
								
									
										
										
										
											2022-07-05 08:28:22 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-05-31 08:21:25 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `webContents.printToPDF()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.printToPDF()`  has been modified to conform to [`Page.printToPDF` ](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF ) in the Chrome DevTools Protocol. This has been changes in order to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								address changes upstream that made our previous implementation untenable and rife with bugs.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Arguments Changed**
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `pageRanges` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Arguments Removed**
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `printSelectionOnly` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `marginsType` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `headerFooter` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `scaleFactor` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**Arguments Added**
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `headerTemplate` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `footerTemplate` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `displayHeaderFooter` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `margins` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `scale` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `preferCSSPageSize` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Main process
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { webContents } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.printToPDF({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  landscape: true,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  displayHeaderFooter: true,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  printBackground: true,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  scale: 2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  pageSize: 'Ledger',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  margins: {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    top: 2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    bottom: 2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    left: 2,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    right: 2
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  },
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  pageRanges: '1-5, 8, 11-13',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  headerTemplate: '< h1 > Title< / h1 > ',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  footerTemplate: '< div > < span  class = "pageNumber" > < / span > < / div > ',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  preferCSSPageSize: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}).then(data => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  fs.writeFile(pdfPath, data, (error) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if (error) throw error
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    console.log(`Wrote PDF successfully to ${pdfPath}` )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}).catch(error => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(`Failed to write PDF to ${pdfPath}: ` , error)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-28 11:47:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (20.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-16 01:29:02 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: macOS 10.11 / 10.12 support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								macOS 10.11 (El Capitan) and macOS 10.12 (Sierra) are no longer supported by [Chromium ](https://chromium-review.googlesource.com/c/chromium/src/+/3646050 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Older versions of Electron will continue to run on these operating systems, but macOS 10.13 (High Sierra)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								or later will be required to run Electron v20.0.0 and higher.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-08 15:39:53 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: renderers without `nodeIntegration: true` are sandboxed by default
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previously, renderers that specified a preload script defaulted to being
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								unsandboxed. This meant that by default, preload scripts had access to Node.js.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 20, this default has changed. Beginning in Electron 20, renderers
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								will be sandboxed by default, unless `nodeIntegration: true`  or `sandbox: false` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								is specified.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If your preload scripts do not depend on Node, no action is needed. If your
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								preload scripts _do_  depend on Node, either refactor them to remove Node usage
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								from the renderer, or explicitly specify `sandbox: false`  for the relevant
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								renderers.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-22 01:12:20 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `skipTaskbar` on Linux
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								On X11, `skipTaskbar`  sends a `_NET_WM_STATE_SKIP_TASKBAR`  message to the X11
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								window manager. There is not a direct equivalent for Wayland, and the known
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								workarounds have unacceptable tradeoffs (e.g. Window.is_skip_taskbar in GNOME
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								requires unsafe mode), so Electron is unable to support this feature on Linux.
							 
						 
					
						
							
								
									
										
										
										
											2022-03-08 15:39:53 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-27 15:50:08 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `session.setDevicePermissionHandler(handler)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The handler invoked when `session.setDevicePermissionHandler(handler)`  is used
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								has a change to its arguments.  This handler no longer is passed a frame
							 
						 
					
						
							
								
									
										
										
										
											2023-01-08 23:37:57 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								[`WebFrameMain` ](api/web-frame-main.md ), but instead is passed the `origin` , which
							 
						 
					
						
							
								
									
										
										
										
											2022-06-27 15:50:08 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								is the origin that is checking for device permission.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-28 15:06:11 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (19.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-30 21:53:03 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: IA32 Linux binaries
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This is a result of Chromium 102.0.4999.0 dropping support for IA32 Linux.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This concludes the [removal of support for IA32 Linux ](#removed-ia32-linux-support ).
							 
						 
					
						
							
								
									
										
										
										
											2022-03-28 15:06:11 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-06 09:28:03 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (18.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `nativeWindowOpen`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Prior to Electron 15, `window.open`  was by default shimmed to use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindowProxy` . This meant that `window.open('about:blank')`  did not work
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to open synchronously scriptable child windows, among other incompatibilities.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Since Electron 15, `nativeWindowOpen`  has been enabled by default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See the documentation for [window.open in Electron ](api/window-open.md )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-02 11:31:47 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (17.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: `desktopCapturer.getSources` in the renderer
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `desktopCapturer.getSources`  API is now only available in the main process.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This has been changed in order to improve the default security of Electron
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								apps.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If you need this functionality, it can be replaced as follows:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Main process
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { ipcMain, desktopCapturer } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcMain.handle(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  'DESKTOP_CAPTURER_GET_SOURCES',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  (event, opts) => desktopCapturer.getSources(opts)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Renderer process
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { ipcRenderer } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const desktopCapturer = {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  getSources: (opts) => ipcRenderer.invoke('DESKTOP_CAPTURER_GET_SOURCES', opts)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								However, you should consider further restricting the information returned to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the renderer; for instance, displaying a source selector to the user and only
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								returning the selected source.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-06 14:08:59 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `nativeWindowOpen`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Prior to Electron 15, `window.open`  was by default shimmed to use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindowProxy` . This meant that `window.open('about:blank')`  did not work
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to open synchronously scriptable child windows, among other incompatibilities.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Since Electron 15, `nativeWindowOpen`  has been enabled by default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See the documentation for [window.open in Electron ](api/window-open.md )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-04 10:16:05 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (16.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-03 14:01:12 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Behavior Changed: `crashReporter` implementation switched to Crashpad on Linux
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The underlying implementation of the `crashReporter`  API on Linux has changed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								from Breakpad to Crashpad, bringing it in line with Windows and Mac. As a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								result of this, child processes are now automatically monitored, and calling
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`process.crashReporter.start`  in Node child processes is no longer needed (and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								is not advisable, as it will start a second instance of the Crashpad reporter).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								There are also some subtle changes to how annotations will be reported on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Linux, including that long values will no longer be split between annotations
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								appended with `__1` , `__2`  and so on, and instead will be truncated at the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								(new, longer) annotation value limit.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-02 11:31:47 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `desktopCapturer.getSources` in the renderer
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Usage of the `desktopCapturer.getSources`  API in the renderer has been
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								deprecated and will be removed. This change improves the default security of
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron apps.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [here ](#removed-desktopcapturergetsources-in-the-renderer ) for details on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								how to replace this API in your app.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 23:55:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (15.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Default Changed: `nativeWindowOpen` defaults to `true`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Prior to Electron 15, `window.open`  was by default shimmed to use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`BrowserWindowProxy` . This meant that `window.open('about:blank')`  did not work
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to open synchronously scriptable child windows, among other incompatibilities.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`nativeWindowOpen`  is no longer experimental, and is now the default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See the documentation for [window.open in Electron ](api/window-open.md )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-26 19:42:56 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `app.runningUnderRosettaTranslation`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `app.runningUnderRosettaTranslation`  property has been deprecated.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use `app.runningUnderARM64Translation`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(app.runningUnderRosettaTranslation)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(app.runningUnderARM64Translation)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-26 14:23:35 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (14.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-31 11:14:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `remote` module
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `remote`  module was deprecated in Electron 12, and will be removed in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 14. It is replaced by the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[`@electron/remote` ](https://github.com/electron/remote ) module.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 12:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { BrowserWindow } = require('electron').remote
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { BrowserWindow } = require('@electron/remote ')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// In the main process:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('@electron/remote/main ').initialize()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-21 13:59:11 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `app.allowRendererProcessReuse`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `app.allowRendererProcessReuse`  property will be removed as part of our plan to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								more closely align with Chromium's process model for security, performance and maintainability.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For more detailed information see [#18397 ](https://github.com/electron/electron/issues/18397 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Removed: Browser Window Affinity
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `affinity`  option when constructing a new `BrowserWindow`  will be removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								as part of our plan to more closely align with Chromium's process model for security,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								performance and maintainability.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For more detailed information see [#18397 ](https://github.com/electron/electron/issues/18397 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-07 10:32:32 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `window.open()`
 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 11:20:58 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The optional parameter `frameName`  will no longer set the title of the window. This now follows the specification described by the [native documentation ](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters ) under the corresponding parameter `windowName` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 12:02:23 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								If you were using this parameter to set the title of a window, you can instead use [win.setTitle(title) ](api/browser-window.md#winsettitletitle ).
							 
						 
					
						
							
								
									
										
										
										
											2021-02-05 11:20:58 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-26 14:23:35 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `worldSafeExecuteJavaScript`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 14, `worldSafeExecuteJavaScript`  will be removed.  There is no alternative, please
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ensure your code works with this property enabled.  It has been enabled by default since Electron
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								12.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								You will be affected by this change if you use either `webFrame.executeJavaScript`  or `webFrame.executeJavaScriptInIsolatedWorld` . You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API ](api/context-bridge.md#parameter--error--return-type-support ) as these methods use the same value passing semantics.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-21 10:55:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: BrowserWindowConstructorOptions inheriting from parent windows
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Prior to Electron 14, windows opened with `window.open`  would inherit
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow constructor options such as `transparent`  and `resizable`  from
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								their parent window. Beginning with Electron 14, this behavior is removed, and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								windows will not inherit any BrowserWindow constructor options from their
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								parents.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Instead, explicitly set options for the new window with `setWindowOpenHandler` :
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.setWindowOpenHandler((details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    action: 'allow',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    overrideBrowserWindowOptions: {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      // ...
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-19 15:46:54 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `additionalFeatures`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The deprecated `additionalFeatures`  property in the `new-window`  and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`did-create-window`  events of WebContents has been removed. Since `new-window` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								uses positional arguments, the argument is still present, but will always be
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the empty array `[]` . (Though note, the `new-window`  event itself is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								deprecated, and is replaced by `setWindowOpenHandler` .) Bare keys in window
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								features will now present as keys with the value `true`  in the options object.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 14
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Triggered by window.open('...', '', 'my-key')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.on('did-create-window', (window, details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (details.additionalFeatures.includes('my-key')) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // ...
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.on('did-create-window', (window, details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (details.options['my-key']) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // ...
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 12:44:16 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (13.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-07 15:44:56 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `session.setPermissionCheckHandler(handler)`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `handler`  methods first parameter was previously always a `webContents` , it can now sometimes be `null` .  You should use the `requestingOrigin` , `embeddingOrigin`  and `securityOrigin`  properties to respond to the permission check correctly.  As the `webContents`  can be `null`  it can no longer be relied on.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Old code
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.setPermissionCheckHandler((webContents, permission) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (webContents.getURL().startsWith('https://google.com/') & &  permission === 'notification') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return false
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (new URL(requestingOrigin).hostname === 'google.com' & &  permission === 'notification') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return false
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 12:44:16 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `shell.moveItemToTrash()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The deprecated synchronous `shell.moveItemToTrash()`  API has been removed. Use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the asynchronous `shell.trashItem()`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								shell.moveItemToTrash(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								shell.trashItem(path).then(/* ... */)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-30 23:40:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `BrowserWindow` extension APIs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The deprecated extension APIs have been removed:
							 
						 
					
						
							
								
									
										
										
										
											2020-12-07 23:08:19 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-30 23:40:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.addExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.addDevToolsExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.removeExtension(name)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.removeDevToolsExtension(name)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.getExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.getDevToolsExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the session APIs instead:
							 
						 
					
						
							
								
									
										
										
										
											2020-12-07 23:08:19 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-30 23:40:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `ses.loadExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `ses.removeExtension(extension_id)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `ses.getAllExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.addExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.addDevToolsExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.loadExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.removeExtension(name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.removeDevToolsExtension(name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.removeExtension(extension_id)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.getExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.getDevToolsExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.getAllExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-16 00:34:24 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: methods in `systemPreferences`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `systemPreferences`  methods have been deprecated:
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 00:31:26 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-16 00:34:24 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isDarkMode()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isInvertedColorScheme()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isHighContrastColorScheme()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the following `nativeTheme`  properties instead:
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 00:31:26 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-16 00:34:24 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseDarkColors` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseInvertedColorScheme` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseHighContrastColors` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isDarkMode()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isInvertedColorScheme()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseInvertedColorScheme
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isHighContrastColorScheme()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseHighContrastColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-08 07:52:14 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: WebContents `new-window` event
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `new-window`  event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()` ](api/web-contents.md#contentssetwindowopenhandlerhandler ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 13
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.on('new-window', (event) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  event.preventDefault()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.setWindowOpenHandler((details) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return { action: 'deny' }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (12.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-15 18:30:41 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: Pepper Flash support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium has removed support for Flash, and so we must follow suit. See
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium's [Flash Roadmap ](https://www.chromium.org/flash-roadmap ) for more
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-26 14:23:35 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: `worldSafeExecuteJavaScript` defaults to `true`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 12, `worldSafeExecuteJavaScript`  will be enabled by default.  To restore
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the previous behavior, `worldSafeExecuteJavaScript: false`  must be specified in WebPreferences.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Please note that setting this option to `false`  is **insecure** .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This option will be removed in Electron 14 so please migrate your code to support the default
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								value.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:55:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: `contextIsolation` defaults to `true`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 12, `contextIsolation`  will be enabled by default.  To restore
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the previous behavior, `contextIsolation: false`  must be specified in WebPreferences.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-04-18 07:09:54 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								We [recommend having contextIsolation enabled ](tutorial/security.md#3-enable-context-isolation ) for the security of your application.
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:55:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-11 23:42:15 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Another implication is that `require()`  cannot be used in the renderer process unless
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`nodeIntegration`  is `true`  and `contextIsolation`  is `false` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:55:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								For more details see: https://github.com/electron/electron/issues/23506
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-26 20:07:40 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `crashReporter.getCrashesDirectory()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `crashReporter.getCrashesDirectory`  method has been removed. Usage
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								should be replaced by `app.getPath('crashDumps')` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 12
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.getCrashesDirectory()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getPath('crashDumps')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `crashReporter` methods in the renderer process
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `crashReporter`  methods are no longer available in the renderer
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								process:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `crashReporter.start` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getLastCrashReport` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getUploadedReports` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getUploadToServer` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.setUploadToServer` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getCrashesDirectory` 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								They should be called only from the main process.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [#23265 ](https://github.com/electron/electron/pull/23265 ) for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 13:47:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: `crashReporter.start({ compress: true })`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The default value of the `compress`  option to `crashReporter.start`  has changed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								from `false`  to `true` . This means that crash dumps will be uploaded to the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crash ingestion server with the `Content-Encoding: gzip`  header, and the body
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								will be compressed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If your crash ingestion server does not support compressed payloads, you can
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								turn off compression by specifying `{ compress: false }`  in the crash reporter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								options.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-10 09:17:17 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `remote` module
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `remote`  module is deprecated in Electron 12, and will be removed in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 14. It is replaced by the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[`@electron/remote` ](https://github.com/electron/remote ) module.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 12:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { BrowserWindow } = require('electron').remote
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { BrowserWindow } = require('@electron/remote ')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// In the main process:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('@electron/remote/main ').initialize()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 12:44:16 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `shell.moveItemToTrash()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The synchronous `shell.moveItemToTrash()`  has been replaced by the new,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								asynchronous `shell.trashItem()` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 12
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								shell.moveItemToTrash(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								shell.trashItem(path).then(/* ... */)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (11.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-17 08:35:23 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` and `id` property of `BrowserView`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-17 08:35:23 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The experimental APIs `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								have now been removed. Additionally, the `id`  property of `BrowserView` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								has also been removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For more detailed information, see [#23578 ](https://github.com/electron/electron/pull/23578 ).
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 12:39:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 10:49:09 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (10.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `companyName` argument to `crashReporter.start()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `companyName`  argument to `crashReporter.start()` , which was previously
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								required, is now optional, and further, is deprecated. To get the same
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								behavior in a non-deprecated way, you can pass a `companyName`  value in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`globalExtra` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 10
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.start({ companyName: 'Umbrella Corporation' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.start({ globalExtra: { _companyName: 'Umbrella Corporation' } })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: `crashReporter.getCrashesDirectory()`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `crashReporter.getCrashesDirectory`  method has been deprecated. Usage
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								should be replaced by `app.getPath('crashDumps')` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 10
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.getCrashesDirectory()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getPath('crashDumps')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: `crashReporter` methods in the renderer process
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Calling the following `crashReporter`  methods from the renderer process is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								deprecated:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `crashReporter.start` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getLastCrashReport` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getUploadedReports` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getUploadToServer` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.setUploadToServer` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `crashReporter.getCrashesDirectory` 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 13:31:26 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The only non-deprecated methods remaining in the `crashReporter`  module in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								renderer are `addExtraParameter` , `removeExtraParameter`  and `getParameters` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								All above methods remain non-deprecated when called from the main process.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See [#23265 ](https://github.com/electron/electron/pull/23265 ) for more details.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-19 13:47:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `crashReporter.start({ compress: false })`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Setting `{ compress: false }`  in `crashReporter.start`  is deprecated. Nearly
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								all crash ingestion servers support gzip compression. This option will be
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								removed in a future version of Electron.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: `enableRemoteModule` defaults to `false`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 10:49:09 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 9, using the remote module without explicitly enabling it via the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`enableRemoteModule`  WebPreferences option began emitting a warning. In
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 10, the remote module is now disabled by default. To use the remote
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								module, `enableRemoteModule: true`  must be specified in WebPreferences:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  webPreferences: {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    enableRemoteModule: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-28 11:15:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								We [recommend moving away from the remote module ](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31 ).
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 10:49:09 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.unregisterProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.uninterceptProtocol`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The APIs are now synchronous and the optional callback is no longer needed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-20 23:50:08 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.unregisterProtocol(scheme, () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.unregisterProtocol(scheme)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### `protocol.registerFileProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.registerBufferProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.registerStringProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.registerHttpProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.registerStreamProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.interceptFileProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.interceptStringProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.interceptBufferProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.interceptHttpProtocol`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-18 20:58:47 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `protocol.interceptStreamProtocol`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The APIs are now synchronous and the optional callback is no longer needed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-20 23:50:08 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.registerFileProtocol(scheme, handler)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The registered or intercepted protocol does not have effect on current page
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								until navigation happens.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### `protocol.isProtocolHandled`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This API is deprecated and users should use `protocol.isProtocolRegistered` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								and `protocol.isProtocolIntercepted`  instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-11-20 23:50:08 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 19:17:07 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const isRegistered = protocol.isProtocolRegistered(scheme)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const isIntercepted = protocol.isProtocolIntercepted(scheme)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-08 21:46:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (9.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-24 18:11:06 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								As of Electron 9 we do not allow loading of non-context-aware native modules in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the renderer process.  This is to improve security, performance and maintainability
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								of Electron as a project.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If this impacts you, you can temporarily set `app.allowRendererProcessReuse`  to `false` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to revert to the old behavior.  This flag will only be an option until Electron 11 so
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								you should plan to update your native modules to be context aware.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For more detailed information see [#18397 ](https://github.com/electron/electron/issues/18397 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-02 01:27:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `BrowserWindow` extension APIs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following extension APIs have been deprecated:
							 
						 
					
						
							
								
									
										
										
										
											2020-12-07 23:08:19 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-02 01:27:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.addExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.addDevToolsExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.removeExtension(name)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.removeDevToolsExtension(name)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.getExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `BrowserWindow.getDevToolsExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the session APIs instead:
							 
						 
					
						
							
								
									
										
										
										
											2020-12-07 23:08:19 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-02 01:27:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `ses.loadExtension(path)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `ses.removeExtension(extension_id)` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `ses.getAllExtensions()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 9
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.addExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.addDevToolsExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.loadExtension(path)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 9
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.removeExtension(name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.removeDevToolsExtension(name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.removeExtension(extension_id)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated in Electron 9
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.getExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								BrowserWindow.getDevToolsExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.defaultSession.getAllExtensions()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `<webview>.getWebContents()`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-08 21:46:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This API, which was deprecated in Electron 8.0, is now removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 9.0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.getWebContents()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { remote } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								remote.webContents.fromId(webview.getWebContentsId())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `webFrame.setLayoutZoomLevelLimits()`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-06 13:14:25 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium has removed support for changing the layout zoom level limits, and it
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								is beyond Electron's capacity to maintain it. The function was deprecated in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 8.x, and has been removed in Electron 9.x. The layout zoom level limits
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[here ](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: Sending non-JS objects over IPC now throws an exception
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 22:24:50 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 8.0, IPC was changed to use the Structured Clone Algorithm,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								bringing significant performance improvements. To help ease the transition, the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								old IPC serialization algorithm was kept and used for some objects that aren't
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								serializable with Structured Clone. In particular, DOM objects (e.g. `Element` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`Location`  and `DOMMatrix` ), Node.js objects backed by C++ classes (e.g.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`process.env` , some members of `Stream` ), and Electron objects backed by C++
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								classes (e.g. `WebContents` , `BrowserWindow`  and `WebFrame` ) are not
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								serializable with Structured Clone. Whenever the old algorithm was invoked, a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								deprecation warning was printed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 9.0, the old serialization algorithm has been removed, and sending
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								such non-serializable objects will now throw an "object could not be cloned"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								error.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `shell.openItem` is now `shell.openPath`
 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 23:17:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `shell.openItem`  API has been replaced with an asynchronous `shell.openPath`  API.
							 
						 
					
						
							
								
									
										
										
										
											2021-09-27 11:35:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								You can see the original API proposal and reasoning [here ](https://github.com/electron/governance/blob/main/wg-api/spec-documents/shell-openitem.md ).
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 23:17:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (8.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-05-28 11:15:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The algorithm used to serialize objects sent over IPC (through `ipcRenderer.send` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`ipcRenderer.sendSync` , `WebContents.send`  and related methods) has been switched from a custom
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								algorithm to V8's built-in [Structured Clone Algorithm][SCA], the same algorithm used to serialize
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								messages for `postMessage` . This brings about a 2x performance improvement for large messages,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								but also brings some breaking changes in behavior.
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  Sending Functions, Promises, WeakMaps, WeakSets, or objects containing any
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  such values, over IPC will now throw an exception, instead of silently
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  converting the functions to `undefined` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Previously:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcRenderer.send('channel', { value: 3, someFunction: () => {} })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// => results in { value: 3 } arriving in the main process
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// From Electron 8:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcRenderer.send('channel', { value: 3, someFunction: () => {} })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// => throws Error("() => {} could not be cloned.")
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `NaN` , `Infinity`  and `-Infinity`  will now be correctly serialized, instead
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  of being converted to `null` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  Objects containing cyclic references will now be correctly serialized,
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  instead of being converted to `null` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `Set` , `Map` , `Error`  and `RegExp`  values will be correctly serialized,
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  instead of being converted to `{}` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `BigInt`  values will be correctly serialized, instead of being converted to
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  `null` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  Sparse arrays will be serialized as such, instead of being converted to dense
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  arrays with `null` s.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `Date`  objects will be transferred as `Date`  objects, instead of being
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  converted to their ISO string representation.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  Typed Arrays (such as `Uint8Array` , `Uint16Array` , `Uint32Array`  and so on)
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  will be transferred as such, instead of being converted to Node.js `Buffer` .
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 09:15:27 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  Node.js `Buffer`  objects will be transferred as `Uint8Array` s. You can
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  convert a `Uint8Array`  back to a Node.js `Buffer`  by wrapping the underlying
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  `ArrayBuffer` :
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-09 10:59:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Buffer.from(value.buffer, value.byteOffset, value.byteLength)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Sending any objects that aren't native JS types, such as DOM objects (e.g.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`Element` , `Location` , `DOMMatrix` ), Node.js objects (e.g. `process.env` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`Stream` ), or Electron objects (e.g. `WebContents` , `BrowserWindow` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`WebFrame` ) is deprecated. In Electron 8, these objects will be serialized as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								before with a DeprecationWarning message, but starting in Electron 9, sending
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								these kinds of objects will throw a 'could not be cloned' error.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `<webview>.getWebContents()`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-07 18:43:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This API is implemented using the `remote`  module, which has both performance
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								and security implications. Therefore its usage should be explicit.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.getWebContents()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { remote } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								remote.webContents.fromId(webview.getWebContentsId())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								However, it is recommended to avoid using the `remote`  module altogether.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// main
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { ipcMain, webContents } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-13 02:29:46 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const getGuestForWebContents = (webContentsId, contents) => {
							 
						 
					
						
							
								
									
										
										
										
											2019-11-07 18:43:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  const guest = webContents.fromId(webContentsId)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (!guest) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    throw new Error(`Invalid webContentsId: ${webContentsId}` )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (guest.hostWebContents !== contents) {
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 10:18:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    throw new Error('Access denied to webContents')
							 
						 
					
						
							
								
									
										
										
										
											2019-11-07 18:43:19 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  return guest
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcMain.handle('openDevTools', (event, webContentsId) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  const guest = getGuestForWebContents(webContentsId, event.sender)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  guest.openDevTools()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// renderer
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const { ipcRenderer } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `webFrame.setLayoutZoomLevelLimits()`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-02 13:27:03 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Chromium has removed support for changing the layout zoom level limits, and it
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								is beyond Electron's capacity to maintain it. The function will emit a warning
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								in Electron 8.x, and cease to exist in Electron 9.x. The layout zoom level
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[here ](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11 ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-11 01:42:23 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated events in `systemPreferences`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `systemPreferences`  events have been deprecated:
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 00:31:26 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-11 01:42:23 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `inverted-color-scheme-changed` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `high-contrast-color-scheme-changed` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the new `updated`  event on the `nativeTheme`  module instead.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.on('updated', () => { /* ... */ })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Deprecated: methods in `systemPreferences`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `systemPreferences`  methods have been deprecated:
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 00:31:26 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-11 01:42:23 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isDarkMode()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isInvertedColorScheme()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `systemPreferences.isHighContrastColorScheme()` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Use the following `nativeTheme`  properties instead:
							 
						 
					
						
							
								
									
										
										
										
											2021-01-14 00:31:26 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-11 01:42:23 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseDarkColors` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseInvertedColorScheme` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `nativeTheme.shouldUseHighContrastColors` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isDarkMode()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseDarkColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isInvertedColorScheme()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseInvertedColorScheme
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								systemPreferences.isHighContrastColorScheme()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeTheme.shouldUseHighContrastColors
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 07:58:02 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (7.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: Atom.io Node Headers URL
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-21 00:17:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This is the URL specified as `disturl`  in a `.npmrc`  file or as the `--dist-url` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								command line flag when building native Node modules.  Both will be supported for
							 
						 
					
						
							
								
									
										
										
										
											2019-06-21 16:19:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								the foreseeable future but it is recommended that you switch.
							 
						 
					
						
							
								
									
										
										
										
											2019-05-21 00:17:08 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Deprecated: https://atom.io/download/electron
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Replace with: https://electronjs.org/headers
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `session.clearAuthCache()` no longer accepts options
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 07:58:02 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `session.clearAuthCache`  API no longer accepts options for what to clear, and instead unconditionally clears the whole cache.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.clearAuthCache({ type: 'password' })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								session.clearAuthCache()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `powerMonitor.querySystemIdleState` is now `powerMonitor.getSystemIdleState`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 7.0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								powerMonitor.querySystemIdleState(threshold, callback)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with synchronous API
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const idleState = powerMonitor.getSystemIdleState(threshold)
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-16 01:31:54 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `powerMonitor.querySystemIdleTime` is now `powerMonitor.getSystemIdleTime`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed in Electron 7.0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								powerMonitor.querySystemIdleTime(callback)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with synchronous API
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const idleTime = powerMonitor.getSystemIdleTime()
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `webFrame.setIsolatedWorldInfo` replaces separate methods
 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 14:11:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed in Electron 7.0
							 
						 
					
						
							
								
									
										
										
										
											2019-05-09 20:48:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldHumanReadableName(worldId, name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldInfo(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  worldId,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    securityOrigin: 'some_origin',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    name: 'human_readable_name',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    csp: 'content_security_policy'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: `marked` property on `getBlinkMemoryInfo`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-02 18:22:09 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This property was removed in Chromium 77, and as such is no longer available.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `webkitdirectory` attribute for `<input type="file"/>` now lists directory contents
 
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 14:11:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The `webkitdirectory`  property on HTML file inputs allows them to select folders.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Previous versions of Electron had an incorrect implementation where the `event.target.files` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								of the input returned a `FileList`  that returned one `File`  corresponding to the selected folder.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								As of Electron 7, that `FileList`  is now list of all files contained within
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the folder, similarly to Chrome, Firefox, and Edge
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								([link to MDN docs ](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory )).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								As an illustration, take a folder with this structure:
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 14:11:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```console
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								folder
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								├── file1
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								├── file2
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								└── file3
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-03-25 03:19:44 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								In Electron < =6, this would return a `FileList`  with a `File`  object for:
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 14:11:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```console
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								path/to/folder
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 7, this now returns a `FileList`  with a `File`  object for:
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 14:11:25 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```console
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/path/to/folder/file3
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/path/to/folder/file2
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/path/to/folder/file1
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Note that `webkitdirectory`  no longer exposes the path to the selected folder.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								If you require the path to the selected folder rather than the folder contents,
							 
						 
					
						
							
								
									
										
										
										
											2024-08-16 16:49:10 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								see the `dialog.showOpenDialog`  API ([link ](api/dialog.md#dialogshowopendialogwindow-options )).
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 22:57:33 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: Callback-based versions of promisified APIs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 5 and Electron 6 introduced Promise-based versions of existing
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								asynchronous APIs and deprecated their older, callback-based counterparts.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								In Electron 7, all deprecated callback-based APIs are now removed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								These functions now only return Promises:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `app.getFileIcon()`  [#15742 ](https://github.com/electron/electron/pull/15742 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `app.dock.show()`  [#16904 ](https://github.com/electron/electron/pull/16904 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `contentTracing.getCategories()`  [#16583 ](https://github.com/electron/electron/pull/16583 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `contentTracing.getTraceBufferUsage()`  [#16600 ](https://github.com/electron/electron/pull/16600 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `contentTracing.startRecording()`  [#16584 ](https://github.com/electron/electron/pull/16584 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `contentTracing.stopRecording()`  [#16584 ](https://github.com/electron/electron/pull/16584 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `contents.executeJavaScript()`  [#17312 ](https://github.com/electron/electron/pull/17312 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `cookies.flushStore()`  [#16464 ](https://github.com/electron/electron/pull/16464 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `cookies.get()`  [#16464 ](https://github.com/electron/electron/pull/16464 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `cookies.remove()`  [#16464 ](https://github.com/electron/electron/pull/16464 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `cookies.set()`  [#16464 ](https://github.com/electron/electron/pull/16464 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `debugger.sendCommand()`  [#16861 ](https://github.com/electron/electron/pull/16861 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `dialog.showCertificateTrustDialog()`  [#17181 ](https://github.com/electron/electron/pull/17181 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `inAppPurchase.getProducts()`  [#17355 ](https://github.com/electron/electron/pull/17355 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `inAppPurchase.purchaseProduct()` [#17355 ](https://github.com/electron/electron/pull/17355 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `netLog.stopLogging()`  [#16862 ](https://github.com/electron/electron/pull/16862 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.clearAuthCache()`  [#17259 ](https://github.com/electron/electron/pull/17259 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.clearCache()`   [#17185 ](https://github.com/electron/electron/pull/17185 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.clearHostResolverCache()`  [#17229 ](https://github.com/electron/electron/pull/17229 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.clearStorageData()`  [#17249 ](https://github.com/electron/electron/pull/17249 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.getBlobData()`  [#17303 ](https://github.com/electron/electron/pull/17303 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.getCacheSize()`   [#17185 ](https://github.com/electron/electron/pull/17185 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.resolveProxy()`  [#17222 ](https://github.com/electron/electron/pull/17222 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `session.setProxy()`   [#17222 ](https://github.com/electron/electron/pull/17222 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `shell.openExternal()`  [#16176 ](https://github.com/electron/electron/pull/16176 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webContents.loadFile()`  [#15855 ](https://github.com/electron/electron/pull/15855 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webContents.loadURL()`  [#15855 ](https://github.com/electron/electron/pull/15855 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webContents.hasServiceWorker()`  [#16535 ](https://github.com/electron/electron/pull/16535 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webContents.printToPDF()`  [#16795 ](https://github.com/electron/electron/pull/16795 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webContents.savePage()`  [#16742 ](https://github.com/electron/electron/pull/16742 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webFrame.executeJavaScript()`  [#17312 ](https://github.com/electron/electron/pull/17312 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webFrame.executeJavaScriptInIsolatedWorld()`  [#17312 ](https://github.com/electron/electron/pull/17312 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `webviewTag.executeJavaScript()`  [#17312 ](https://github.com/electron/electron/pull/17312 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `win.capturePage()`  [#15743 ](https://github.com/electron/electron/pull/15743 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								These functions now have two forms, synchronous and Promise-based asynchronous:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `dialog.showMessageBox()` /`dialog.showMessageBoxSync()`  [#17298 ](https://github.com/electron/electron/pull/17298 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `dialog.showOpenDialog()` /`dialog.showOpenDialogSync()`  [#16973 ](https://github.com/electron/electron/pull/16973 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `dialog.showSaveDialog()` /`dialog.showSaveDialogSync()`  [#17054 ](https://github.com/electron/electron/pull/17054 )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (6.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 23:01:00 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `win.setMenu(null)` is now `win.removeMenu()`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-31 10:58:23 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.setMenu(null)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								win.removeMenu()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `electron.screen` in the renderer process should be accessed via `remote`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 23:01:00 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').screen
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').remote.screen
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `require()`ing node builtins in sandboxed renderers no longer implicitly loads the `remote` version
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 23:01:00 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('child_process')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').remote.require('child_process')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('fs')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').remote.require('fs')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('os')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').remote.require('os')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('path')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								require('electron').remote.require('path')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `powerMonitor.querySystemIdleState` replaced with `powerMonitor.getSystemIdleState`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-27 12:54:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								powerMonitor.querySystemIdleState(threshold, callback)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with synchronous API
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const idleState = powerMonitor.getSystemIdleState(threshold)
							 
						 
					
						
							
								
									
										
										
										
											2019-02-27 12:54:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `powerMonitor.querySystemIdleTime` replaced with `powerMonitor.getSystemIdleTime`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-27 12:54:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								powerMonitor.querySystemIdleTime(callback)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with synchronous API
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const idleTime = powerMonitor.getSystemIdleTime()
							 
						 
					
						
							
								
									
										
										
										
											2019-02-27 12:54:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `app.enableMixedSandbox()` is no longer needed
 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-24 06:07:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.enableMixedSandbox()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Mixed-sandbox mode is now enabled by default.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `Tray.setHighlightMode`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-11 08:11:46 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Under macOS Catalina our former Tray implementation breaks.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Apple's native substitute doesn't support changing the highlighting behavior.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								tray.setHighlightMode(mode)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// API will be removed in v7.0 without replacement.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (5.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-10 16:36:18 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Default Changed: `nodeIntegration` and `webviewTag` default to false, `contextIsolation` defaults to true
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-10 16:36:18 +11:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The following `webPreferences`  option default values are deprecated in favor of the new defaults listed below.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| Property | Deprecated Default | New Default |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								|----------|--------------------|-------------|
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| `contextIsolation`  | `false`  | `true`  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| `nodeIntegration`  | `true`  | `false`  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| `webviewTag`  | `nodeIntegration`  if set else `true`  | `false`  |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-26 13:30:45 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								E.g. Re-enabling the webviewTag
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const w = new BrowserWindow({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  webPreferences: {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    webviewTag: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Behavior Changed: `nodeIntegration` in child windows opened via `nativeWindowOpen`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-25 15:31:07 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Child windows opened with the `nativeWindowOpen`  option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames`  is `true` .
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:15:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: Registering privileged schemes must now be done before app ready
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-28 23:11:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Renderer process APIs `webFrame.registerURLSchemeAsPrivileged`  and `webFrame.registerURLSchemeAsBypassingCSP`  as well as browser process API `protocol.registerStandardSchemes`  have been removed.
							 
						 
					
						
							
								
									
										
										
										
											2019-01-28 23:11:01 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								A new API, `protocol.registerSchemesAsPrivileged`  has been added and should be used for registering custom schemes with the required privileges. Custom schemes are required to be registered before app ready.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Deprecated: `webFrame.setIsolatedWorld*` replaced with `webFrame.setIsolatedWorldInfo`
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-13 10:05:28 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldHumanReadableName(worldId, name)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setIsolatedWorldInfo(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  worldId,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    securityOrigin: 'some_origin',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    name: 'human_readable_name',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    csp: 'content_security_policy'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-26 10:57:55 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `webFrame.setSpellCheckProvider` now takes an asynchronous callback
 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-03 20:56:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The `spellCheck`  callback is now asynchronous, and `autoCorrectWord`  parameter has been removed.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-05 14:12:43 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-03 20:56:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setSpellCheckProvider('en-US', true, {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  spellCheck: (text) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    return !spellchecker.isMisspelled(text)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.setSpellCheckProvider('en-US', {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  spellCheck: (words, callback) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    callback(words.filter(text => spellchecker.isMisspelled(text)))
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 22:57:33 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### API Changed: `webContents.getZoomLevel` and `webContents.getZoomFactor` are now synchronous
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`webContents.getZoomLevel`  and `webContents.getZoomFactor`  no longer take callback parameters,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								instead directly returning their number values.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.getZoomLevel((level) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(level)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const level = webContents.getZoomLevel()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(level)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.getZoomFactor((factor) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  console.log(factor)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const factor = webContents.getZoomFactor()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								console.log(factor)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Planned Breaking API Changes (4.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-31 10:58:23 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The following list includes the breaking API changes made in Electron 4.0.
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `app.makeSingleInstance`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2018-12-05 09:14:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								app.makeSingleInstance((argv, cwd) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  /* ... */
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.requestSingleInstanceLock()
							 
						 
					
						
							
								
									
										
										
										
											2018-12-05 09:14:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								app.on('second-instance', (event, argv, cwd) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  /* ... */
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `app.releaseSingleInstance`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:17:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.releaseSingleInstance()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.releaseSingleInstanceLock()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `app.getGPUInfo`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 13:06:50 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getGPUInfo('complete')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Now behaves the same with `basic`  on macOS
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getGPUInfo('basic')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `win_delay_load_hook`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-19 16:13:50 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								When building native modules for windows, the `win_delay_load_hook`  variable in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								the module's `binding.gyp`  must be true (which is the default). If this hook is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								not present, then the native module will fail to load on Windows, with an error
							 
						 
					
						
							
								
									
										
										
										
											2024-05-28 11:15:18 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message like `Cannot find module` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								See the [native module guide ](./tutorial/using-native-node-modules.md ) for more.
							 
						 
					
						
							
								
									
										
										
										
											2018-11-19 16:13:50 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-30 21:53:03 +05:30 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Removed: IA32 Linux support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Electron 18 will no longer run on 32-bit Linux systems. See [discontinuing support for 32-bit Linux ](https://www.electronjs.org/blog/linux-32bit-support ) for more information.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Breaking API Changes (3.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-06-26 23:47:01 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The following list includes the breaking API changes in Electron 3.0.
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `app`
 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-17 20:01:06 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getAppMemoryInfo()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								app.getAppMetrics()
							 
						 
					
						
							
								
									
										
										
										
											2018-06-26 23:47:01 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const metrics = app.getAppMetrics()
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const { memory } = metrics[0] // Deprecated property
							 
						 
					
						
							
								
									
										
										
										
											2017-05-17 20:01:06 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `BrowserWindow`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 10:18:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const optionsA = { webPreferences: { blinkFeatures: '' } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const windowA = new BrowserWindow(optionsA)
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 10:18:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const optionsB = { webPreferences: { enableBlinkFeatures: '' } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const windowB = new BrowserWindow(optionsB)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-21 10:52:04 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								window.on('app-command', (e, cmd) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (cmd === 'media-play_pause') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // do something
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								window.on('app-command', (e, cmd) => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if (cmd === 'media-play-pause') {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    // do something
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `clipboard`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.readRtf()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.readRTF()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.writeRtf()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.writeRTF()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.readHtml()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.readHTML()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.writeHtml()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								clipboard.writeHTML()
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `crashReporter`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-28 15:06:03 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.start({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  companyName: 'Crashly',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  submitURL: 'https://crash.server.com',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  autoSubmit: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crashReporter.start({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  companyName: 'Crashly',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  submitURL: 'https://crash.server.com',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  uploadToServer: true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `nativeImage`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2016-12-14 10:12:37 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeImage.createFromBuffer(buffer, 1.0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								nativeImage.createFromBuffer(buffer, {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  scaleFactor: 1.0
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `process`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-06-26 23:47:01 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const info = process.getProcessMemoryInfo()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `screen`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-16 15:57:07 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2018-03-07 02:06:33 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								screen.getMenuBarHeight()
							 
						 
					
						
							
								
									
										
										
										
											2016-09-16 15:57:07 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2018-03-07 02:06:33 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								screen.getPrimaryDisplay().workArea
							 
						 
					
						
							
								
									
										
										
										
											2016-09-16 15:57:07 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `session`
 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-07 15:44:56 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2018-12-05 09:14:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ses.setCertificateVerifyProc((hostname, certificate, callback) => {
							 
						 
					
						
							
								
									
										
										
										
											2017-02-07 15:44:56 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  callback(true)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2018-12-05 09:14:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ses.setCertificateVerifyProc((request, callback) => {
							 
						 
					
						
							
								
									
										
										
										
											2017-02-07 15:44:56 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  callback(0)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `Tray`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								tray.setHighlightMode(true)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								tray.setHighlightMode('on')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								tray.setHighlightMode(false)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								tray.setHighlightMode('off')
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `webContents`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-09-08 09:09:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webContents.openDevTools({ detach: true })
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webContents.openDevTools({ mode: 'detach' })
							 
						 
					
						
							
								
									
										
										
										
											2018-08-23 10:45:43 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webContents.setSize(options)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// There is no replacement for this API
							 
						 
					
						
							
								
									
										
										
										
											2016-09-07 11:41:54 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2016-11-04 14:30:14 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `webFrame`
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-22 08:11:14 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2016-11-14 12:33:30 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webFrame.registerURLSchemeAsSecure('app')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								protocol.registerStandardSchemes(['app'], { secure: true })
							 
						 
					
						
							
								
									
										
										
										
											2016-11-14 12:33:30 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webFrame.registerURLSchemeAsPrivileged('app', { secure: true })
							 
						 
					
						
							
								
									
										
										
										
											2016-11-14 12:33:30 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								protocol.registerStandardSchemes(['app'], { secure: true })
							 
						 
					
						
							
								
									
										
										
										
											2016-11-22 08:11:14 -08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `<webview>`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-23 10:45:43 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.setAttribute('disableguestresize', '')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// There is no replacement for this API
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.setAttribute('guestinstance', instanceId)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// There is no replacement for this API
							 
						 
					
						
							
								
									
										
										
										
											2018-08-29 15:59:23 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Keyboard listeners no longer work on webview tag
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.onkeydown = () => { /* handler */ }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								webview.onkeyup = () => { /* handler */ }
							 
						 
					
						
							
								
									
										
										
										
											2018-08-23 10:45:43 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Node Headers URL
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-04 14:30:14 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								This is the URL specified as `disturl`  in a `.npmrc`  file or as the `--dist-url` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								command line flag when building native Node modules.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Deprecated: https://atom.io/download/atom-shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Replace with: https://atom.io/download/electron
							 
						 
					
						
							
								
									
										
										
										
											2017-06-15 12:46:25 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Breaking API Changes (2.0)
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:42:20 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The following list includes the breaking API changes made in Electron 2.0.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `BrowserWindow`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// Deprecated
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 10:18:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const optionsA = { titleBarStyle: 'hidden-inset' }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const windowA = new BrowserWindow(optionsA)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replace with
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 10:18:49 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const optionsB = { titleBarStyle: 'hiddenInset' }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const windowB = new BrowserWindow(optionsB)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `menu`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								menu.popup(browserWindow, 100, 200, 2)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								menu.popup(browserWindow, { x: 100, y: 200, positioningItem: 2 })
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `nativeImage`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								nativeImage.toPng()
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								nativeImage.toPNG()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								nativeImage.toJpeg()
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								nativeImage.toJPEG()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `process`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  `process.versions.electron`  and `process.version.chrome`  will be made
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  read-only properties for consistency with the other `process.versions` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  properties set by Node.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `webContents`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webContents.setZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webContents.setVisualZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `webFrame`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webFrame.setZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webFrame.setVisualZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### `<webview>`
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```js
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Removed
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webview.setZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								// Replaced with
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								webview.setVisualZoomLevelLimits(1, 2)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-25 15:14:19 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Duplicate ARM Assets
 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Each Electron release includes two identical ARM builds with slightly different
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								filenames, like `electron-v1.7.3-linux-arm.zip`  and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`electron-v1.7.3-linux-armv7l.zip` . The asset with the `v7l`  prefix was added
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								to clarify to users which ARM version it supports, and to disambiguate it from
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								future armv6l and arm64 assets that may be produced.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The file _without the prefix_  is still being published to avoid breaking any
							 
						 
					
						
							
								
									
										
										
										
											2019-06-21 16:19:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								setups that may be consuming it. Starting at 2.0, the unprefixed file will
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								no longer be published.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								For details, see
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[6986 ](https://github.com/electron/electron/pull/6986 )
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:37:42 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								and
							 
						 
					
						
							
								
									
										
										
										
											2018-05-29 11:23:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								[7189 ](https://github.com/electron/electron/pull/7189 ).