You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
609 B

1 year ago
  1. /**
  2. * The preload script runs before `index.html` is loaded
  3. * in the renderer. It has access to web APIs as well as
  4. * Electron's renderer process modules and some polyfilled
  5. * Node.js functions.
  6. *
  7. * https://www.electronjs.org/docs/latest/tutorial/sandbox
  8. */
  9. window.isElectron = true;
  10. window.addEventListener('DOMContentLoaded', () => {
  11. const replaceText = (selector, text) => {
  12. const element = document.getElementById(selector)
  13. if (element) element.innerText = text
  14. }
  15. for (const type of ['chrome', 'node', 'electron']) {
  16. replaceText(`${type}-version`, process.versions[type])
  17. }
  18. })