Struct tauri::WebviewAttributes [−][src]
pub struct WebviewAttributes { pub url: WindowUrl, pub initialization_scripts: Vec<String, Global>, pub data_directory: Option<PathBuf>, pub uri_scheme_protocols: HashMap<String, Box<dyn Fn(&str) + Sync + Send + 'static, Global>, RandomState>, pub file_drop_handler_enabled: bool, }
Expand description
The attributes used to create an webview.
Fields
url: WindowUrl
initialization_scripts: Vec<String, Global>
data_directory: Option<PathBuf>
uri_scheme_protocols: HashMap<String, Box<dyn Fn(&str) + Sync + Send + 'static, Global>, RandomState>
file_drop_handler_enabled: bool
Implementations
Initializes the default attributes for a webview.
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_scheme
The URI scheme to register, such asexample
.protocol
the 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.
Auto Trait Implementations
impl !RefUnwindSafe for WebviewAttributes
impl Send for WebviewAttributes
impl Sync for WebviewAttributes
impl Unpin for WebviewAttributes
impl !UnwindSafe for WebviewAttributes