From 7d11f47b0e84080f121d11f6ba62d41654decd55 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 30 Dec 2024 17:24:06 +0100 Subject: [PATCH] [Web] Fix JavaScriptBridge.create_callback docs Clarify that the callback must take **exactly one array argument**. --- tutorials/platform/web/javascript_bridge.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tutorials/platform/web/javascript_bridge.rst b/tutorials/platform/web/javascript_bridge.rst index b7b3f0e56..d3550b7ac 100644 --- a/tutorials/platform/web/javascript_bridge.rst +++ b/tutorials/platform/web/javascript_bridge.rst @@ -95,9 +95,10 @@ Arguments passed by JavaScript to the callback will be passed as a single Godot .. warning:: - The number of arguments accepted by the callback method (``_my_callback`` in the above example) - **must** match the number of arguments sent by JavaScript. Otherwise, the callback method will - not be called. + Callback methods created via :ref:`JavaScriptBridge.get_interface() ` + (``_my_callback`` in the above example) **must** take exactly one :ref:`Array` + argument, which is going to be the JavaScript `arguments object `__ + converted to an array. Otherwise, the callback method will not be called. Here is another example that asks the user for the `Notification permission `__ and waits asynchronously to deliver a notification if the permission is