summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:53:22 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:53:22 +0100
commita46c150233076b81510afa7e2f717bbaca6432df (patch)
tree65380e26d0c6bf39e50efcf8d134d36f81dc024c /main.js
downloaddesktop-a46c150233076b81510afa7e2f717bbaca6432df.tar.gz
desktop-a46c150233076b81510afa7e2f717bbaca6432df.tar.bz2
desktop-a46c150233076b81510afa7e2f717bbaca6432df.zip
Commit
Diffstat (limited to 'main.js')
-rw-r--r--main.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/main.js b/main.js
new file mode 100644
index 0000000..c49370b
--- /dev/null
+++ b/main.js
@@ -0,0 +1,59 @@
+const { app, BrowserWindow } = require('electron')
+const path = require('path')
+
+if (require('os').platform() === "win32") {
+ logo = path.join(__dirname, "logo.ico");
+} else {
+ logo = path.join(__dirname, "logo.png");
+}
+
+function createWindow () {
+ const win = new BrowserWindow({
+ width: 1100,
+ height: 600,
+ /*frame: false,*/
+ icon: logo,
+ show: false,
+ webPreferences: {
+ preload: path.join(__dirname, "internal.js"),
+ nodeIntegration: false,
+ nodeIntegrationInWorker: false,
+ nodeIntegrationInSubFrames: false,
+ contextIsolation: false,
+ webviewTag: true,
+ enableRemoteModule: true
+ }
+ })
+
+ win.setMenu(null);
+ win.webContents.userAgent = win.webContents.userAgent + " +FL4D/2.21"
+ win.loadURL('https://familine.minteck.org/')
+ win.openDevTools();
+ win.on('ready-to-show', () => {
+ win.show();
+ })
+
+const { shell } = require('electron')
+
+win.webContents.on('new-window', function (event, url) {
+ event.preventDefault()
+ shell.openExternal(url)
+})
+
+}
+
+app.whenReady().then(() => {
+ createWindow()
+
+ app.on('activate', () => {
+ if (BrowserWindow.getAllWindows().length === 0) {
+ createWindow()
+ }
+ })
+})
+
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})