Home > Enterprise >  How does the JetBrains marketplace know the IDE version?
How does the JetBrains marketplace know the IDE version?

Time:03-15

If I open a plugin page on the IntelliJ marketplace, e.g. https://plugins.jetbrains.com/plugin/1236-identifier-highlighter I see a message like:

Not compatible with the version of your running IDE (IntelliJ IDEA xxxx)

How does the website knows which version of IntelliJ is running on my system? I am not logged in, the same behaviour occurs in a private mode tab / different tab.

CodePudding user response:

If you look in the browser development tools' Network tab for that page, you'll see connections being made to http://localhost:port/api/installPlugin on a number of ports (e.g. 63342-63344). I presume it's a range so that if one port is in use, it can move to the next.

If you then run netstat -n -b you'll see that the port that replied successfully is being listened to by idea64.exe, and the response it sends to the web page is a small JSON packet with version information.

So the remotely-loaded Marketplace web page is effectively asking the local copy of IDEA for it's version (using a local HTTP call) and using that information to populate the text of the page!

You can even see this for yourself by trying to open http://localhost:63342/api/installPlugin in a new browser tab (change the port number as needed). For me, IDEA popped up a dialog 'Using REST API / installPlugin API is requested. Do you trust unknown host? / Yes / No' (I presume the Marketplace web page normally adds some headers to suppress this). If I click Yes, then I can see the response JSON version information in the web browser.

  • Related