diff options
author | Minteck <contact@minteck.org> | 2022-06-27 17:02:30 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-27 17:02:30 +0200 |
commit | eed86d556ccba5d6bfdc8795990f188d0c573fc7 (patch) | |
tree | 3494d9fb204550eb4eba0321b808f771fb6c94e2 /index.js | |
parent | d2a4546fdb55ac8dba8d41d3a7dad39e68555c81 (diff) | |
download | bits-client-eed86d556ccba5d6bfdc8795990f188d0c573fc7.tar.gz bits-client-eed86d556ccba5d6bfdc8795990f188d0c573fc7.tar.bz2 bits-client-eed86d556ccba5d6bfdc8795990f188d0c573fc7.zip |
Update
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 148 |
1 files changed, 74 insertions, 74 deletions
@@ -1,75 +1,75 @@ -// noinspection HttpUrlsUsage - -const { app, BrowserWindow, ipcMain } = require('electron'); - -const createWindow = () => { - global.mainWindow = new BrowserWindow({ - width: 1200, - height: 700, - title: "Bits", - fullscreenable: false, - backgroundColor: "#222", - webPreferences: { - nodeIntegration: true, - nodeIntegrationInSubFrames: true, - contextIsolation: false, - enableRemoteModule: true - } - }) - - mainWindow.loadFile('index.html') - mainWindow.menuBarVisible = false; -} - -process.on('uncaughtException', (error) => { - console.error(error); -}) - -app.whenReady().then(() => { - createWindow() -}) - -app.on('window-all-closed', () => { - app.quit() -}) - -global.authenticationSucceeded = false; - -ipcMain.on("login", () => { - const loginWindow = new BrowserWindow({ - width: 500, - height: 800, - parent: mainWindow, - title: "Bits", - show: false, - fullscreenable: false, - backgroundColor: "#fff", - webPreferences: { - nodeIntegration: false, - nodeIntegrationInSubFrames: false, - contextIsolation: true, - enableRemoteModule: false - } - }); - - global.authenticationCheckInterval = setInterval(() => { - let url = loginWindow.webContents.getURL(); - - if (url.startsWith("https://auth.equestria.horse") || url.includes("Disallowed")) { - loginWindow.show(); - } - - if (url === "https://money-v1.equestria.dev/Authentication/Success/" || url === "https://money-v2.equestria.dev/Authentication/Success/") { - clearInterval(authenticationCheckInterval); - global.authenticationSucceeded = true; - loginWindow.close(); - mainWindow.webContents.reload(); - } - }, 100); - - loginWindow.on('close', () => { - if (!authenticationSucceeded) mainWindow.close(); - }) - - loginWindow.loadURL("https://money.equestria.dev/Authentication/Start"); +// noinspection HttpUrlsUsage
+
+const { app, BrowserWindow, ipcMain } = require('electron');
+
+const createWindow = () => {
+ global.mainWindow = new BrowserWindow({
+ width: 1200,
+ height: 700,
+ title: "Bits",
+ fullscreenable: false,
+ backgroundColor: "#222",
+ webPreferences: {
+ nodeIntegration: true,
+ nodeIntegrationInSubFrames: true,
+ contextIsolation: false,
+ enableRemoteModule: true
+ }
+ })
+
+ mainWindow.loadFile('index.html')
+ mainWindow.menuBarVisible = false;
+}
+
+process.on('uncaughtException', (error) => {
+ console.error(error);
+})
+
+app.whenReady().then(() => {
+ createWindow()
+})
+
+app.on('window-all-closed', () => {
+ app.quit()
+})
+
+global.authenticationSucceeded = false;
+
+ipcMain.on("login", () => {
+ const loginWindow = new BrowserWindow({
+ width: 500,
+ height: 800,
+ parent: mainWindow,
+ title: "Bits",
+ show: false,
+ fullscreenable: false,
+ backgroundColor: "#fff",
+ webPreferences: {
+ nodeIntegration: false,
+ nodeIntegrationInSubFrames: false,
+ contextIsolation: true,
+ enableRemoteModule: false
+ }
+ });
+
+ global.authenticationCheckInterval = setInterval(() => {
+ let url = loginWindow.webContents.getURL();
+
+ if (url.startsWith("https://auth.equestria.horse") || url.includes("Disallowed")) {
+ loginWindow.show();
+ }
+
+ if (url === "https://money-v1.equestria.dev/Authentication/Success/" || url === "https://money-v2.equestria.dev/Authentication/Success/") {
+ clearInterval(authenticationCheckInterval);
+ global.authenticationSucceeded = true;
+ loginWindow.close();
+ mainWindow.webContents.reload();
+ }
+ }, 100);
+
+ loginWindow.on('close', () => {
+ if (!authenticationSucceeded) mainWindow.close();
+ })
+
+ loginWindow.loadURL("https://money.equestria.dev/Authentication/Start");
})
\ No newline at end of file |