合并js代码

This commit is contained in:
Tlntin
2022-11-20 10:34:12 +08:00
parent 22c7d4f4a3
commit 5b9e5a7228
2 changed files with 25 additions and 21 deletions

View File

@@ -165,16 +165,7 @@ fn main() -> wry::Result<()> {
webbrowser::open(&href).expect("no browser");
}
};
#[cfg(target_os = "windows")]
let webview = WebViewBuilder::new(window)?
.with_url(&url.to_string())?
.with_devtools(cfg!(feature = "devtools"))
.with_initialization_script(include_str!("pake.js"))
.with_ipc_handler(handler)
.build()?;
#[cfg(target_os = "linux")]
let webview = WebViewBuilder::new(window)?
.with_url(&url.to_string())?
.with_devtools(cfg!(feature = "devtools"))
@@ -182,13 +173,6 @@ fn main() -> wry::Result<()> {
.with_ipc_handler(handler)
.build()?;
#[cfg(target_os = "macos")]
let webview = WebViewBuilder::new(window)?
.with_url(&url.to_string())?
.with_devtools(cfg!(feature = "devtools"))
.with_initialization_script(include_str!("pake-mac.js"))
.with_ipc_handler(handler)
.build()?;
#[cfg(feature = "devtools")] {
webview.open_devtools();