发布初代版本

This commit is contained in:
萌森 2024-07-02 16:26:48 +08:00
parent 9a2250e5cc
commit 9ccbf93c51
3 changed files with 9 additions and 16 deletions

View File

@ -2,15 +2,10 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Hello World!</title> <title>IYUU-Plus</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head> </head>
<body> <body>
<h1>Hello World!</h1> <script defer src="https://analytics.lifebus.top/script.js" data-website-id="5ca63d47-0739-4059-a480-40e7edf80ff9"></script>
<p>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
</p>
</body> </body>
</html> </html>

View File

@ -1,10 +1,7 @@
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
const replaceText = (selector, text) => { const script = document.createElement('script');
const element = document.getElementById(selector) script.defer = true;
if (element) element.innerText = text script.src = 'https://analytics.lifebus.top/script.js';
} script.setAttribute('data-website-id', '5ca63d47-0739-4059-a480-40e7edf80ff9');
document.head.appendChild(script);
for (const dependency of ['chrome', 'node', 'electron']) { });
replaceText(`${dependency}-version`, process.versions[dependency])
}
})

View File

@ -21,6 +21,7 @@ const createWindow = () => {
height: 600, height: 600,
icon: iconPath, icon: iconPath,
webPreferences: { webPreferences: {
webSecurity: false,
preload: path.join(__dirname, '..', 'preload.js') preload: path.join(__dirname, '..', 'preload.js')
} }
}) })