mirror of
https://github.com/CompeyDev/gitpod-electron-typescript.git
synced 2024-12-12 12:50:37 +00:00
14 lines
500 B
TypeScript
14 lines
500 B
TypeScript
// 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: string, text: string) => {
|
|
const element = document.getElementById(selector);
|
|
if (element) {
|
|
element.innerText = text;
|
|
}
|
|
};
|
|
|
|
for (const type of ["chrome", "node", "electron"]) {
|
|
replaceText(`${type}-version`, process.versions[type as keyof NodeJS.ProcessVersions]);
|
|
}
|
|
});
|