0
0
mirror of https://github.com/cucumber-sp/yandex-music-linux.git synced 2025-04-04 00:03:43 +03:00
yandex-music-linux/patches/0001-Dev-Tools-from-config.patch
2025-02-07 10:47:54 +07:00

30 lines
1.4 KiB
Diff

diff --git a/main/config.js b/main/config.js
--- a/main/config.js
+++ b/main/config.js
@@ -4,9 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyCommonConfig = exports.config = void 0;
+const devTools = process.env.DEV_TOOLS && process.env.DEV_TOOLS > 0;
const package_json_1 = __importDefault(require("../package.json"));
exports.config = {
- enableDevTools: false,
+ enableDevTools: devTools,
enableWebSecurity: true,
enableAutoUpdate: true,
enableUpdateByProbability: true,
diff --git a/main/lib/preload.js b/main/lib/preload.js
--- a/main/lib/preload.js
+++ b/main/lib/preload.js
@@ -9,6 +9,8 @@ const deviceInfo_js_1 = require("./deviceInfo.js");
const deviceInfo = (0, deviceInfo_js_1.getDeviceInfo)();
+const devTools = process.env.DEV_TOOLS && process.env.DEV_TOOLS > 0;
electron_1.contextBridge.exposeInMainWorld('VERSION', String(config_js_1.config.buildInfo.VERSION));
electron_1.contextBridge.exposeInMainWorld('BRANCH', String(config_js_1.config.buildInfo.BRANCH));
electron_1.contextBridge.exposeInMainWorld('PLATFORM', deviceInfo.os);
electron_1.contextBridge.exposeInMainWorld('DEVICE_INFO', deviceInfo);
+electron_1.contextBridge.exposeInMainWorld('IS_DEVTOOLS_ENABLED', devTools);
electron_1.contextBridge.exposeInMainWorld('desktopEvents', {