chrome-native-messaging

Chrome native messaging: can I stream a MediaStream to a native program?

喜你入骨 提交于 2019-12-10 10:58:45
问题 I am writing a web application which needs to show a native window in the host window system. That window must display a video which is being streamed to the web application. I have written a native program for OS X which displays a video in the way I need, and in the web application I have a MediaStream being sent via WebRTC. I need to connect these together. I would like to use Chrome's native messaging, which lets me stream JSON objects to a native program. If I can access the raw data

connectNative disconnects by itself in Chrome extension

∥☆過路亽.° 提交于 2019-12-10 09:54:19
问题 I did write a chrome extension. My content script send some data to by background.js . And my background.js shell forward this data to a local C++ app. Now what happens is, my background.js can connect to the local app and send data once. But then, the connection is lost as the disconnect event occurs and a second send request fails. Reading the documentation of connectNative it says, connection is closed, if the disconnect is called or "when the page containing the port is unloaded" . I don

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

我怕爱的太早我们不能终老 提交于 2019-12-09 23:47:50
问题 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? 回答1: Updated answer: So as pointed out in comments, it does obviously use

how to use NativeMessaging to connect to a native application(.exe) ,but don't launch the .exe,just send the message background

廉价感情. 提交于 2019-12-08 06:07:23
问题 enerytime when i click the "send" button(blind the NativeMessaging method),it will launch a new instance , i just want make it only one instance with the connect running correctly,sot that i can send message sustainable. Thanks a lot! That's my background.js code: var port = null; console.log("visited test!"); chrome.runtime.onMessage.addListener( function (request, sender, sendResponse) { if (request.type == "launch") { console.log("visited 333!"); connectToNativeHost(request.message); }

How to run Native Messaging example on Microsoft Edge?

孤街浪徒 提交于 2019-12-07 23:49:17
问题 I want to run SecureInput example but after I built and deployed NativeMessagingInProcess project, Extension loaded on Edge but secureinput.html file don't load content.js file. And, I checked on regedit, nothing isn't added. Did I do anything wrong? This's very different from Chrome and Firefox Native messaging extension. 回答1: Have you hosted secureinput.html in a web server? Have you run it on Windows 10 insider preview build? According to Microsoft Edge extension API roadmap, Native

how to use NativeMessaging to connect to a native application(.exe) ,but don't launch the .exe,just send the message background

亡梦爱人 提交于 2019-12-07 15:07:30
enerytime when i click the "send" button(blind the NativeMessaging method),it will launch a new instance , i just want make it only one instance with the connect running correctly,sot that i can send message sustainable. Thanks a lot! That's my background.js code: var port = null; console.log("visited test!"); chrome.runtime.onMessage.addListener( function (request, sender, sendResponse) { if (request.type == "launch") { console.log("visited 333!"); connectToNativeHost(request.message); } return true; }); // chrome.runtime.onMessage.addListener(function(msg) { // console.log("Received" + msg

How to run Native Messaging example on Microsoft Edge?

删除回忆录丶 提交于 2019-12-06 14:34:18
I want to run SecureInput example but after I built and deployed NativeMessagingInProcess project, Extension loaded on Edge but secureinput.html file don't load content.js file. And, I checked on regedit, nothing isn't added. Did I do anything wrong? This's very different from Chrome and Firefox Native messaging extension. Have you hosted secureinput.html in a web server? Have you run it on Windows 10 insider preview build? According to Microsoft Edge extension API roadmap , Native Messaging APIs are supported only on build 15002 and above version. I guess Native messaging works with using

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

只愿长相守 提交于 2019-12-06 13:44:37
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='{"message": "'$c'"}' # Calculate the byte size of the string. # NOTE: This assumes that byte length is

Debugging Chrome native messaging

有些话、适合烂在心里 提交于 2019-12-06 13:04:34
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) ((len>>24) & 0xFF)); // Now we can output our message printf("%s", message); return 0; } The problem is

Chrome native messaging: can I stream a MediaStream to a native program?

自古美人都是妖i 提交于 2019-12-06 07:59:05
I am writing a web application which needs to show a native window in the host window system. That window must display a video which is being streamed to the web application. I have written a native program for OS X which displays a video in the way I need, and in the web application I have a MediaStream being sent via WebRTC. I need to connect these together. I would like to use Chrome's native messaging, which lets me stream JSON objects to a native program. If I can access the raw data stream from the MediaStream , I should be able to transform this into JSON objects, stream those to the