From f32f6d885837ee703abed18a6cf76e7ba851f724 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 11 Dec 2022 15:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Linux=E7=AB=AF=E9=BB=98?= =?UTF-8?q?=E8=AE=A4UA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 8c33da4..41c37f2 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -162,7 +162,10 @@ fn main() -> wry::Result<()> { .unwrap_or_else(|_| panic!("can't create dir {}", data_dir.display())); } let mut web_content = WebContext::new(Some(data_dir)); + #[cfg(target_os = "windows")] let user_agent_string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62"; + #[cfg(target_os = "linux")] + let user_agent_string = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.46"; WebViewBuilder::new(window)? .with_user_agent(user_agent_string) .with_url(&url.to_string())?