mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* docs: Update Quick Start Guide for Electron 12 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. * Trigger Build
12 lines
319 B
JavaScript
12 lines
319 B
JavaScript
window.addEventListener('DOMContentLoaded', () => {
|
|
const replaceText = (selector, text) => {
|
|
const element = document.getElementById(selector)
|
|
if (element) element.innerText = text
|
|
}
|
|
|
|
for (const type of ['chrome', 'node', 'electron']) {
|
|
replaceText(`${type}-version`, process.versions[type])
|
|
}
|
|
})
|
|
|