File tree Expand file tree Collapse file tree 3 files changed +268
-60
lines changed
src/features/web-viewer/components Expand file tree Collapse file tree 3 files changed +268
-60
lines changed Original file line number Diff line number Diff line change @@ -284,3 +284,32 @@ pub async fn set_webview_visible(
284284 }
285285 Ok ( ( ) )
286286}
287+
288+ #[ command]
289+ pub async fn open_webview_devtools (
290+ app : tauri:: AppHandle ,
291+ webview_label : String ,
292+ ) -> Result < ( ) , String > {
293+ if let Some ( webview) = app. get_webview ( & webview_label) {
294+ webview. open_devtools ( ) ;
295+ Ok ( ( ) )
296+ } else {
297+ Err ( format ! ( "Webview not found: {webview_label}" ) )
298+ }
299+ }
300+
301+ #[ command]
302+ pub async fn set_webview_zoom (
303+ app : tauri:: AppHandle ,
304+ webview_label : String ,
305+ zoom_level : f64 ,
306+ ) -> Result < ( ) , String > {
307+ if let Some ( webview) = app. get_webview ( & webview_label) {
308+ webview
309+ . set_zoom ( zoom_level)
310+ . map_err ( |e| format ! ( "Failed to set zoom: {e}" ) ) ?;
311+ Ok ( ( ) )
312+ } else {
313+ Err ( format ! ( "Webview not found: {webview_label}" ) )
314+ }
315+ }
Original file line number Diff line number Diff line change @@ -343,6 +343,8 @@ fn main() {
343343 navigate_embedded_webview,
344344 resize_embedded_webview,
345345 set_webview_visible,
346+ open_webview_devtools,
347+ set_webview_zoom,
346348 // File watcher commands
347349 start_watching,
348350 stop_watching,
@@ -435,6 +437,14 @@ fn main() {
435437 ensure_runtime,
436438 get_runtime_status,
437439 get_runtime_version,
440+ get_js_runtime,
441+ get_all_runtime_statuses,
442+ // Tool commands
443+ install_language_tools,
444+ install_tool,
445+ get_language_tool_status,
446+ get_tool_path,
447+ get_available_tools,
438448 // Menu commands
439449 menu:: toggle_menu_bar,
440450 menu:: rebuild_menu_themes,
You can’t perform that action at this time.
0 commit comments