|
@@ -1,7 +1,12 @@
|
|
|
// All of the Node.js APIs are available in the preload process.
|
|
// All of the Node.js APIs are available in the preload process.
|
|
|
// It has the same sandbox as a Chrome extension.
|
|
// It has the same sandbox as a Chrome extension.
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
|
- for (const versionType of ['chrome', 'electron', 'node']) {
|
|
|
|
|
- document.getElementById(`${versionType}-version`).innerText = process.versions[versionType]
|
|
|
|
|
|
|
+ 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])
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|