mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
try to fix the game hanging
This commit is contained in:
parent
74504a68f8
commit
ab15481cd6
36
dist/vendor.bundle.js
vendored
36
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -5,11 +5,12 @@ const utils = require("./utils");
|
|||||||
const achievements = require("./achievements");
|
const achievements = require("./achievements");
|
||||||
const menu = require("./menu");
|
const menu = require("./menu");
|
||||||
const api = require("./api-server");
|
const api = require("./api-server");
|
||||||
|
const cp = require("child_process");
|
||||||
|
|
||||||
const debug = process.argv.includes("--debug");
|
const debug = process.argv.includes("--debug");
|
||||||
|
|
||||||
async function createWindow(killall) {
|
async function createWindow(killall) {
|
||||||
const setStopProcessHandler = global.app_handlers.stopProcess
|
const setStopProcessHandler = global.app_handlers.stopProcess;
|
||||||
const window = new BrowserWindow({
|
const window = new BrowserWindow({
|
||||||
show: false,
|
show: false,
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
@ -24,14 +25,18 @@ async function createWindow(killall) {
|
|||||||
if (debug) window.webContents.openDevTools();
|
if (debug) window.webContents.openDevTools();
|
||||||
|
|
||||||
window.webContents.on("new-window", function (e, url) {
|
window.webContents.on("new-window", function (e, url) {
|
||||||
// make sure local urls stay in electron perimeter
|
if (process.platform === "win32") {
|
||||||
if (url.substr(0, "file://".length) === "file://") {
|
cp.spawn("explorer", [url], { detached: true, stdio: "ignore" });
|
||||||
return;
|
} else {
|
||||||
}
|
// make sure local urls stay in electron perimeter
|
||||||
|
if (url.substr(0, "file://".length) === "file://") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// and open every other protocols on the browser
|
// and open every other protocols on the browser
|
||||||
|
utils.openExternal(url);
|
||||||
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
utils.openExternal(url);
|
|
||||||
});
|
});
|
||||||
window.webContents.backgroundThrottling = false;
|
window.webContents.backgroundThrottling = false;
|
||||||
|
|
||||||
@ -43,7 +48,7 @@ async function createWindow(killall) {
|
|||||||
await api.initialize(window);
|
await api.initialize(window);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
utils.showErrorBox('Error starting http server', error);
|
utils.showErrorBox("Error starting http server", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.refreshMenu(window);
|
menu.refreshMenu(window);
|
||||||
@ -54,4 +59,4 @@ async function createWindow(killall) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
createWindow,
|
createWindow,
|
||||||
}
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user