Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Native Messaging using Executable Jar file

I have created a Chrome extension with the nativeMessaging permission added to the manifest.

I am opening a port to the native messaging host.

The manifest for my native messaging host points to an executable jar file.

When I launch my extension, there are no errors, the connection seems fine, but the code in my jar file never seems to run. (For testing I show a new JFrame that is created in the main() method. When double-clicking the jar file it shows the JFrame. But when running the jar file via Chrome Native Messaging, the JFrame doesn't show up.

Is there something I am missing?

like image 438
Anthony Tietjen Avatar asked Sep 23 '26 13:09

Anthony Tietjen


2 Answers

do you have uppercase letters in your mainfest name ? i had this issue+same symptoms and this fixed it for me (although i get a different error now)

{ "name": "com.google.chrome.example.echoUppercase", <- wont work ....

"name": "com.google.chrome.example.echouppercase", <- works }

like image 155
Oliver Renner Avatar answered Sep 26 '26 05:09

Oliver Renner


I managed to get it to work by letting chrome start a bat file with the following content:

@echo off
java -jar your_file.jar %*

The echo off was a detail which took me some time to figure out.

like image 22
ChristopherS Avatar answered Sep 26 '26 03:09

ChristopherS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!