mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Support set Chromium command line arguments on the desktop https://github.com/siyuan-note/siyuan/issues/9696
This commit is contained in:
parent
9403046dfc
commit
5a727078be
1 changed files with 16 additions and 1 deletions
|
|
@ -590,6 +590,7 @@ const initKernel = (workspace, port, lang) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
app.setAsDefaultProtocolClient("siyuan");
|
app.setAsDefaultProtocolClient("siyuan");
|
||||||
|
app.setPath("userData", app.getPath("userData") + "-Electron"); // `~/.config` 下 Electron 相关文件夹名称改为 `SiYuan-Electron` https://github.com/siyuan-note/siyuan/issues/3349
|
||||||
|
|
||||||
app.commandLine.appendSwitch("disable-web-security");
|
app.commandLine.appendSwitch("disable-web-security");
|
||||||
app.commandLine.appendSwitch("auto-detect", "false");
|
app.commandLine.appendSwitch("auto-detect", "false");
|
||||||
|
|
@ -597,7 +598,21 @@ app.commandLine.appendSwitch("no-proxy-server");
|
||||||
app.commandLine.appendSwitch("enable-features", "PlatformHEVCDecoderSupport");
|
app.commandLine.appendSwitch("enable-features", "PlatformHEVCDecoderSupport");
|
||||||
app.commandLine.appendSwitch("force_high_performance_gpu"); // Force using discrete GPU when there are multiple GPUs available on the desktop https://github.com/siyuan-note/siyuan/issues/9694
|
app.commandLine.appendSwitch("force_high_performance_gpu"); // Force using discrete GPU when there are multiple GPUs available on the desktop https://github.com/siyuan-note/siyuan/issues/9694
|
||||||
|
|
||||||
app.setPath("userData", app.getPath("userData") + "-Electron"); // `~/.config` 下 Electron 相关文件夹名称改为 `SiYuan-Electron` https://github.com/siyuan-note/siyuan/issues/3349
|
// Support set Chromium command line arguments on the desktop https://github.com/siyuan-note/siyuan/issues/9696
|
||||||
|
writeLog("app is packaged [" + app.isPackaged + "], command line args [" + process.argv.join(", ") + "]");
|
||||||
|
let argStart = 1;
|
||||||
|
if (!app.isPackaged) {
|
||||||
|
argStart = 2
|
||||||
|
}
|
||||||
|
for (let i = argStart; i < process.argv.length; i++) {
|
||||||
|
if (process.argv[i].startsWith("--workspace=") || process.argv[i].startsWith("--port=")) {
|
||||||
|
// 跳过内置参数
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch(process.argv[i]);
|
||||||
|
writeLog("command line switch [" + process.argv[i] + "]");
|
||||||
|
}
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
const resetTrayMenu = (tray, lang, mainWindow) => {
|
const resetTrayMenu = (tray, lang, mainWindow) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue