This commit is contained in:
smartfrigde 2024-06-16 15:33:20 +02:00
parent 651f197dd2
commit 003cbb1abd
2 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ function doAfterDefiningTheWindow(passedWindow: BrowserWindow): void {
passedWindow.webContents.userAgent = passedWindow.webContents.userAgent =
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.149 Mobile Safari/537.36"; "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.149 Mobile Safari/537.36";
} else { } else {
var osType = process.platform === "darwin" ? "Macintosh" : process.platform === "win32" ? "Windows" : "Linux"; let osType = process.platform === "darwin" ? "Macintosh" : process.platform === "win32" ? "Windows" : "Linux";
if (osType === "Linux") osType = "X11; " + osType; if (osType === "Linux") osType = "X11; " + osType;
const chromeVersion = process.versions.chrome; const chromeVersion = process.versions.chrome;
const userAgent = `Mozilla/5.0 (${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${chromeVersion} Safari/537.36`; const userAgent = `Mozilla/5.0 (${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${chromeVersion} Safari/537.36`;

View file

@ -31,7 +31,7 @@ app.on("render-process-gone", (_event, _webContents, details) => {
app.relaunch(); app.relaunch();
} }
}); });
async function args(): Promise<void> { function args(): void {
let argNum = 2; let argNum = 2;
if (process.argv[0] == "electron") argNum++; if (process.argv[0] == "electron") argNum++;
const args = process.argv[argNum]; const args = process.argv[argNum];
@ -74,7 +74,7 @@ export async function init(): Promise<void> {
break; break;
} }
} }
await args(); // i want my top level awaits - IMPLEMENTED :) args();
if (!app.requestSingleInstanceLock()) { if (!app.requestSingleInstanceLock()) {
// if value isn't set after 3.2.4 // if value isn't set after 3.2.4
// kill if 2nd instance // kill if 2nd instance