-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Colin Troisemaine
authored and
Colin Troisemaine
committed
Oct 21, 2024
1 parent
c270224
commit 13bbb2d
Showing
6 changed files
with
6,885 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | ||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | ||
<title>Hello World!</title> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
We are using Node.js <span id="node-version"></span>, | ||
Chromium <span id="chrome-version"></span>, | ||
and Electron <span id="electron-version"></span>. | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { app, BrowserWindow } = require('electron') | ||
|
||
const path = require('node:path') | ||
|
||
const createWindow = () => { | ||
const win = new BrowserWindow({ | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
preload: path.join(__dirname, 'preload.js') | ||
} | ||
}) | ||
|
||
win.loadFile('electron_app/control_menu.html') | ||
} | ||
|
||
app.whenReady().then(() => { | ||
createWindow() | ||
|
||
app.on('activate', () => { | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow() | ||
}) | ||
}) | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') app.quit() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
const replaceText = (selector, text) => { | ||
const element = document.getElementById(selector) | ||
if (element) element.innerText = text | ||
} | ||
|
||
for (const dependency of ['chrome', 'node', 'electron']) { | ||
replaceText(`${dependency}-version`, process.versions[dependency]) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const { FusesPlugin } = require('@electron-forge/plugin-fuses'); | ||
const { FuseV1Options, FuseVersion } = require('@electron/fuses'); | ||
|
||
module.exports = { | ||
publishers: [ | ||
{ | ||
name: '@electron-forge/publisher-github', | ||
config: { | ||
repository: { | ||
owner: 'ColinTr', | ||
name: 'LiveDesktopTranslator' | ||
}, | ||
prerelease: true | ||
} | ||
} | ||
], | ||
packagerConfig: { | ||
asar: true, | ||
}, | ||
rebuildConfig: {}, | ||
makers: [ | ||
{ | ||
name: '@electron-forge/maker-squirrel', | ||
config: {}, | ||
}, | ||
{ | ||
name: '@electron-forge/maker-zip', | ||
platforms: ['darwin'], | ||
}, | ||
{ | ||
name: '@electron-forge/maker-deb', | ||
config: {}, | ||
}, | ||
{ | ||
name: '@electron-forge/maker-rpm', | ||
config: {}, | ||
}, | ||
], | ||
plugins: [ | ||
{ | ||
name: '@electron-forge/plugin-auto-unpack-natives', | ||
config: {}, | ||
}, | ||
// Fuses are used to enable/disable various Electron functionality | ||
// at package time, before code signing the application | ||
new FusesPlugin({ | ||
version: FuseVersion.V1, | ||
[FuseV1Options.RunAsNode]: false, | ||
[FuseV1Options.EnableCookieEncryption]: true, | ||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, | ||
[FuseV1Options.EnableNodeCliInspectArguments]: false, | ||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, | ||
[FuseV1Options.OnlyLoadAppFromAsar]: true, | ||
}), | ||
], | ||
}; |
Oops, something went wrong.