mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-14 22:27:20 -05:00
prevent macOS HTTPS upgrade for localhost resources
This commit is contained in:
@@ -658,6 +658,17 @@ fn main() {
|
||||
.initialization_script(LINK_HANDLER_SCRIPT)
|
||||
.build()?;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
use objc2::msg_send;
|
||||
use objc2::runtime::AnyObject;
|
||||
let _ = window.with_webview(|webview| unsafe {
|
||||
let wk_webview = webview.inner() as *mut AnyObject;
|
||||
let config: *mut AnyObject = msg_send![wk_webview, configuration];
|
||||
let _: () = msg_send![config, setUpgradeKnownHostsToHTTPS: false];
|
||||
});
|
||||
}
|
||||
|
||||
let (main_js, root_dir) = resolve_script_and_root(app);
|
||||
debug_log("Searching for node binary...");
|
||||
let node_bin = match find_node_binary(app) {
|
||||
@@ -858,9 +869,15 @@ fn main() {
|
||||
window_label
|
||||
));
|
||||
}
|
||||
} else {
|
||||
let _ = w.emit(&msg.event, msg.data.clone());
|
||||
}
|
||||
} else if msg.event == "ready" {
|
||||
if let Some(url_str) = msg.data.get("url").and_then(|u| u.as_str()) {
|
||||
if let Ok(url_parsed) = url_str.parse::<tauri::Url>() {
|
||||
let _ = w.navigate(url_parsed);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let _ = w.emit(&msg.event, msg.data.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user