0

Background Info

I want to integrate a javascript single-page web application with a 3rd party desktop windows application. I'm working with the 3rd party vendor to try to figure out the best way to set up the integration. The plan is to call URIs from the web application, and have the desktop application handle them to perform various actions. Right now, the URI's use the localhost scheme (i.e. they look like "http://localhost:8888/..."

The Questions

1) Attempting to make a get request to the URI from javascript results in the desktop app taking the desired action, but an error is returned to the browser due to cross-origin policy. I assume this is something that can be handled with CORS like any other cross origin request. Is this true? Or are URI requests to the OS "special" in some way?

2) We might instead want to use a custom URI scheme so that our URL can look like "myapp:..." instead of localhost. Will this suffer from the same cross-origin issues as the above? Will it run into any additional restrictions in major browsers? Would users need to manually muck with their browser settings to get it to work correctly, or is it even possible at all? Is there anything different from a browser security/permission standpoint between a "standard" URI using localhost and a custom URI scheme?

jtheis
  • 916
  • 3
  • 12
  • 28
  • So you're running it on a local server and trying to get a resource from outside the scope of that server? – zfrisch Jun 15 '15 at 19:22
  • In production the app will be running from a company domain, e.g. www.companydomain.com/myapp. The app will include links (or js requests) to URIs registered with Windows for users who have this 3rd party app installed on their machine. – jtheis Jun 15 '15 at 19:29
  • I found a similar thread: http://stackoverflow.com/questions/23659374/custom-url-scheme-possible-in-node-webkit-application - If I understood your first question correctly CORS should apply to this even if it's pointing to your local machine. When it comes to browsers and CORS there's not a whole lot of give. Beyond that, unfortunately, I'm not personally well-versed in what you're attempting to do. Hopefully the above link will net you some results! – zfrisch Jun 15 '15 at 21:21

0 Answers0