From 2f9ee31b455bb1828969f08a08a7f67bfaddd13c Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 24 Nov 2022 21:12:51 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=AE=8C=E6=88=90=E5=AF=B91.2.0?= =?UTF-8?q?=E7=9A=84=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/Cargo.lock | 12 ++++++------ src-tauri/Cargo.toml | 2 +- src-tauri/src/main.rs | 5 +++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 30a291d..9da805f 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1761,9 +1761,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376" dependencies = [ "bitflags", "cfg-if", @@ -1793,9 +1793,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" dependencies = [ "autocfg", "cc", @@ -3875,9 +3875,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1cd2757071a2e764f63d72f3039f15a41cff6127dc52879597a2e037e1ee7" +checksum = "538b1e167b9905baca8e8a91367ac0c7d0afbead632ad76ad9667748209a4c78" dependencies = [ "base64", "block", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index a66ad5d..3e999ba 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -22,7 +22,7 @@ tauri = { version = "1.2.0", features = ["api-all"] } image = "0.24.5" tauri-utils = "1.2.0" webbrowser = "0.8.2" -wry = "0.22.3" +wry = "0.22.4" [features] # by default Tauri runs in production mode diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 8ba6e3f..8e80bc2 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -156,7 +156,12 @@ fn main() -> wry::Result<()> { } }; + // 用于欺骗有些页面对于浏览器的检测 + let user_agent_string = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36"; + let webview = WebViewBuilder::new(window)? + .with_user_agent(&user_agent_string) + .with_accept_first_mouse(true) .with_url(&url.to_string())? .with_devtools(cfg!(feature = "devtools")) .with_initialization_script(include_str!("pake.js"))