Skip to content

Instantly share code, notes, and snippets.

@lucasfernog
Created August 16, 2019 22:42
Show Gist options
  • Save lucasfernog/36be16faaf2c55a7764ade80d45f2869 to your computer and use it in GitHub Desktop.
Save lucasfernog/36be16faaf2c55a7764ade80d45f2869 to your computer and use it in GitHub Desktop.
struct Ext {
}
impl tauri::extension::Extension for Ext {
fn ready(&self, webview: &mut tauri_ui::WebView<'_, ()>) {
println!("ready");
tauri::event::emit(webview.handle(), "test", "'a'".to_string());
}
fn extend_api(&self, webview: &mut tauri_ui::WebView<'_, ()>, arg: &str) {
// do something
}
}
fn main() {
tauri::AppBuilder::new()
.extension(Ext{})
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment