chrome-native-messaging

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

依然范特西╮ 提交于 2019-12-06 01:56:57
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.nmhforbrowserextension at Object.<anonymous> (extensions::runtime:189:11) at Function.target.(anonymous function)

How to send message FROM Chrome extension TO Native app?

只愿长相守 提交于 2019-12-05 06:05:45
问题 I have a native-app written in c++. I am able to send data from my native-app to chrome extension using How to send message FROM native app TO Chrome extension? But I am unable to figure out the other way. Chrome doc. states : Chrome starts each native messaging host in a separate process and communicates with it using standard input (stdin) and standard output (stdout). The same format is used to send messages in both directions: each message is serialized using JSON, UTF-8 encoded and is

Can i embed program through native messaging in Chrome (like old npapi plugins)?

故事扮演 提交于 2019-12-04 19:17:59
Is it possible to create Chrome extension which can embed a program into Chrome? I mean something like old NPAPI plugins such as VLC player, java, etc... I found some native messaging examples, but every example is only for sending simple messages to control an external program. But for example IE Tab is using native messaging and their IE tab engine is running inside in Chrome... or does IE Tab use something else? Updated answer: So as pointed out in comments, it does obviously use native messaging; what I can't figure out is what they are doing. The project claims to be open source (and GPL)

Native Messaging host tried sending a message that is 977472013 bytes long

佐手、 提交于 2019-12-04 06:36:54
问题 I'm using a java jar to send and receive messages using Chrome Native Messaging. I enabled logging of Chrome so I could read C:\Users\%UserName%\AppData\Local\Google\Chrome\User Data\chrome_debug.log file I'm actually unable to send or receive message with my Java app, but I know it is used. Here is the manifest of my host : { "allowed_origins" : [ "chrome-extension://EXTENSION-ID/" ], "description" : "my.app", "name" : "my.app", "path" : "launch.bat", "type" : "stdio" } Here is content of

Chrome Extension - Message Passing to batch file

蹲街弑〆低调 提交于 2019-12-04 04:51:12
问题 I used the sample project https://developer.chrome.com/extensions/samples I am able to run the python native app. Is there any way to get the message within native-messaging-example-host.bat I don't want to load python script What I want to do here is send message from chrome {text: "xyz.bat"} and the batch file should run START xyz.bat 回答1: You should not approach this problem from the batch file standpoint, as in lieu of my solution, it requires the program to be run upfront, which in most

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

落花浮王杯 提交于 2019-12-04 02:21:46
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 function in the line port = chrome.runtime.connectNative('com.a.chrome_interface'); My extensions

Native app does not work in Chrome extension

纵然是瞬间 提交于 2019-12-03 23:10:12
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 "permissions" in Chrome extension manifest.json. Native app cpp: #include <iostream> #include <string> #include

How to send message FROM Chrome extension TO Native app?

流过昼夜 提交于 2019-12-03 21:43:11
I have a native-app written in c++. I am able to send data from my native-app to chrome extension using How to send message FROM native app TO Chrome extension? But I am unable to figure out the other way. Chrome doc. states : Chrome starts each native messaging host in a separate process and communicates with it using standard input (stdin) and standard output (stdout). The same format is used to send messages in both directions: each message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order. how do I read/interpret data from stdin, sent

Chrome native host in C++, cannot communicate with Chrome

丶灬走出姿态 提交于 2019-12-03 09:47:48
问题 I am trying to implement a Chrome extension using runtime.connectNative and postMessage . I am following the Chrome documentation, downloaded the native messaging example, and changed the native app to using C++. However, the native app cannot receive the message from the Chrome extension. Meanwhile, when the native app using the printf function write message to chrome extension, the extension can not receive and the message just shown in the console. Any ideas how to solve the problem? 回答1:

Similar technology to Chrome's Native Client Messaging in Firefox?

廉价感情. 提交于 2019-12-03 03:53:48
问题 We want to replace a custom NPAPI interface between a browser based web application and an client side daemon process. Is there a similar technology to Chrome's Native Client Messaging in Firefox? 回答1: js-ctypes[1] is probably the closest alternative for Mozilla. https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes I have a C++ module that I compile as a binary executable for native-messaging or as a library for js-ctypes. The difference between the two is primarily that native