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"))