This commit is contained in:
2023-02-04 21:42:27 +01:00
parent b257222fca
commit f5d37ef232
6 changed files with 948 additions and 0 deletions

12
preload.js Normal file
View File

@@ -0,0 +1,12 @@
// All 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])
}
})