The popup of the default right-click menu is now blocked by default in release mode

This commit is contained in:
Tim-Paik 2022-05-07 23:04:01 +08:00
parent d561b97018
commit 9f5111ced6
Signed by: Tim-Paik
GPG Key ID: DC36A050DB42566D
1 changed files with 1 additions and 0 deletions

View File

@ -143,6 +143,7 @@ fn main() -> wry::Result<()> {
.with_visible(res.window_attr.visible)
.with_transparent(res.window_attr.transparent)
.with_web_context(&mut web_context)
.with_initialization_script(r#"window.oncontextmenu = (event) => { event.preventDefault(); }"#)
.with_custom_protocol(PROTOCOL.to_string(), move |request| {
let path = custom_protocol_uri_to_path(PROTOCOL, request.uri())?;
let mut file = match res.open(path) {