Pankaj Shinde
Pankaj Shinde

Reputation: 77

Enable/Disable chrome extension from java desktop application

I have developed a chrome extension which does particular job and tries to connect back to a java desktop application.

Now what I want is, the chrome extension should get enabled only when desktop(java) application is opened and similarly it should get disabled whenever I close the desktop application.

Can I manage this using java?

Or any other way/ CMD is it possible?

Upvotes: 0

Views: 397

Answers (1)

Haibara Ai
Haibara Ai

Reputation: 10897

Basically, you would need some ways to exchange message between extensions and native apps, for this purpose, there are many optional ways, such as Native Messaging, WebSocket, or simple http server/client.

Depends on what you choose to use, the implementation details may differ. However their ideas are similar:

  1. Start the connection from extension and keep the connection for each side
  2. Save a flag in extension side to mark whether your extension should be enabled
  3. Once the connection is lost, revert the flag and disable the functionality of the extension

Upvotes: 1

Related Questions