Interacting with IntelliJ through Chrome (Plugin Dev)

Note: I realized after the fact that this thread would have been more suitable for the "Open API and Plugin Development" forum. I can't seem to find a way to move it there. My apologies.



Hello

Through IntelliJ UE 14, I open up an HTML file in a browser, which takes me to a page like http://localhost:63342/RFTests/SmokeTest.html . I'm wondering if IntelliJ provides any mechanism through which a Chrome extension (or any browser plugin,) could interact with it (possibly through the port in the opened URL)? I have developed an IntelliJ plugin, and it would be great if I could pass in some contextual information from a right-click in Chrome to this plugin to perform some task.

Is this possible?

If so, can someone point me to more detailed documentation (for the IntelliJ-side of things.)

Thanks,
-- Cam

Edit: Clarified that I developed an IntelliJ plugin (as opposed to a Chrome extension.)

0

Actually, I'm presuming my IntelliJ plugin could open its own port. The Chrome extension could then communicate with it over this port to kick off some task.

0

Hello. Please see https://confluence.jetbrains.com/display/IDEADEV/Remote+communication.

Your Chrome extension could communicate using websocket or http. As far I understood you, I recommend you http.

1) Create your implementation of https://github.com/JetBrains/intellij-community/blob/master/platform/built-in-server-api/src/org/jetbrains/ide/HttpRequestHandler.java (it is extension point).
2) From your chrome extension perform request using XMLHttpRequest (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest).

0

请先登录再写评论。