diff --git a/libraries/ui/src/ui/TabletScriptingInterface.h b/libraries/ui/src/ui/TabletScriptingInterface.h index 04222b3ea1..3f834cab40 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.h +++ b/libraries/ui/src/ui/TabletScriptingInterface.h @@ -422,6 +422,12 @@ public: *
EventBridge.scriptEventReceived.connect(function(message) {
* ...
* });
+ * Warning: The EventBridge
object is not necessarily set up immediately ready for the web
+ * page's script to use. A simple workaround that normally works is to add a delay before calling
+ * EventBridge.scriptEventReceived.connect(...)
. A better solution is to periodically call
+ * EventBridge.scriptEventReceived.connect(...)
and then EventBridge.emitWebEvent(...)
to send a
+ * message to the Interface script, and have that send a message back using emitScriptEvent(...)
; when the
+ * return message is received, the EventBridge
is ready for use.