This repository has been archived on 2023-10-03. You can view files and clone it, but cannot push or open issues or pull requests.
NervUpdaterClient/preload.js
2023-02-04 21:42:27 +01:00

12 lines
467 B
JavaScript

// 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])
}
})