From 295c5331eeb2cce40419b6a54875fba88d61422d Mon Sep 17 00:00:00 2001 From: Piroro-hs Date: Mon, 17 Oct 2022 17:34:24 +0900 Subject: [PATCH] fix: override app's desktop name and v8 flags in default-app (#35997) --- default_app/main.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/default_app/main.ts b/default_app/main.ts index f2834624f743..7defe97f3ecf 100644 --- a/default_app/main.ts +++ b/default_app/main.ts @@ -83,7 +83,7 @@ function loadApplicationPackage (packagePath: string) { }); try { - // Override app name and version. + // Override app's package.json data. packagePath = path.resolve(packagePath); const packageJsonPath = path.join(packagePath, 'package.json'); let appPath; @@ -104,6 +104,16 @@ function loadApplicationPackage (packagePath: string) { } else if (packageJson.name) { app.name = packageJson.name; } + if (packageJson.desktopName) { + app.setDesktopName(packageJson.desktopName); + } else { + app.setDesktopName(`${app.name}.desktop`); + } + // Set v8 flags, deliberately lazy load so that apps that do not use this + // feature do not pay the price + if (packageJson.v8Flags) { + require('v8').setFlagsFromString(packageJson.v8Flags); + } appPath = packagePath; }