chrome-native-messaging

C# native host with Chrome Native Messaging

南楼画角 提交于 2019-12-17 06:36:47
问题 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. 回答1: Assuming the manifest is set up properly, here is a

Chrome Native Messaging throwing error when sending a base64 string to client

时光总嘲笑我的痴心妄想 提交于 2019-12-16 18:04:42
问题 Using Chrome Native Messaging sample app as a template am able make a system call to bash os.system("<bash command>") The requirement is to return a base64 string from the python script os.system("<bash command that returns a base64 string>") which can verify returns expected result at terminal . However, when adjust the code at native-messaging-example-host at lines 97-98 to dataurl = os.system("<bash command that returns a base64 string>") text = '{"text": "' + dataurl + '"}' the

Where to register the Native Messaging Host in Chrome OS

二次信任 提交于 2019-12-13 01:00:00
问题 In this documentation there's the location for Windows, Mac OS and Linux. I assumed Chrome OS would work the same as "standard" linux, but i couldnt get my app working ... com.my_app.host.json (located in /etc/opt/chrome/native-messaging-hosts/) { "name": "com.my_app.host", "description": "My Host", "path": "/home/user/bfd93db2180e0d7645b1f4cce2d2c7ed9e0d835c/Downloads/host.sh", "type": "stdio", "allowed_origins": [ "chrome-extension://APP_ID/" ] } main.js var port = null; var getKeys =

ffmpeg from chrome native messaging host app not working

两盒软妹~` 提交于 2019-12-12 01:43:59
问题 OK, this is what I got, I'm using native messaging to fire a c++ program from a chrome extension in Windows. This c++ program (ehost.exe) creates a ffmpeg process for recording the input audio and saving it to mp3. I do this with the CreateProcess() function This works perfect when I open ehost.exe myself (double clicking it) but when I open it from my chrome extension ( chrome.runtime.connectNative() ), the ffmpeg process opens but ffmpeg writes no output file, as if it didn't have

Close Native Host when Chrome is closed by the user

旧时模样 提交于 2019-12-11 17:57:47
问题 I am working on a Chrome extension that uses a C++ Native Host. In a background.js script (persistent set to false), using chrome.onstartup event, I create the connection to the C++ Host. I want my Host to be running for as long as the user is actively using Chrome. If I close all my current Chrome tabs, independent Chrome processes still appear in the "Background section" of the Task Manager (including my Host process that must be explicitly killed). I understood that the user can configure

Receiving native messages from Chrome in Java

大兔子大兔子 提交于 2019-12-11 10:57:26
问题 I am trying to get native messaging between a chrome extension and a Java program to work. After some struggling I now can open my Java program with: var port = chrome.extension.connectNative('fbehost'); port.postMessage({ text: "Hello, my_application" }); But I don't know how I can read the message send from my extension. I created a program which opens a simple JFrame with a textarea. As it says in the documentation that native messaging communicates with stdin and stdout, I tried to get

Chrome extension native messaging got error:“Specified native messaging host not found.”

此生再无相见时 提交于 2019-12-11 08:24:06
问题 My platform OS is win 7. I started to write extension and try to communicate with C++ app. Here is manifest of my app: (xxx is my extension id) { "name": "com.google.chrome.testc", "path": "D:\\testC\\debug\\testC.exe", "description": "My Application", "type": "stdio", "allowed_origins": [ "chrome-extension://xxx/" ] } And I also add registry key at: HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts: "com.google.chrome.testc: D:\testC\debug\manifest.json" But when extension

Failed to start native messaging host on Windows, “COMSPEC is not set”

╄→гoц情女王★ 提交于 2019-12-11 05:59:44
问题 I have a chrome extension that communicates with a native messaging host to get some data. The issue is, when I launch the Chrome browser via the shortcut or via the pinned shortcut in the taskbar, the extension is not able to connect to the host. I always get the error: Failed to start native messaging host. However, if I launch the chrome.exe via command prompt, everything works fine. Things I tried with no success: The taskbar shortcut has no extra flags. The target field has the following

Chrome extension Native messaging synchronization

我是研究僧i 提交于 2019-12-10 17:43:49
问题 I have problem with Native messaging synchronization on windows. I am trying to synchronize the message between backgroundPage and hostApp. normally, we use native messaging like this: //popup.js function appendMessage(text) { document.getElementById('response').innerHTML += "<p>" + text + "</p>"; } function sendNativeMessage() { message = {"command": document.getElementById('input-text').value}; port.postMessage(message); appendMessage("Sent message: <b>" + JSON.stringify(message) + "</b>");

Native messaging to .NET application on Windows

核能气质少年 提交于 2019-12-10 15:53:59
问题 I followed the native messaging documentation to the best of my abilities, but can't seem to get my native .NET application to even start running on Windows. While looking for additional information, I noticed some things are undocumented and unclear. First off, the documentation does not mention the requirement of adding the "nativeMessaging" permission. After changing this I got a bit further; Chrome actually mentions "New background app added" in a balloon popup now. However, the following