diff options
author | 0neGal <mail@0negal.com> | 2024-02-04 17:16:00 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-02-04 17:16:00 +0100 |
commit | ee816e6a1aa908df381dcc488b1193d1e78e0ca6 (patch) | |
tree | 88dc2820edfcbe025ad8c6c75e812c619c6363c4 /src/index.js | |
parent | f165e540d0d74946eed2b8e5c857e7ee56227f8a (diff) | |
download | Viper-ee816e6a1aa908df381dcc488b1193d1e78e0ca6.tar.gz Viper-ee816e6a1aa908df381dcc488b1193d1e78e0ca6.zip |
merge src/modules/window.js into src/win.js
I intended to do this when creating src/win.js, but wanted it to be in a
different commit, as that commit made pretty large changes as well.
So no more `main_win`, `win_show` and confusion between what `win` is.
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/index.js b/src/index.js index ef6703a..358723f 100644 --- a/src/index.js +++ b/src/index.js @@ -5,7 +5,6 @@ const { app, BrowserWindow } = require("electron"); process.chdir(app.getPath("appData")); const cli = require("./cli"); -const main_win = require("./win"); const mods = require("./modules/mods"); const update = require("./modules/update"); @@ -23,7 +22,7 @@ console = require("./modules/console"); // Starts the actual BrowserWindow, which is only run when using the // GUI, for the CLI this function is never called. function start() { - win = new BrowserWindow({ + let win = new BrowserWindow({ width: 1000, height: 600, title: "Viper", @@ -39,11 +38,12 @@ function start() { frame: false, titleBarStyle: "hidden", icon: path.join(__dirname, "assets/icons/512x512.png"), + webPreferences: { webviewTag: true, nodeIntegration: true, - contextIsolation: false, - }, + contextIsolation: false + } }) // makes sending things to the renderer a little more readable @@ -51,9 +51,9 @@ function start() { win.webContents.send(channel, data); }; send = win.send; - // give `main_win` the main window, `main_win()` will then be equal + // give `./win` the main window, `./win()` will then be equal // to `win`, but its accessible anywhere - main_win.set(win); + require("./win").set(win); // when --devtools is added it'll open the dev tools if (cli.hasParam("devtools")) { |