chrome-native-messaging

Native Messaging Chrome

浪尽此生 提交于 2019-11-28 08:42:50
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[4]; stdin.Read(bytes, 0, 4); length = System.BitConverter.ToInt32(bytes, 0); string input = ""; for

Very Slow to pass “large” amount of data from Chrome Extension to Host (written in C#)

不问归期 提交于 2019-11-28 01:41:18
I am using Chrome's Native Messaging API to pass the DOM of a page to my host. When I try passing a small string from my extension to my host, everything works, but when I try to pass the entire DOM (which isn't that large...only around 260KB), everything runs much slower and I eventually get a Native host has exited error preventing the host from responding. My main question: Why does it take so long to pass a 250KB - 350KB message from the extension to the host? According to the developer's site : Chrome starts each native messaging host in a separate process and communicates with it using

communication between native-app and chrome-extension

夙愿已清 提交于 2019-11-27 21:41:42
I have a native app written in c++ and a chrome-extension. I am communicating between them using 'chrome native messaging'. Native-App code: int main(int argc, char* argv[]) { unsigned int a, c, i, t=0; std::string inp; do { inp=""; t=0; // Sum the first 4 chars from stdin (the length of the message passed). for (i = 0; i <= 3; i++) { t += getchar(); } // Loop getchar to pull in the message until we reach the total // length provided. for (i=0; i < t; i++) { c = getchar(); inp += c; } // Collect the length of the message unsigned int len = inp.length(); //// We need to send the 4 btyes of

How do I use a shell-script as Chrome Native Messaging host application

送分小仙女□ 提交于 2019-11-27 14:31:35
How do you process a Chrome Native Messaging API-call with a bash script? I succeeded in doing it with python with this example Sure I can call bash from the python code with subprocess , but is it possible to skip python and process the message in bash directly? The problematic part is reading the JSON serialized message into a variable. The message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order through stdin. echo $* only outputs: chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/ Also something like read echo $REPLY doesn't output

launch my installed application from chrome browser

时光总嘲笑我的痴心妄想 提交于 2019-11-27 07:29:00
问题 My requirement is to launch my installed application from chrome browser if it is installed on client machine, If not installed then I wanted to start download. What is best recommended solution for chrome? So fare i tried following used NPAPI, but due to deprecation of NPAPI by chrome I can't use. Checked PNacl and Pepper API both API not providing access to local file system to launch an application. They just port my C/C++ code in browser and run it in browser environment with sandbox

Native messaging from chrome extension to native host written in C#

无人久伴 提交于 2019-11-27 07:22:21
问题 I'm trying to receive a message from my chrome extension via native messaging. The popup.html console indicates that the message is being sent, but my host is not receiving it for some reason. I can see that the host native.exe is being launched in task manager, but the host is not receive the sent data. popup.js document.addEventListener('DOMContentLoaded', function() { var downloadButton= document.getElementById('Button'); downloadButton.addEventListener('click', function () { chrome.tabs

C# native host with Chrome Native Messaging

不羁岁月 提交于 2019-11-27 03:54:06
I spent a few hours today researching how to get Chrome native messaging working with a C# native host. Conceptually it was quite simple, but there were a few snags that I resolved with help (in part) from these other questions: Native Messaging Chrome Native messaging from chrome extension to native host written in C# Very Slow to pass "large" amount of data from Chrome Extension to Host (written in C#) My solution is posted below. itslittlejohn Assuming the manifest is set up properly, here is a complete example for talking to a C# host using the "port" method: using System; using System.IO;

Chrome Extension NativeMessaging 'connectNative' undefined

蓝咒 提交于 2019-11-27 03:05:50
问题 I am trying to implement a chrome extension using runtime.connectNative and postMessage. I am following the chrome documentation, downloaded the native messaging example which I'm trying to run without any changes, while the code for the native host application can be found here. However, I'm getting the error: Uncaught TypeError: Cannot read property 'connectNative' of undefined. The error is being triggered from the javascript extension file, in this line: port = chrome.runtime

communication between native-app and chrome-extension

╄→尐↘猪︶ㄣ 提交于 2019-11-26 20:44:39
问题 I have a native app written in c++ and a chrome-extension. I am communicating between them using 'chrome native messaging'. Native-App code: int main(int argc, char* argv[]) { unsigned int a, c, i, t=0; std::string inp; do { inp=""; t=0; // Sum the first 4 chars from stdin (the length of the message passed). for (i = 0; i <= 3; i++) { t += getchar(); } // Loop getchar to pull in the message until we reach the total // length provided. for (i=0; i < t; i++) { c = getchar(); inp += c; } //

How do I use a shell-script as Chrome Native Messaging host application

拥有回忆 提交于 2019-11-26 16:46:41
问题 How do you process a Chrome Native Messaging API-call with a bash script? I succeeded in doing it with python with this example Sure I can call bash from the python code with subprocess , but is it possible to skip python and process the message in bash directly? The problematic part is reading the JSON serialized message into a variable. The message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order through stdin. echo $* only outputs: