From 1cc49dcaf08d96c306024ecad029b780ca3e7306 Mon Sep 17 00:00:00 2001 From: momen Date: Fri, 19 Sep 2025 20:16:08 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E5=BD=93config.ini=E4=B8=BA[webengine]?= =?UTF-8?q?=20noSandbox=3Dtrue=20=E6=97=B6=EF=BC=8C=E5=88=99=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=B2=99=E7=AE=B1=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 2e155e8..776a3e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -153,6 +153,10 @@ int main(int argc, char *argv[]) #if defined __sw_64__ || __loongarch__ chromium_flags.append("--no-sandbox"); #endif + // 如果配置文件中设置了关闭沙箱,则添加no-sandbox标志 + if (Utils::shouldDisableWebEngineSandbox()) { + chromium_flags.append("--no-sandbox"); + } qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags.join(" ").toUtf8()); /** @@ -199,4 +203,4 @@ int main(int argc, char *argv[]) w.show(); return a.exec(); -} +} \ No newline at end of file