chrome-native-messaging

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

人盡茶涼 提交于 2019-12-03 00:14:18
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? dbajgoric You didn't provide a lot information about what you actually tried, so I will do my best to

Asynchronous webRequest.onBeforeRequest URL inspection using Firefox native messages

非 Y 不嫁゛ 提交于 2019-12-02 16:08:09
问题 I'm trying to create URL inspector using Firefox native messages. The problem is, when native application sends a verdict, onBeforeRequest listener already released request, thus redirection doesn't happen. Can you please help to make my extension wait for reply for up to 2 seconds and redirect the request if answer is "0"? var port = browser.runtime.connectNative("ping_pong"); function inspectURL(requestDetails) { console.log("Loading: <" + requestDetails.url + ">"); port.postMessage

Asynchronous webRequest.onBeforeRequest URL inspection using Firefox native messages

蓝咒 提交于 2019-12-02 07:37:58
I'm trying to create URL inspector using Firefox native messages. The problem is, when native application sends a verdict, onBeforeRequest listener already released request, thus redirection doesn't happen. Can you please help to make my extension wait for reply for up to 2 seconds and redirect the request if answer is "0"? var port = browser.runtime.connectNative("ping_pong"); function inspectURL(requestDetails) { console.log("Loading: <" + requestDetails.url + ">"); port.postMessage(requestDetails.url); console.log("Posting complete <" + requestDetails.url + ">"); } port.onMessage

Security of native messaging?

限于喜欢 提交于 2019-12-01 12:57:45
I have a NPAPI plugin for sign-in data on website. I want to replace it by Native Messaging technology. I have read the documentation, but I have a question : Is this technology safe? Can hackers catch data in transfer from JavaScript to native host app and back? Edit: merging in a better-worded question: How secure is stdio data transfer ? Is there a way for man-in-middle attack for such data transfer ? It is, in principle, possible to inspect stdio calls made by an executable. For instance, on Linux systems, you can use strace for that purpose. I don't know a similar Windows tool, but it's

Connecting chrome native messages to a existing instance on windows

痞子三分冷 提交于 2019-12-01 10:53:54
问题 I have a created a chrome background script and a host using python run by executing a bat file which is linked in the "manifest". Everything kinda works but as far as I understand every time I connect to host with my chrome extension for native messaging I create the python instance and execute the code. But is it possible to connect to a existing instance(for example I execute a python script) and view the output? I hope my question is understandable. I also do not understand why when I

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

两盒软妹~` 提交于 2019-12-01 10:34:53
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(message): encoded_message = message.encode('utf-8') # Write message size. sys.stdout.write(struct.pack(

Java native messaging with chrome extension - cannot correctly write length

谁说胖子不能爱 提交于 2019-11-30 15:22:44
I'm currently writing a Java program that communicates with a Chrome extension. I need to implement the Chrome native messaging protocol in order to communicate. The Google Chrome docs say: ... each message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order. ( Source ) I tried to implement this in Java, but I have problems when my messages have a certain length, even though my implementation should be correct. Here is my current implementation, based on earlier SO-answers & questions( here for example): // read the message size from Chrome.

Java native messaging with chrome extension - cannot correctly write length

拥有回忆 提交于 2019-11-29 21:56:41
问题 I'm currently writing a Java program that communicates with a Chrome extension. I need to implement the Chrome native messaging protocol in order to communicate. The Google Chrome docs say: ... each message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order. (Source) I tried to implement this in Java, but I have problems when my messages have a certain length, even though my implementation should be correct. Here is my current

JavaScript syncronicity: Combining onAuthRequired Listener and native massaging

不打扰是莪最后的温柔 提交于 2019-11-29 18:37:39
I have this problem ... and I've been trying to get a username and password pair passed to background.js of my extension. The process goes as follows: A Credentials Server (CS) is started up with encrypted credential tokens Selenium opens the browser with custom extension The extension is triggered onAuthRequired The Native Messaging Host (NMH) starts then receives a 'ready' message The NMH uses a simple protocol to request tokens from the CS The NMH decrypts the tokens The NMH passes the credentials to background.js background.js returns the credentials to chrome Authentication magic happens

Use 'Chrome Native Messaging' from Sublime Text plugin

不问归期 提交于 2019-11-29 05:14:15
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. Does anybody have experience with this or maybe know some open source ST plugin that I can look at?