IntelliJ Plugin Development | Webview Message Handler Bug

已计划

Hi there,

We have developed company specific plugins and had been using webviews in some cases. Since moving from IntelliJ version 212.5284.40 to 221.6008.13 we have found a bug when attempting to add our own cefQuery handlers to the webviews.

In version 2021 we see that on instantiation of a browser, it creates a client with no handlers.

Now, when we run the same code in version 2022 the webview seems to automatically create a handler and add it to the webviews routers.

This seems to cause issues when using JavaScript cefQueries on the rendered HTML as it will pick up our custom handler intermittently. I think this is due to there being multiple routers attached to the client and the server (IDE) does not know which handler to use.

Currently, this is how we add our handlers to the client. The `WebviewHandler` is a custom class that extends `CefMessageRouterHandlerAdapter`

Since the update from IntelliJ 20221 to 2022, have there been any changes to configuring and/or when adding a handler to a cef client? I have looked at the documentation but couldn't find anything. 

Note: I tried using a newer build of IntelliJ '2022.3' but since this was compiled with Java 17 I couldn't run it. (We only have access to Java 11).

 

Any help would be greatly appreciated :)

Thanks.

0

请先登录再写评论。