Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: changed event.data to data under the message.port in docs #35782

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/tutorial/message-ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ app.whenReady().then(async () => {
}
})

const secondaryWindow = BrowserWindow({
const secondaryWindow = new BrowserWindow({
show: false,
webPreferences: {
contextIsolation: false,
Expand Down Expand Up @@ -144,7 +144,7 @@ to use `contextIsolation` and set up specific contextBridge calls for each of yo
expected messages, but for the simplicity of this example we don't. You can find an
example of context isolation further down this page at [Communicating directly between the main process and the main world of a context-isolated page](#communicating-directly-between-the-main-process-and-the-main-world-of-a-context-isolated-page)

That means window.messagePort is globally available and you can call
That means window.electronMessagePort is globally available and you can call
`postMessage` on it from anywhere in your app to send a message to the other
renderer.

Expand Down Expand Up @@ -272,7 +272,7 @@ const makeStreamingRequest = (element, callback) => {
}

makeStreamingRequest(42, (data) => {
console.log('got response data:', event.data)
console.log('got response data:', data)
})
// We will see "got response data: 42" 10 times.
```
Expand Down