-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New development window (DarkDev) - Custom load, modifies the requests and allows modifying them - Resource Download, utility to download darkorbit resources DarkDev is in beta, it may have bugs
- Loading branch information
Showing
12 changed files
with
1,180 additions
and
5 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
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
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,68 @@ | ||
const { BrowserWindow, MenuItem, ipcMain } = require('electron'); | ||
const settings = require("electron-settings"); | ||
|
||
const CustomLoad = require("./tools/CustomLoad"); | ||
const ResourceDownload = require("./tools/ResourceDownload"); | ||
|
||
class DarkDev { | ||
constructor(client) { | ||
this.client = client; | ||
this.customLoad; | ||
this.window; | ||
|
||
if (!this.client.arg.dev) { | ||
return; | ||
} | ||
|
||
let options = { | ||
'show': false, | ||
'webPreferences': { | ||
'preload': `${__dirname}/master.js`, | ||
'contextIsolation': true, | ||
'nodeIntegration': true, | ||
'nodeIntegrationInWorker': true, | ||
'enableRemoteModule': true, | ||
'webSecurity': false, | ||
'plugins': true, | ||
'devTools': this.client.arg.dev | ||
} | ||
}; | ||
|
||
this.window = new BrowserWindow(options); | ||
|
||
this.window.setMenuBarVisibility(false); | ||
|
||
this.window.loadFile("./darkDev/index.html"); | ||
|
||
this.client.menuTray.insert(0, new MenuItem({ | ||
label: "DarkDev", | ||
type: "normal", | ||
click: () => this.window.show() | ||
})); | ||
|
||
this.client.menuTray.insert(1, new MenuItem({ | ||
type: "separator" | ||
})); | ||
|
||
this.window.on('close', (event) => { | ||
event.preventDefault(); | ||
this.window.hide(); | ||
}) | ||
|
||
this.customLoad = new CustomLoad(this.client, this.window); | ||
|
||
ipcMain.on("LoadConfigDarkDev", () => { | ||
this.window.webContents.send("SendLoadConfigDarkDev", settings.getSync().DarkDev) | ||
}) | ||
|
||
ipcMain.on('ResourceDownload', (event, opt) => { | ||
this.resourceDownload(opt); | ||
}); | ||
} | ||
|
||
async resourceDownload(opt) { | ||
await new ResourceDownload(this.window, opt); | ||
} | ||
} | ||
|
||
module.exports = DarkDev; |
Oops, something went wrong.