问题
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