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: WindowUrlinitialization_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 as example.
  • protocol the protocol associated with the given URI scheme. It’s a function that takes an URL such as example://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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.