Skip to content

Commit

Permalink
Fix open console on MacOS in developer mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lgmarchi committed Nov 14, 2023
1 parent f14407a commit 38ac308
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/src/webview_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ pub(crate) fn webview_config() -> Config {
<!doctype html>
<html>
<script src="https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js"></script>
<script type="text/javascript">
window.onload = function() {
document.addEventListener('contextmenu', function(event) {
event.preventDefault();
}, false);
};
</script>
<body style="background-color:rgba(0,0,0,0);"><div id="main"></div></body>
</html>"#
.to_string(),
Expand All @@ -20,7 +27,8 @@ pub(crate) fn webview_config() -> Config {
log::info!("Drag Event: {:?}", drag_event);
*DRAG_EVENT.write() = drag_event;
true
});
})
.with_disable_context_menu(false);

if cfg!(target_os = "windows") && STATIC_ARGS.production_mode {
let webview_data_dir = STATIC_ARGS.dot_uplink.join("tmp");
Expand Down

0 comments on commit 38ac308

Please sign in to comment.