Interaction between JBCefBrowser JavaScript and Kotlin code

Answered

Hello, I am working on an IntelliJ plugin where I would like to render a graph in a webview which is part of a ToolWindow. I am using the JBCefBrowser for this, and I managed to initiate this browser with some static HTML. However ideally I want interactions between the browser it's JavaScript runtime, and my Kotlin plugin. For instance when I click on a button in the browser, I want to handle this by my Kotlin runtime to do open a certain file within the IDE. The other way around I might want to send some data from my Kotlin runtime into my JavaScript runtime. On internet I couldn't really find any good suggestions on how I could achieve this, would really appreciate if someone has some tips or recommendations.

0
1 comment

Hi Ramon,

Did you get familiar with this section? https://plugins.jetbrains.com/docs/intellij/jcef.html#executing-plugin-code-from-javascript

If it doesn't help, please describe your problem in more detail.

0

Please sign in to leave a comment.