Sentry/preload.js
Gregory Ballantine 6e6fa2b757
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Started the base Electron project
2022-05-25 14:28:19 -04:00

13 lines
433 B
JavaScript

// 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 type of ['chrome', 'node', 'electron']) {
replaceText(`${type}-version`, process.versions[type])
}
})