Initial commit, copied from electron example.

This commit is contained in:
2022-06-10 15:48:35 -04:00
parent 95f931a9e9
commit 09fa40f4c8
13 changed files with 2850 additions and 0 deletions

12
preload.js Normal file
View File

@@ -0,0 +1,12 @@
// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
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])
}
})