diff options
author | Minteck <contact@minteck.org> | 2021-12-21 16:53:22 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-21 16:53:22 +0100 |
commit | a46c150233076b81510afa7e2f717bbaca6432df (patch) | |
tree | 65380e26d0c6bf39e50efcf8d134d36f81dc024c /main.js | |
download | desktop-a46c150233076b81510afa7e2f717bbaca6432df.tar.gz desktop-a46c150233076b81510afa7e2f717bbaca6432df.tar.bz2 desktop-a46c150233076b81510afa7e2f717bbaca6432df.zip |
Commit
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 59 |
1 files changed, 59 insertions, 0 deletions
@@ -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()
+ }
+})
|