初始化

This commit is contained in:
ZilongYang
2021-10-13 20:59:12 +08:00
commit 56a79617f0
73 changed files with 13328 additions and 0 deletions

14
electron/preload.js Normal file
View File

@@ -0,0 +1,14 @@
// electron/preload.js
// 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 dependency of ['chrome', 'node', 'electron']) {
replaceText(`${dependency}-version`, process.versions[dependency])
}
})