Trait tauri::plugin::Plugin [−][src]
pub trait Plugin<M: Params>: Send { fn name(&self) -> &'static str; fn initialize(&mut self, config: JsonValue) -> Result<()> { ... } fn initialization_script(&self) -> Option<String> { ... } fn created(&mut self, window: Window<M>) { ... } fn on_page_load(&mut self, window: Window<M>, payload: PageLoadPayload) { ... } fn extend_api(&mut self, message: InvokeMessage<M>) { ... } }
The plugin interface.
Required methods
Loading content...Provided methods
fn initialize(&mut self, config: JsonValue) -> Result<()>
[src]
Initialize the plugin.
fn initialization_script(&self) -> Option<String>
[src]
The JS script to evaluate on webview initialization.
The script is wrapped into its own context with (function () { /* your script here */ })();
,
so global variables must be assigned to window
instead of implicity declared.
It’s guaranteed that this script is executed before the page is loaded.
fn created(&mut self, window: Window<M>)
[src]
Callback invoked when the webview is created.
fn on_page_load(&mut self, window: Window<M>, payload: PageLoadPayload)
[src]
Callback invoked when the webview performs a navigation.
fn extend_api(&mut self, message: InvokeMessage<M>)
[src]
Add invoke_handler API extension commands.