Struct tauri_runtime::webview::WebviewAttributes [−][src]
pub struct WebviewAttributes {
pub url: WindowUrl,
pub initialization_scripts: Vec<String>,
pub data_directory: Option<PathBuf>,
pub uri_scheme_protocols: HashMap<String, Box<dyn Fn(&str) -> Result<Vec<u8>, Box<dyn Error>> + Send + Sync + 'static>>,
pub file_drop_handler_enabled: bool,
}Expand description
The attributes used to create an webview.
Fields
url: WindowUrlinitialization_scripts: Vec<String>data_directory: Option<PathBuf>uri_scheme_protocols: HashMap<String, Box<dyn Fn(&str) -> Result<Vec<u8>, Box<dyn Error>> + Send + Sync + 'static>>file_drop_handler_enabled: boolImplementations
Sets the init script.
Data directory for the webview.
Whether the webview URI scheme protocol is defined or not.
Registers a webview protocol handler. Leverages setURLSchemeHandler on macOS, AddWebResourceRequestedFilter on Windows and webkit-web-context-register-uri-scheme on Linux.
Arguments
uri_schemeThe URI scheme to register, such asexample.protocolthe protocol associated with the given URI scheme. It’s a function that takes an URL such asexample://localhost/asset.css.
Disables the file drop handler. This is required to use drag and drop APIs on the front end on Windows.