docs: update breaking-changes.md ahead of 45.0.0 release (#54791)

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>
This commit is contained in:
George XuandMichaela Laurencin authored and GitHub committed 2026-10-19 14:32:41 -07:00
1 parent 7a353a3c8c
commit 554d6f5c38
1 file changed
+46 -16
+46 -16
View File
@@ -53,22 +53,6 @@ const { width, height } = image.getSize() // DIPs
console.log(width * scaleFactor, height * scaleFactor) // pixels, as before
```
### Behavior Changed: workers created by subframes need `nodeIntegrationInSubFrames` for Node.js integration
With `nodeIntegrationInWorker: true`, a `Worker` created from an `<iframe>` in
the same process as the main frame used to get Node.js integration even though
the iframe itself had none. Workers now only get Node.js integration when the
frame that creates them has it: the main frame, or any frame when
`nodeIntegrationInSubFrames` is enabled.
### Behavior Changed: preload scripts only run in DevTools extension frames hosted by DevTools
A `chrome-extension://` document used to receive the window's preload script
(and session preload scripts) wherever it was embedded. It now only does so
when it is a top-level frame or is hosted inside the DevTools front-end (a
`devtools_page` or panel); an extension frame embedded in an ordinary page is
treated like any other subframe and follows `nodeIntegrationInSubFrames`.
### Removed: `document.requestStorageAccessFor`
Chromium has removed `document.requestStorageAccessFor` and the
@@ -169,6 +153,52 @@ the max-listener warning) with the same behavior. The static helpers that were o
reachable through `require('events')` (`once`, `listenerCount`, `init`) are not
provided.
### Behavior Changed: workers created by subframes need `nodeIntegrationInSubFrames` for Node.js integration
With `nodeIntegrationInWorker: true`, a `Worker` created from an `<iframe>` in
the same process as the main frame used to get Node.js integration even though
the iframe itself had none. Workers now only get Node.js integration when the
frame that creates them has it: the main frame, or any frame when
`nodeIntegrationInSubFrames` is enabled.
This change was also backported to Electron 44.3.0, 43.7.0 and 42.11.3.
### Behavior Changed: preload scripts only run in DevTools extension frames hosted by DevTools
A `chrome-extension://` document used to receive the window's preload script
(and session preload scripts) wherever it was embedded. It now only does so
when it is a top-level frame or is hosted inside the DevTools front-end (a
`devtools_page` or panel); an extension frame embedded in an ordinary page is
treated like any other subframe and follows `nodeIntegrationInSubFrames`.
This change was also backported to Electron 44.3.0, 43.7.0 and 42.11.3.
### Behavior Changed: `getUserMedia` with `chromeMediaSource: 'desktop'` rejects WebContents source ids
The legacy `chromeMediaSource: 'desktop'` constraint now only accepts screen and
window source ids from [`desktopCapturer.getSources`](api/desktop-capturer.md#desktopcapturergetsourcesoptions).
Passing a WebContents source id there now fails with an "Invalid state" error.
To capture a WebContents, use `chromeMediaSource: 'tab'` with an id from
[`webContents.getMediaSourceId()`](api/web-contents.md#contentsgetmediasourceidrequestwebcontents),
or use [`ses.setDisplayMediaRequestHandler`](api/session.md#sessetdisplaymediarequesthandlerhandler-opts).
```js
// Main process
const sourceId = targetContents.getMediaSourceId(requestingContents)
// Renderer process of requestingContents
const stream = await navigator.mediaDevices.getUserMedia({
video: {
mandatory: {
chromeMediaSource: 'tab',
chromeMediaSourceId: sourceId
}
}
})
```
This change was also backported to Electron 44.3.0, 43.7.0 and 42.11.3.
### Removed: `contentTracing.enableHeapProfiling()`
The experimental `contentTracing.enableHeapProfiling()` API has been removed.