1 Star 0 Fork 0

huwanlong / electron-quick-start

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
preload.js 433 Bytes
一键复制 编辑 原始数据 按行查看 历史
huwanlong 提交于 2020-10-21 21:03 . first commit
// 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])
}
})
JavaScript
1
https://gitee.com/workbook/electron-quick-start.git
git@gitee.com:workbook/electron-quick-start.git
workbook
electron-quick-start
electron-quick-start
master

搜索帮助