Using custom JS event handler inside Gradio

271 Views Asked by At

I have a Gradio chatbot app exposed through the iframe. The main application component is the new Gradio ChatInterface. I want to pass some sensitive data from the parent app using postMessage API (example here).

Gradio documentation specifies how to add a custom js, triggered by a component event, but only some helper methods, and I need to:

  1. Set up an event listener on load of the app or on a click of a button
  2. Pass the data from the event listener into the python code so I can use it
0

There are 0 best solutions below