connect solution into app: VSTi live native (vst3 attach/vst2 bridge) with WASM autosample fallback, VST GUI window (Bug 1), native-first track instrument
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Standalone permissions (Bug 5): WebView2 auto-ALLOW mọi permission request
|
||||
// (MIDI input, microphone, File System Access) — không hiện popup hỏi quyền.
|
||||
// WebView2 mặc định DENY khi không có handler ICoreWebView2::add_PermissionRequested.
|
||||
#![cfg(windows)]
|
||||
|
||||
use webview2_com::Microsoft::Web::WebView2::Win32::*;
|
||||
use webview2_com::PermissionRequestedEventHandler;
|
||||
|
||||
pub fn install(window: &tauri::WebviewWindow) {
|
||||
let _ = window.with_webview(|webview| {
|
||||
unsafe {
|
||||
if let Ok(core) = webview.controller().CoreWebView2() {
|
||||
let handler = PermissionRequestedEventHandler::create(Box::new(
|
||||
|_sender: Option<ICoreWebView2>,
|
||||
args: Option<ICoreWebView2PermissionRequestedEventArgs>| {
|
||||
if let Some(args) = args {
|
||||
args.SetState(COREWEBVIEW2_PERMISSION_STATE_ALLOW)?;
|
||||
}
|
||||
Ok(())
|
||||
},
|
||||
));
|
||||
let mut token = 0i64;
|
||||
let _ = core.add_PermissionRequested(&handler, &mut token);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user