We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
init_script
1 parent 3571ef2 commit 8c1e715Copy full SHA for 8c1e715
docs/usage/recipes/plugin.md
@@ -33,6 +33,14 @@ impl MyAwesomePlugin {
33
}
34
35
impl Plugin for MyAwesomePlugin {
36
+ /// The JS script to evaluate on init.
37
+ /// Useful when your plugin is accessible through `window`
38
+ /// or needs to perform a JS task on app initialization
39
+ /// e.g. "window.localStorage = { ... the plugin interface }"
40
+ fn init_script(&self) -> Option<String> {
41
+ None
42
+ }
43
+
44
/// Callback invoked when the webview is created.
45
fn created(&self, webview: &mut Webview) {}
46
0 commit comments