破壊的変更
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least one major version before the change is made.
破壊的変更の種別
このドキュメントでは、以下の規約によって破壊的な変更を分類しています。
- API 変更: 古いコードで例外の発生が保証されるように API が変更されました。
- 動作変更: Electron の動作が変更されましたが、例外が必ず発生する訳ではありません。
- 省略値変更: 古い省略値に依存するコードは動かなくなるかもしれませんが、必ずしも例外は発生しません。 値を明示することで以前の動作に戻すことができます。
- 非推奨: API は非推奨になりました。 この API は引き続き機能しますが、非推奨の警告を発し、将来のリリースで削除されます。
- 削除: API または機能が削除され、Electron でサポートされなくなりました。
予定されている破壊的な API の変更 (44.0)
削除: macOS 12 のサポート
macOS 12 (Monterey) is no longer supported by Chromium.
Older versions of Electron will continue to run on Monterey, but macOS 13 (Ventura) or later will be required to run Electron v44.0.0 and higher.
Removed: Windows 32-bit (ia32) and Linux 32-bit ARM (armv7l) support
Electron no longer publishes prebuilt binaries for 32-bit platforms: Windows x86 (win32-ia32) and Linux ARM (linux-armv7l). All related release artifacts (chromedriver, mksnapshot, ffmpeg, and the Windows x86 node.lib on the Electron headers CDN) are no longer published either.
Older versions of Electron will continue to support these platforms, but Electron v44.0.0 and higher will only be published for 64-bit platforms.
Once the v43 series reaches end of life in January 2027, these 32-bit platforms will no longer be supported.
Removed: clipboard module is no longer available in the renderer process
The clipboard module is no longer exposed to renderer processes. It was previously deprecated and is now removed in line with RFC 0019 to close the security risk of granting non-sandboxed renderers direct clipboard access.
Renderers should use the navigator.clipboard API to safely work with the system clipboard. If more advanced usage is necessary, expose the necessary helpers from a preload script using the contextBridge API. When using contextBridge care must be taken to ensure that the clipboard API is not exposed to untrusted content.
予定されている破壊的な API の変更 (43.0)
Behavior Changed: Rounded corners on Linux
Frameless windows default to rounded corners on Linux if the desktop environment supports client-side decorations. This can be configured using the existing roundedCorners option on BrowserWindow, which is now supported on Linux and defaults to true on all platforms.
Behavior Changed: WCO respects the native title bar layout on Linux
Frameless windows with Window Controls Overlay (WCO) now adopt the native title bar layout and user settings on Linux. For example, controls will appear on the left side of the frame on RTL systems, and only the close button will be visible by default on GNOME. Depending on the user's desktop environment and configuration, buttons can appear on the left or right side of the frame (or both). To account for all possibilities, use the CSS variables env(titlebar-area-x, 0px) and env(titlebar-area-width, 100%) to constrain your app's title bar content to a safe area.
Behavior Changed: NativeImage.toBitmap() now normalizes color space
NativeImage.toBitmap() (and its deprecated alias NativeImage.getBitmap()) now normalizes pixel data to sRGB by default. Previously, raw pixel data was returned without color space conversion, which meant pixel values from images with different embedded color profiles (e.g., Display P3 on macOS) could differ for the same visual color.
To preserve the previous behavior, pass the image's original color space in the colorSpace option. You can also pass colorSpace to convert to any other specific color space:
const image = nativeImage.createFromPath('photo.png')
// New default: normalized to sRGB
const srgbBitmap = image.toBitmap()
// Convert to Display P3
const p3Bitmap = image.toBitmap({
colorSpace: {
primaries: 'p3',
transfer: 'srgb',
matrix: 'rgb',
range: 'full'
}
})
Behavior Changed: chrome.scripting CSS injection matches more fallback frames
Extensions using chrome.scripting.insertCSS() or chrome.scripting.removeCSS() now follow Chrome's behavior when Electron cannot match a frame's URL directly, such as with about:blank or data: frames. If the extension has access to the page that created the frame, CSS may now be inserted into or removed from those fallback frames as well.
Apps or extensions that relied on Electron skipping those frames should narrow their injection target, frame IDs, or match patterns.
Behavior Changed: Dialog methods default to Downloads directory
The defaultPath option for the following methods now defaults to the user's Downloads folder (or their home directory if Downloads doesn't exist) when not explicitly provided:
dialog.showOpenDialogdialog.showOpenDialogSyncdialog.showSaveDialogdialog.showSaveDialogSync
Previously, when no defaultPath was provided, the underlying OS file dialog would determine the initial directory — typically remembering the last directory the user navigated to, or falling back to an OS-specific default. Now, Electron explicitly sets the initial directory to Downloads, which also means the OS will no longer track and restore the last-used directory between dialog invocations.
To preserve the old behavior, you can track the last-used directory yourself and pass it as defaultPath:
const path = require('node:path')
let lastUsedPath
const result = await dialog.showOpenDialog({
defaultPath: lastUsedPath
})
if (!result.canceled && result.filePaths.length > 0) {
lastUsedPath = path.dirname(result.filePaths[0])
}
Removed: showHiddenFiles in Dialogs on Linux
The showHiddenFiles property is no longer supported on Linux. It continues to work on macOS and Windows. GTK intends for this feature to be a user choice rather than an app choice, and has removed the API to do this programmatically.
予定されている破壊的な API の変更 (42.0)
Behavior Changed: macOS notifications now use UNNotification API
Electron has migrated from the deprecated NSUserNotification API to the UNNotification API on macOS. The new API requires that an application be code-signed in order for notifications to be displayed. If an application is not code-signed, notifications will emit a failed event on the Notification object.
Behavior Changed: Offscreen rendering will use 1.0 as default device scale factor.
Previously, OSR used the primary display's device scale factor for rendering, which made the output frame size vary across users. Developers had to manually calculate the correct size using screen.getPrimaryDisplay().scaleFactor. We now provide an optional property webPreferences.offscreen.deviceScaleFactor to specify a custom value when creating an OSR window. At first, if the property is not set, it defaults to the primary display's scale factor (preserving the old behavior). Starting from Electron 42, the default will change to a constant value of 1.0 for more consistent output sizes.
Behavior Changed: electron no longer downloads itself via postinstall script
Previously, the electron npm package would download the Electron binary from the repository's GitHub Releases in the package's postinstall script.
With recent supply chain security attacks against the npm ecosystem with postinstall scripts as a common attack vector, Electron will now download itself dynamically the first time that its main bin script is run (e.g. via npx electron). With this change, you can now use Electron with the npm --ignore-scripts flag. See RFC #22 for more context.
# won't install binary to `node_modules/electron`
npm install electron --save-dev --ignore-scripts
# will download the binary on demand before starting electron process
npx electron .
# subsequent runs will used the binary downloaded from the first run
npx electron .
If you need to download the Electron binary on-demand, you can now call the install-electron script, which contains the exact same code from the former postinstall script.
npm install electron --save-dev --ignore-scripts
npx install-electron --no
If you need to test changes across platforms or architectures, you should now use the ELECTRON_INSTALL_ARCH and ELECTRON_INSTALL_PLATFORM environment variables.
# before: pass npm config flag on install command
npm install --platform=mas electron --save-dev
# after: add env var when you first run the Electron command
npm install electron --save-dev
ELECTRON_INSTALL_PLATFORM=mas npx electron . --no
This also means the ELECTRON_SKIP_BINARY_DOWNLOAD environment variable is no longer supported, as its primary purpose was to prevent the postinstall script from running.
Removed: quotas object from Session.clearStorageData(options)
When calling Session.clearStorageData(options), the options.quotas object is no longer supported because it has been removed from upstream Chromium.
Deprecated: Passing only an array hslShift to nativeImage.createFromNamedImage()
Passing only an array hslShift to nativeImage.createFromNamedImage() is deprecated. You should now pass an options object with an hslShift property instead:
// Deprecated
nativeImage.createFromNamedImage(imageName, [0, 1, -1])
// Replace with
nativeImage.createFromNamedImage(imageName, {
hslShift: [0, 1, -1]
})
予定されている破壊的な API の変更 (41.0)
Behavior Changed: PDFs no longer create a separate WebContents
Previously, PDF resources created a separate guest WebContents for rendering. Now, PDFs are rendered within the same WebContents instead. If you have code to detect PDF resources, use the frame tree instead of WebContents.
Under the hood, Chromium enabled a feature that changes PDFs to use out-of-process iframes (OOPIFs) instead of the MimeHandlerViewGuest extension.
Behavior Changed: Updated Cookie Change Cause in the Cookie 'changed' Event
We have updated the cookie change cause in the cookie 'changed' event. When a new cookie is set, the change cause is inserted. When a cookie is deleted, the change cause remains explicit. When the cookie being set is identical to an existing one (same name, domain, path, and value, with no actual changes), the change cause is inserted-no-change-overwrite. When the value of the cookie being set remains unchanged but some of its attributes are updated, such as the expiration attribute, the change cause will be inserted-no-value-change-overwrite.
Deprecated: showHiddenFiles in Dialogs on Linux
This property will still be honored on macOS and Windows, but support on Linux will be removed in a future version of Electron. GTK intends for this to be a user choice rather than an app choice and has removed the API to do this programmatically.
予定されている破壊的な API の変更 (40.0)
Deprecated: clipboard API access from renderer processes
Using the clipboard API directly in the renderer process is deprecated. If you want to call this API from a renderer process, place the API call in your preload script and expose it using the contextBridge API.
Behavior Changed: MacOS dSYM files now compressed with tar.xz
Debug symbols for MacOS (dSYM) now use xz compression in order to handle larger file sizes. dsym.zip files are now dsym.tar.xz files. デバッグシンボルを使用するエンドユーザーは、zip ユーティリティを更新する必要があります。
予定されている破壊的な API の変更 (39.0)
Deprecated: --host-rules command line switch
Chromium is deprecating the --host-rules switch.
代わりに --host-resolver-rules を使ってください。
Behavior Changed: window.open popups are always resizable
Per current WHATWG spec, the window.open API will now always create a resizable popup window.
To restore previous behavior:
webContents.setWindowOpenHandler((details) => {
return {
action: 'allow',
overrideBrowserWindowOptions: {
resizable: details.features.includes('resizable=yes')
}
}
})
Behavior Changed: NSAudioCaptureUsageDescription should be included in your app's Info.plist file to use desktopCapturer (🍏 macOS ≥14.2)
Per Chromium update which enables Apple's newer CoreAudio Tap API by default, you now must have NSAudioCaptureUsageDescription defined in your Info.plist to use desktopCapturer.
Electron's desktopCapturer will create a dead audio stream if the new permission is absent however no errors or warnings will occur. This is partially a side-effect of Chromium not falling back to the older Screen & System Audio Recording permissions system if the new system fails.
To restore previous behavior:
// main.js (right beneath your require/import statments)
app.commandLine.appendSwitch(
'disable-features',
'MacCatapLoopbackAudioForScreenShare'
)
Behavior Changed: shared texture OSR paint event data structure
When using shared texture offscreen rendering feature, the paint event now emits a more structured object. It moves the sharedTextureHandle, planes, modifier into a unified handle property. See the OffscreenSharedTexture API structure for more details.
予定されている破壊的な API の変更 (38.0)
Removed: ELECTRON_OZONE_PLATFORM_HINT environment variable
The default value of the --ozone-platform flag changed to auto.
Electron now defaults to running as a native Wayland app when launched in a Wayland session (when XDG_SESSION_TYPE=wayland). Users can force XWayland by passing --ozone-platform=x11.
Removed: ORIGINAL_XDG_CURRENT_DESKTOP environment variable
Previously, Electron changed the value of XDG_CURRENT_DESKTOP internally to Unity, and stored the original name of the desktop session in a separate variable. XDG_CURRENT_DESKTOP is no longer overridden and now reflects the actual desktop environment.
Removed: macOS 11 support
macOS 11 (Big Sur) is no longer supported by Chromium.
Older versions of Electron will continue to run on Big Sur, but macOS 12 (Monterey) or later will be required to run Electron v38.0.0 and higher.
Removed: plugin-crashed event
The plugin-crashed event has been removed from webContents.
Deprecated: webFrame.routingId property
The routingId property will be removed from webFrame objects.
You should use webFrame.frameToken instead.
非推奨: webFrame.findFrameByRoutingId(routingId)
The webFrame.findFrameByRoutingId(routingId) function will be removed.
You should use webFrame.findFrameByToken(frameToken) instead.
予定されている破壊的な API の変更 (37.0)
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:
process.on('unhandledRejection', () => {
process.exit(1)
})
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 and PR #45690 to understand the potential implications of that, e.g., when calling console.log() before process.exit().
Behavior Changed: WebUSB and WebSerial Blocklist Support
WebUSB and Web Serial now support the WebUSB Blocklist and Web 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.
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.
Behavior Changed: BrowserWindow.IsVisibleOnAllWorkspaces() on Linux
BrowserWindow.IsVisibleOnAllWorkspaces() will now return false on Linux if the window is not currently visible.
予定されている破壊的な API の変更 (36.0)
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.
非推奨: 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:
// Deprecated
bitmap = image.getBitmap()
// Use this instead
bitmap = image.toBitmap()
Removed: isDefault and status properties on PrinterInfo
These properties have been removed from the PrinterInfo Object because they have been removed from upstream Chromium.
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 from upstream Chromium.
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.
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 one type left -- 'temporary' -- so specifying it is unnecessary.
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.
削除: 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.
Changed: GTK 4 is default when running GNOME
After an upstream change, GTK 4 is now the default when running GNOME.
In rare cases, this may cause some applications or configurations to error with the following message:
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:
$ electron --gtk-version=3 # or --gtk-version=2
The same can be done with the app.commandLine.appendSwitch function.
予定されている破壊的な API の変更 (35.0)
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 command-line switch can be used to force a required version for your application. See #44426 for more details.
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.
// Deprecated
session.serviceWorkers.fromVersionID(versionId)
// Replace with
session.serviceWorkers.getInfoFromVersionID(versionId)
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.
// Deprecated
session.setPreloads([path.join(__dirname, 'preload.js')])
// Replace with:
session.registerPreloadScript({
type: 'frame',
id: 'app-preload',
filePath: path.join(__dirname, 'preload.js')
})
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.
// 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.
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 that matches every possible URL. This change clarifies the intent and ensures more predictable behavior.
// Deprecated
const deprecatedFilter = {
urls: []
}
// Replace with
const newFilter = {
urls: ['<all_urls>']
}
非推奨: 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.
予定されている破壊的な API の変更 (34.0)
動作変更: Windows では、全画面表示中にメニューバーが非表示になります。
これにより、Linux と同等の動作になります。 以前までは、Windows では全画面表示中にメニューバーが表示されていました。 これからは、Windows では全画面表示中にメニューバーが隠れます。
Correction: This was previously listed as a breaking change in Electron 33, but was first released in Electron 34.
予定されている破壊的な API の変更 (33.0)
非推奨: document.execCommand("paste")
The synchronous clipboard read API document.execCommand("paste") has been deprecated in favor of async 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.
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 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.
ipcMain.on('unload-event', (event) => {
event.senderFrame // ✅ accessed immediately
})
ipcMain.on('unload-event', async (event) => {
await crossOriginNavigationPromise
event.senderFrame // ❌ returns `null` due to late access
})
動作変更: WindowsにおけるカスタムプロトコルURLの処理
Due to changes made in Chromium to support Non-Special Scheme URLs, 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.
// 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')
動作変更: app の login の webContents プロパティ
app からの login イベントの webContents プロパティは、respondToAuthRequestsFromMainProcess オプションで作成された ユーティリティプロセス からのリクエストに対してイベントがトリガされた場合、null になります。
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 style mask on macOS, which has been deprecated with no alternative.
削除: macOS 10.15 のサポート
macOS 10.15 (Catalina) is no longer supported by Chromium.
旧バージョンの Electron はこれらのオペレーティングシステムでも引き続き動作しますが、Electron v20.0.0 以降の動作には macOS 11 (High Sierra) 以降が必要です。
動作変更: ネイティブモジュールにC++20が必要になりました
Due to changes made upstream, both V8 and Node.js 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 for more details.
非推奨: systemPreferences.accessibilityDisplayShouldReduceTransparency
systemPreferences.accessibilityDisplayShouldReduceTransparency プロパティは非推奨とし、代わりに同一の情報を提供し、クロスプラットフォームで動作する、新規追加の nativeTheme.prefersReducedTransparency を推奨します。
// 非推奨
const shouldReduceTransparency = systemPreferences.accessibilityDisplayShouldReduceTransparency
// こちらで置き換えてください:
const prefersReducedTransparency = nativeTheme.prefersReducedTransparency
予定されている破壊的な API の変更 (32.0)
削除: File.path
ウェブの File オブジェクトの非標準の path プロパティは、レンダラー内ですべてを実行するのが一般的だった時代に、ネイティブのファイルを操作する便利な方法として Electron の初期バージョンで追加されました。 ただし、これは標準からの逸脱であり軽微なセキュリティリスクも伴うため、Electron 32.0 以降では webUtils.getPathForFile メソッドに置き換えられました。
// Before (renderer)
const file = document.querySelector('input[type=file]').files[0]
alert(`Uploaded file path was: ${file.path}`)
// After (renderer)
const file = document.querySelector('input[type=file]').files[0]
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}`)
}
})
非推奨: WebContents の clearHistory, canGoBack, goBack, canGoForward, goForward, goToIndex, canGoToOffset, goToOffset
以前のナビゲーション関連の API は非推奨になりました。
これらの API は、ナビゲーション履歴を管理するより構造化された直感的インターフェースを提供するために、WebContents の navigationHistory プロパティへ移動されました。
// 非推奨
win.webContents.clearHistory()
win.webContents.canGoBack()
win.webContents.goBack()
win.webContents.canGoForward()
win.webContents.goForward()
win.webContents.goToIndex(index)
win.webContents.canGoToOffset()
win.webContents.goToOffset(index)
// こちらで置き換えてください
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)
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 はこのディレクトリを削除するクリーンアップを実行するようになりました。 See issue #45396.
予定されている破壊的な API の変更 (31.0)
削除: WebSQL サポート
Chromium は WebSQL の上流サポートを削除し、Android のみに移行しました。 詳細については、Chromium の削除意図の議論 をご参照ください。
動作変更: nativeImage.toDataURL が PNG 色空間を保つようになります
PNG デコーダ実装が色空間データを保持するように変更され、この関数から返されるエンコードされたデータは元々と一致するようになりました。
詳細は crbug.com/332584706 をご参照ください。
動作変更: window.flashFrame(bool) が macOS 上で持続的に点滅するようになります
これにより、Windows および Linux と同等の動作になります。 以前の動作: 最初の flashFrame(true) は Dock のアイコンを 1 回バウンスするだけ (NSInformationalRequest レベルを使用する場合) で、flashFrame(false) は何も行いません。 新しい動作: flashFrame(false) が呼び出されるまで、持続的に点滅します。 これは NSCriticalRequest レベルを代わりに使用しています。 NSInformationalRequest を明示的に使用してこれまで通り一度だけの Dock のアイコンをバウンスさせたい場合は、dock.bounce('informational') を使用できます。
予定されている破壊的な API の変更 (30.0)
動作変更: クロスオリジンの iframe が権限ポリシーを用いて機能にアクセスするようになりました
クロスオリジンの iframe にアクセスするには、特定の iframe で利用可能な機能を allow 属性を介して指定しなければなりません。
詳細は ドキュメント をご参照ください。
削除: --disable-color-correct-rendering スイッチ
このスイッチは正式にドキュメント化されたことはありませんが、削除したことをここに注記しておきます。 Chromium 自体が色空間のサポートを強化したため、このフラグは必要なくなります。
動作変更: macOS での BrowserView.setAutoResize の動作
Electron 30 では、BrowserView は新しく WebContentsView API のラッパーになりました。
以前の BrowserView API の setAutoResize 関数は、macOS では autoresizing で、Windows と Linux ではカスタムアルゴリズムによって動作していました。 BrowserView をウインドウ全体に表示するなどの単純な使用例では、これら 2 つのアプローチの動作は同じでした。 ただしより高度なケースでは、Windows および Linux のカスタムサイズ変更アルゴリズムが macOS の自動サイズ変更 API の動作と完全に一致しませんでした。そのめ、BrowserView の自動サイズ変更は macOS 上では他のプラットフォームとは異なる動作でした。 この自動サイズ変更の動作がすべてのプラットフォーム間で標準化されました。
もしあなたのアプリが BrowserView をウィンドウ全体に表示するよりも複雑な操作を BrowserView.setAutoResize で行っていたのならば、macOS でのこの動作の違いに対処するカスタムロジックを既に用意していたことでしょう。 その場合、Electron 30 からは自動サイズ変更の動作が一貫しているため、そのロジックは必要なくなります。