Skip to content

Conversation

@itsananderson
Copy link
Member

Manual backport of #28223 to 13-x-y

Description of Change

With contextIsolation enabled by default in Electron 12, the Getting Started Guide no longer works as it is written. In order for the basic example to display values from process.versions, this change adds a preload.js to the example.

Adding a preload script does increase the complexity of the "hello world" example, but setting contextIsolation: false in the example code seemed like a less ideal solution since it encourages insecure practices

Checklist

  • PR description included and stakeholders cc'd
  • relevant documentation is changed or added

Release Notes

Notes: no-notes

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 17, 2021
@trop trop bot added 13-x-y backport This is a backport PR semver/none labels Mar 17, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 17, 2021
With `contextIsolation` enabled by default in Electron 12, the Getting Started Guide no longer works as it is written. In order for the basic example to display values from `process.versions`, we need to add a `preload.js` to the example.
createWindow()
}
})
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, just found that this line missed a } when I followed the quick start guide to build the hello world app.
And it seems that only this PR is still missing the }.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out! I've sent #28253 to fix the issue in the master branch, and I'll also push updates for this PR

@zcbenz zcbenz merged commit 0c1ee8a into electron:13-x-y Mar 18, 2021
@release-clerk
Copy link

release-clerk bot commented Mar 18, 2021

No Release Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants