chrome-native-messaging

chrome native messaging: how to receive > 1MB

匆匆过客 提交于 2021-02-07 18:46:17
问题 What would be a good way to work with Chrome's incoming 1MB limit for native messaging extensions? The data that we would be sending to the extension is json-serialized gpx, if that matters. When the original message is >1MB, it seems like this question really has two parts: how to partition the data on the sending end (i.e. the client) this part should be pretty trivial. Even if we need to split into separate self-contained complete gpx strings, that is pretty straightforward. how to join

Chrome App fails to communicate with native host on windows

孤街浪徒 提交于 2021-02-07 14:55:00
问题 I have written a chrome app and a native messaging host in Java. The combo works fine on linux. However when I try to port the combo to windows the communication can not be established. The jar where the host is contained is exactly the same as the linux variant. I am using the following script (start.bat) to start the Java host: @echo off java -jar "%~dp0theHost.jar" The json manifest is as follows: { "name": "com.service.host", "description": "Native messaging host", "path": "start.bat",

Chrome App fails to communicate with native host on windows

若如初见. 提交于 2021-02-07 14:54:18
问题 I have written a chrome app and a native messaging host in Java. The combo works fine on linux. However when I try to port the combo to windows the communication can not be established. The jar where the host is contained is exactly the same as the linux variant. I am using the following script (start.bat) to start the Java host: @echo off java -jar "%~dp0theHost.jar" The json manifest is as follows: { "name": "com.service.host", "description": "Native messaging host", "path": "start.bat",

Chrome Native Messaging — Why am I receiving a “Specified native messaging host not found” error?

戏子无情 提交于 2020-01-24 23:27:00
问题 According to the Chrome Native Messaging docs a successful call to connectNative() returns a port, with which you can post messages to a native app (a Mac app). In my case nativeConnect() does return a valid port in my case, but a call to onDisconnected() listener is fired almost immediately. Whenever the listener is fired it prints the "lastError" property to the browser's console, and this gives: Specified native messaging host not found. Why is it doing this? The listener that produces the

Chrome Native Messaging — Why am I receiving a “Specified native messaging host not found” error?

隐身守侯 提交于 2020-01-24 23:26:40
问题 According to the Chrome Native Messaging docs a successful call to connectNative() returns a port, with which you can post messages to a native app (a Mac app). In my case nativeConnect() does return a valid port in my case, but a call to onDisconnected() listener is fired almost immediately. Whenever the listener is fired it prints the "lastError" property to the browser's console, and this gives: Specified native messaging host not found. Why is it doing this? The listener that produces the

What is Native Messaging between applications and how does it work?

时光总嘲笑我的痴心妄想 提交于 2020-01-22 12:29:25
问题 The Chrome developer docs refer to something called Native Messaging to communicate with other desktop applications directly from the Chrome extension or app. How can I tell when a desktop app has such native messaging available and what kind of communication it can accept? Is there a way to get the application to expose what it will communicate about? If I needed to talk to the original developers of that desktop app, is this even the most common terminology (native messaging) so they

Debugging Chrome native messaging

我与影子孤独终老i 提交于 2020-01-14 02:49:10
问题 I am a beginner in developing Chrome extensions. I am trying to achieve a native messaging between my extension and a C++ code. Here is the C++ code int main(int argc, char* argv[]) { // Define our message char message[] = "{\"text\": \"This is a response message\"}"; // Collect the length of the message unsigned int len = strlen(message); // We need to send the 4 bytes of length information printf("%c%c%c%c", (char) (len & 0xff), (char) ((len>>8) & 0xFF), (char) ((len>>16) & 0xFF), (char) (

Debugging Chrome native messaging

折月煮酒 提交于 2020-01-14 02:49:09
问题 I am a beginner in developing Chrome extensions. I am trying to achieve a native messaging between my extension and a C++ code. Here is the C++ code int main(int argc, char* argv[]) { // Define our message char message[] = "{\"text\": \"This is a response message\"}"; // Collect the length of the message unsigned int len = strlen(message); // We need to send the 4 bytes of length information printf("%c%c%c%c", (char) (len & 0xff), (char) ((len>>8) & 0xFF), (char) ((len>>16) & 0xFF), (char) (