chrome-native-messaging

Chrome native messaging cannot execute batch file

笑着哭i 提交于 2019-12-23 04:57:25
问题 Here is the manifest of my host : { "allowed_origins" : [ "chrome-extension://EXTENSION_ID/" ], "description" : "my.app.host", "name" : "my.app.host", "path" : "‪C:\\chromejar\\launch.bat", "type" : "stdio" } Here is the content of my launch.bat file : setlocal enableextensions disabledelayedexpansion for %%a in ("%~dp0\ChromeConnector.jar") do set "JARFILE=%%~fa" java -jar "%JARFILE%" pause When I launch my Batch file separately, it works. When I launch my extension from my website using an

How to parse JSON from stdin at Chrome Native Messaging host?

喜你入骨 提交于 2019-12-22 18:11:04
问题 Related: How to parse JSON from stdin at Native Messaging host? Utilizing the code at How do I use a shell-script as Chrome Native Messaging host application to send JSON from client (app) to host #!/bin/bash # Loop forever, to deal with chrome.runtime.connectNative while IFS= read -r -n1 c; do # Read the first message # Assuming that the message ALWAYS ends with a }, # with no }s in the string. Adopt this piece of code if needed. if [ "$c" != '}' ] ; then continue fi # do stuff message='{

What is causing an “Error connecting to native app” when connecting to a native host application with connectNative() in a Chrome extension?

时光怂恿深爱的人放手 提交于 2019-12-22 09:51:46
问题 I am implementing communication between a web page and a Mac application using Chrome's Native Messaging feature. All seems to go well until I make the javascript call to chrome.runtime.connectNative("my_native_host_app_name"), which produces the following error in the console: Error in event handler for runtime.onMessageExternal: Error connecting to native app: com.allinlearning.nmhforbrowserextension Stack trace: Error: Error connecting to native app: com.allinlearning

connection breaks after a while between native-app and chrome-extension

懵懂的女人 提交于 2019-12-22 09:12:03
问题 I am using chrome native messaging api to communicate between my chrome-extension and native-windows-app which is written in c++. The connection establishes finely and data also gets exchanged. But the connection breaks after random number of calls are made from extension to the native-app. I tried running native-app independently and it works fine when run in an infinite loop(no exceptions occur). My native-app generates almost 300KB of data at first call( encode_frame() ) and then

Native app does not work in Chrome extension

天涯浪子 提交于 2019-12-22 01:05:10
问题 I am trying Chrome Native Messaging API for Chrome extension. Manifest.json for native app: { "name": "app.native", "description": "Native Message API Test.", "path": "native.exe", "type": "stdio", "allowed_origins": ["chrome-extension://kembignchdjhopkkcolnamikcenaocdm/"] } Windows Registry value: HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\app.native=D:\connectNative\manifest.json I also tried D:\\\\connectNative\\\\manifest.json And I add "nativeMessaging" to

Windows Chrome extension native messaging can only receive the first response

醉酒当歌 提交于 2019-12-22 00:51:12
问题 I am trying to use native messaging to send some data to my native windows application. It works well with the runtime.sendNativeMessage() method. When I am trying to use long lived connections which uses a port, it also can pass data from chrome to my app. However, chrome extension can only receive the first response from my app. I am sure that the port is still open because my app can still receive data from chrome. Following are my code: Chrome Extension Script: var port = chrome.runtime

chrome.runtime.connectNative generates Uncaught TypeError: undefined is not a function

喜欢而已 提交于 2019-12-21 08:24:34
问题 I did write an chrome extension that calls this connect() function to connect to a local C++ program: function connect() { console.log("test1"); //port = chrome.extension.connectNative('com.a.chrome_interface'); port = chrome.runtime.connectNative('com.a.chrome_interface'); port.onMessage.addListener(onNativeMessage); port.onDisconnect.addListener(onDisconnected); console.log("test5"); } I can see the test1 in the Console, but afterwards I got the error Uncaught TypeError: undefined is not a

Chrome native messaging doesn't accept messages of certain sizes (Windows)

被刻印的时光 ゝ 提交于 2019-12-19 10:17:40
问题 I'm developing a Chrome extension working with native messaging host. It works in most cases, but I have found a strange behavior when I send messages of certain sizes. It seems that message is dropped, when the size is between 2560 and 2815 bytes (A00 and AFF in hex). All subsequent messages are also not arriving, which suggests that the stream is corrupted for some reason. Here is a stripped down Python native messaging app, which can be used to test it: import sys import struct def output

Use 'Chrome Native Messaging' from Sublime Text plugin

柔情痞子 提交于 2019-12-18 04:23:17
问题 With 'Native Messaging' it should be possible to communicate between a chrome extension and a native app. https://developer.chrome.com/extensions/nativeMessaging Google even provides an example for how to do this with a python "host"-app: https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/docs/examples/api/nativeMessaging/host/native-messaging-example-host I wanted to use this technique to communicate between a Sublime Text plugin (python) and an Chrome extension

Native Messaging Chrome

谁都会走 提交于 2019-12-17 18:43:27
问题 I am trying to get Native Messaging between my chrome extension and my c# application. The javascript works fine, but I am getting this error: Error when communicating with the native messaging host. The application does get launched along with the extension, as I saw from Task Manager. Here is my c# code. private static string OpenStandardStreamIn() { //// We need to read first 4 bytes for length information Stream stdin = Console.OpenStandardInput(); int length = 0; byte[] bytes = new byte