docs.rs failed to build tauri-plugin-prevent-default-0.7.2
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.
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 browser shortcuts in your Tauri app, e.g. F3
or Ctrl+J
.
Install
Install the plugin by adding the following to your Cargo.toml
file:
[]
= 0.7
If using custom listeners, you must also enable the required permissions:
src-tauri/capabilities/prevent-default.json
Usage
Register the plugin with Tauri:
src-tauri/src/main.rs
.plugin
.run
.expect;
default
You can also use flags to determine which shortcuts the plugin should disable. By default, it will disable all of them.
use Flags;
let prevent = new
.with_flags
.build;
default
.plugin
.run
.expect;
- Disable all but a few:
use Flags;
// This will disable all shortcuts, except `FIND` and `RELOAD`.
new
.with_flags
.build
- Disable only keyboard shortcuts:
use Flags;
new
.with_flags
.build
- Disable custom shortcuts:
use KeyboardShortcut;
use ;
new
.shortcut
.shortcut
.shortcut
.build;
- Keep certain shortcuts enabled only when in dev mode:
- WINDOWS ONLY: Disable form information from being saved and autofilled:
.general_autofill
.build
new
Note
The plugin should work fine on Windows, but there are still tests to be done on MacOS and Linux. If you encounter any problems on these platforms, please open an issue.
Supported Tauri Version
This plugin requires Tauri 2.0
or later.