Repository: versotile-org/verso
File: src/webview/webview.rs (Rust)

Code before:
        clipboard: Option<&mut Clipboard>,
        compositor: &mut IOCompositor,
    ) {
        log::trace!("Verso WebView {webview_id:?} is handling Embedder message: {message:?}",);
        match message {
            EmbedderMsg::HeadParsed(_)
            | EmbedderMsg::WebViewOpened(_)
            | EmbedderMsg::WebViewClosed(_) => {
                // Most WebView messages are ignored because it's done by compositor.
                log::trace!("Verso WebView {webview_id:?} ignores this message: {message:?}")
            }
            EmbedderMsg::WebViewBlurred => {
                self.focused_webview_id = None;
            }
            EmbedderMsg::WebViewFocused(w) => {
                self.focused_webview_id = Some(webview_id);
                self.close_context_menu(sender);
                log::debug!(
                    "Verso Window {:?}'s webview {} has loaded completely.",
                    self.id(),
                    w
                );
            }
            EmbedderMsg::LoadStart(_) => {
                if let Some(init_script) = &self.init_script {
                    let _ = execute_script(&sender, &webview_id, init_script);
                }
            }
            EmbedderMsg::LoadComplete(_webview_id) => {
                self.window.request_redraw();
                send_to_constellation(sender, ConstellationMsg::FocusWebView(webview_id));
            }
            EmbedderMsg::ChangePageTitle(_webview_id, title) => {
                if let Some(panel) = self.panel.as_ref() {
                    let title = if let Some(title) = title {
                        format!("'{title}'")
                    } else {
                        "null".to_string()
                    };

                    let script = format!(
                        "window.navbar.setTabTitle('{}', {})",
                        serde_json::to_string(&webview_id).unwrap(),
                        title.as_str()
                    );
                    let _ = execute_script(sender, &panel.webview.webview_id, script);
                }
            }
            EmbedderMsg::AllowNavigationRequest(_webview_id, id, url) => {
                if let Some(to_controller_sender) = to_controller_sender {
                    if self.event_listeners.on_navigation_starting {

Review comment (suggestion):
```suggestion
                    let _ = execute_script(sender, &webview_id, init_script);
```

`sender` is already a reference

Code after:
        clipboard: Option<&mut Clipboard>,
        compositor: &mut IOCompositor,
    ) {
        log::trace!("Verso WebView {webview_id:?} is handling Embedder message: {message:?}",);
        match message {
            EmbedderMsg::HeadParsed(_)
            | EmbedderMsg::WebViewOpened(_)
            | EmbedderMsg::WebViewClosed(_) => {
                // Most WebView messages are ignored because it's done by compositor.
                log::trace!("Verso WebView {webview_id:?} ignores this message: {message:?}")
            }
            EmbedderMsg::WebViewBlurred => {
                self.focused_webview_id = None;
            }
            EmbedderMsg::WebViewFocused(w) => {
                self.focused_webview_id = Some(webview_id);
                self.close_context_menu(sender);
                log::debug!(
                    "Verso Window {:?}'s webview {} has loaded completely.",
                    self.id(),
                    w
                );
            }
            EmbedderMsg::LoadStart(_) => {
                if let Some(init_script) = &self.init_script {
                    let _ = execute_script(sender, &webview_id, init_script);
                }
            }
            EmbedderMsg::LoadComplete(_webview_id) => {
                self.window.request_redraw();
                send_to_constellation(sender, ConstellationMsg::FocusWebView(webview_id));
            }
            EmbedderMsg::ChangePageTitle(_webview_id, title) => {
                if let Some(panel) = self.panel.as_ref() {
                    let title = if let Some(title) = title {
                        format!("'{title}'")
                    } else {
                        "null".to_string()
                    };

                    let script = format!(
                        "window.navbar.setTabTitle('{}', {})",
                        serde_json::to_string(&webview_id).unwrap(),
                        title.as_str()
                    );
                    let _ = execute_script(sender, &panel.webview.webview_id, script);
                }
            }
            EmbedderMsg::AllowNavigationRequest(_webview_id, id, url) => {
                if let Some(to_controller_sender) = to_controller_sender {
                    if self.event_listeners.on_navigation_starting {