tauri-plugin-prevent-default 0.1.3

Disable default webview shortcuts
docs.rs failed to build tauri-plugin-prevent-default-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: tauri-plugin-prevent-default-3.0.1

tauri-plugin-prevent-default

Disable default webview shortcuts in your Tauri app, e.g. F3 or Ctrl+J.

Install

Install the plugin by adding the following to your Cargo.toml file:

[dependencies]
tauri-plugin-prevent-default = 0.1

Usage

Register the plugin with Tauri:

src-tauri/src/main.rs

fn main() {
  tauri::Builder::default()
    .plugin(tauri_plugin_prevent_default::Builder::new().build())
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

You can also use flags to determine which shortcuts the plugin should disable. By default, it will disable all of them.

use tauri_plugin_prevent_default::Flags;

fn main() {
  let prevent = tauri_plugin_prevent_default::Builder::new()
    .with_flags(Flags::CONTEXT_MENU | Flags::PRINT | Flags::DOWNLOADS)
    .build();

  tauri::Builder::default()
    .plugin(prevent)
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

Contributing

If you know of any other shortcuts that we can include in the plugin, please let us know!