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 menu = require("./menu");
|
||||
const api = require("./api-server");
|
||||
const cp = require("child_process");
|
||||
|
||||
const debug = process.argv.includes("--debug");
|
||||
|
||||
async function createWindow(killall) {
|
||||
const setStopProcessHandler = global.app_handlers.stopProcess
|
||||
const setStopProcessHandler = global.app_handlers.stopProcess;
|
||||
const window = new BrowserWindow({
|
||||
show: false,
|
||||
backgroundThrottling: false,
|
||||
@ -24,14 +25,18 @@ async function createWindow(killall) {
|
||||
if (debug) window.webContents.openDevTools();
|
||||
|
||||
window.webContents.on("new-window", function (e, url) {
|
||||
if (process.platform === "win32") {
|
||||
cp.spawn("explorer", [url], { detached: true, stdio: "ignore" });
|
||||
} 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
|
||||
e.preventDefault();
|
||||
utils.openExternal(url);
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
window.webContents.backgroundThrottling = false;
|
||||
|
||||
@ -43,7 +48,7 @@ async function createWindow(killall) {
|
||||
await api.initialize(window);
|
||||
} catch (error) {
|
||||
log.error(error);
|
||||
utils.showErrorBox('Error starting http server', error);
|
||||
utils.showErrorBox("Error starting http server", error);
|
||||
}
|
||||
|
||||
menu.refreshMenu(window);
|
||||
@ -54,4 +59,4 @@ async function createWindow(killall) {
|
||||
|
||||
module.exports = {
|
||||
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