自定义URL方案在Node-webkit应用程序中可能? [英] Custom URL Scheme Possible in Node-webkit application?

查看:478
本文介绍了自定义URL方案在Node-webkit应用程序中可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个基本的node-webkit应用程序,我也有一个单独的web应用程序。我想能够直接从web应用程序传递信息到node-webkit应用程序,但从我可以告诉到目前为止这还没有做到。

I've written a basic node-webkit application, and I also have a separate web application. I would like to be able to pass information to the node-webkit application from the web application directly, but from what I can tell so far this has not been done.

我查看使用CORS,但这不会工作时指向外部的Web浏览器(我试图指向它的文件url [文件:// blahblah / blah]在主机上)。我意识到,我可以在node-webkit应用程序中运行一个web服务器来监听来自web应用程序的调用,但似乎不是一个好的做法是让应用程序接受通过localhost的请求...即使我选择了一些晦涩端口使用。

I looked into using CORS, but this will not work when pointed outside of a web browser (I tried to point it at a file url [file://blahblah/blah] on the host machine). I realize that I could just run a webserver within the node-webkit application to listen for calls from the web application, but it doesn't seem like good practice to have an application accepting requests over localhost...even if I chose some obscure port to use.

这是一个非常新的开发领域,所以我一直在寻找一个合理的解决方案。目前,我唯一的想法是创建一个小的原生OSX应用程序来包装node-webkit应用程序。 OSX应用程序能够使用自定义URL方案,因此这不应该是一个问题。

This is a very new area of development for me, so I have been looking every which way for a reasonable solution to this problem. At the moment the only idea I have would be to create a small native OSX application to wrap around the node-webkit application. OSX applications are capable of using custom URL schemes, so this shouldn't be a problem.

我非常感谢社群的任何建议。谢谢阅读。

I would greatly appreciate any suggestions from the community. Thanks for reading.

推荐答案

https://github.com/rogerwang/node-webkit/issues/255 ,但到目前为止,还没有准备好。看起来他们打算将此配置放入package.json中,您可以在此处看到 https ://github.com/rogerwang/node-webkit/issues/99

There is a issues for that https://github.com/rogerwang/node-webkit/issues/255 but, so far, it is not ready yet. It looks like they intent to put this configuration into the package.json, as you can see here https://github.com/rogerwang/node-webkit/issues/99.

这篇关于自定义URL方案在Node-webkit应用程序中可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆