Custom URL Scheme Possible in Node-webkit application?

为君一笑 提交于 2019-12-11 08:47:05

问题


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.

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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/23659374/custom-url-scheme-possible-in-node-webkit-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!