From 35234dcceccf6b699eaa825a80c70a1f926e034c Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Wed, 26 Jul 2023 13:19:43 +0200 Subject: [PATCH] web: Ensure we set ourselves as the FSCommand provider --- web/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/lib.rs b/web/src/lib.rs index 3b296da851b3..db29445457cf 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -124,6 +124,7 @@ extern "C" { fn is_virtual_keyboard_focused(this: &JavascriptPlayer) -> bool; } +#[derive(Clone)] struct JavascriptInterface { js_player: JavascriptPlayer, } @@ -558,8 +559,10 @@ impl Ruffle { // Create the external interface. if allow_script_access && allow_networking == NetworkingAccessMode::All { + let interface = Box::new(JavascriptInterface::new(js_player.clone())); builder = builder - .with_external_interface(Box::new(JavascriptInterface::new(js_player.clone()))); + .with_external_interface(interface.clone()) + .with_fs_commands(interface); } let trace_observer = Rc::new(RefCell::new(JsValue::UNDEFINED));