简体   繁体   English

使Chrome扩展程序调用Windows服务

[英]Make a Chrome extension call a Windows Service

My goal is call a Windows Service, passing a string as parameter, from a google chrome extension. 我的目标是通过Google chrome扩展程序调用Windows服务,并传递一个字符串作为参数。

Is it possible? 可能吗? Any samples available? 有样品吗?

I did the same question on Codeproject and the user kbrandwijk has solved my problem. 我在Codeproject上做了同样的问题,用户kbrandwijk解决了我的问题。

Here is his answer. 这是他的答案。 I'm posting here to help anyone who have the same question. 我在这里发布是为了帮助有相同问题的任何人。


The only part of the API that allows you to communicate outside of the sandbox since NPAPI is phased out, is the Native Messenging API . 自NPAPI淘汰以来,API允许您在沙箱外部进行通信的唯一部分是Native Messenging API This approach would however, require you to install a host and register it in Chrome. 但是,这种方法需要您安装主机并在Chrome中注册。

This host can be a small C# program that actually talks to the Windows Service. 该主机可以是实际上与Windows Service对话的小型C#程序。 Check the example here: http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/ 在此处检查示例: http : //src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM