I'm trying to connect Chrome extension to Java application on MacOS. Using manifest version 2 for testing purposes. My question is this - what should I specify as path inside host manifest file?
host_manifest
{
"name": "...",
"description": "...",
"path": "...", <---- talking about this
"type": "stdio",
"allowed_origins": [
"chrome-extension://.../"
]
}
Since Java is not a native application I think I should specify something like bash file that runs jar file with Java.
start.bash
java -jar "native-messaging-test-1.0-SNAPSHOT-jar-with-dependencies.jar"
Then I specify like this
host_manifest
{
"name": "...",
"description": "...",
"path": "/bunch/of/directories/start.bash", <---- changed to location of start.bash
"type": "stdio",
"allowed_origins": [
"chrome-extension://.../"
]
}
But unfortunately it doesn't work saying: Failed to start native messaging host.. I think my mistake is made here.
Use
.shextension for the Bash file. Make sure the.shfile is executable and write the absolute path to the.shfile in"path"value in the manifest.