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

后端 未结 1 548
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 10:36

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

相关标签:
1条回答
  • 2020-12-11 11:21

    In order to get my extension working, I followed the following steps:

    1. I deleted my registry key and then re-added it in my HKLM registry.
    2. Although unnecessary,host.exe really only needed to receive one message from the extension, so I changed my previous "open port" messaging to a "no port" message, i.e.

      chrome.runtime.sendNativeMessage(...);

    3. Importantly, when I changed the text I was sending from {"text":data[0]} to a simple string {"text":"Hello from Chrome!"}, everything began working smoothly. data[0] was a string of about 250KB, which should definitely be an acceptable message size according to the developer's site. However, I have created a different question for this problem, as I was able to solve the general message sending and receiving problem I was experiencing.

    0 讨论(0)
提交回复
热议问题