回退wry版本,暂时取消Linux/Windows自定义请求头,防止快捷键失效
This commit is contained in:
@@ -157,6 +157,8 @@ fn main() -> wry::Result<()> {
|
||||
};
|
||||
|
||||
// 用于欺骗部分页面对于浏览器的强检测
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
let user_agent_string = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15";
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -167,18 +169,18 @@ fn main() -> wry::Result<()> {
|
||||
.with_devtools(cfg!(feature = "devtools"))
|
||||
.with_initialization_script(include_str!("pake.js"))
|
||||
.with_ipc_handler(handler)
|
||||
.with_back_forward_navigation_gestures(true)
|
||||
// .with_back_forward_navigation_gestures(true)
|
||||
.build()?;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
let webview = WebViewBuilder::new(window)?
|
||||
.with_user_agent(user_agent_string)
|
||||
.with_accept_first_mouse(true)
|
||||
// .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"))
|
||||
.with_ipc_handler(handler)
|
||||
.with_back_forward_navigation_gestures(true)
|
||||
// .with_back_forward_navigation_gestures(true)
|
||||
.build()?;
|
||||
// 自定义cookie文件夹,仅用于Linux
|
||||
// Custom Cookie folder, only for Linux
|
||||
@@ -193,14 +195,14 @@ fn main() -> wry::Result<()> {
|
||||
let mut web_content = WebContext::new(Some(data_path));
|
||||
#[cfg(target_os = "linux")]
|
||||
let webview = WebViewBuilder::new(window)?
|
||||
.with_user_agent(user_agent_string)
|
||||
.with_accept_first_mouse(true)
|
||||
// .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"))
|
||||
.with_ipc_handler(handler)
|
||||
.with_web_context(&mut web_content)
|
||||
.with_back_forward_navigation_gestures(true)
|
||||
// .with_back_forward_navigation_gestures(true)
|
||||
.build()?;
|
||||
|
||||
#[cfg(feature = "devtools")]
|
||||
|
||||
Reference in New Issue
Block a user