mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
✨ 添加菜单项
This commit is contained in:
@@ -68,16 +68,14 @@ pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
|
|||||||
}
|
}
|
||||||
"open_post" => {
|
"open_post" => {
|
||||||
let window = handle.get_window("mhy_client").unwrap();
|
let window = handle.get_window("mhy_client").unwrap();
|
||||||
let execute_js = r#"
|
let execute_js = r#"javascript:(async function(){
|
||||||
let url = window.location.href;
|
let url = window.location.href;
|
||||||
let arg = {
|
let arg = {
|
||||||
method: 'teyvat_open',
|
method: 'teyvat_open',
|
||||||
payload: {
|
payload: url,
|
||||||
url: url
|
|
||||||
}
|
}
|
||||||
}
|
await window.__TAURI__.event.emit('post_mhy_client',JSON.stringify(arg));
|
||||||
window.__TAURI__.emit('post_mhy_client',JSON.stringify(arg));
|
})()"#;
|
||||||
"#;
|
|
||||||
window.eval(&execute_js).ok().unwrap();
|
window.eval(&execute_js).ok().unwrap();
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|||||||
Reference in New Issue
Block a user