I was learning about custom protocols for few days, and there's one thing that I don't understand.
I know how to start an app with custom protocol, but My question is,
Is it possible to get apps response and print it in Web Browser using javascript?
For example If I will send request to protocol myapp:// , that will open an app written in C#, and that app will return string "This is response" can to print it in Web Browser?
If so, can you help me to accomplish it?
Thanks in advance.
- LS. Method of allowing a webpage to handle a given protocol using navigator. registerProtocolHandler . This allows certain URLs to be opened by a given web application, for example mailto: addresses can be opened by a webmail client.
A custom protocol can be assigned the same name as a pre-defined protocol, in order to extend the number of IP addresses or ports associated with the original protocol. See Adding to a pre-defined protocol for more information.
Protocol handlers give the Windows Search indexer access to data stores, enabling the indexer to crawl the nodes of a data store and extract relevant information to index. Windows Search, for example, ships with protocol handlers for file system stores and for some versions of both Microsoft Outlook data stores.
Internet protocols aren't all about browsers.
mailto: causes an action in an email program (e.g. start a new email)
ftp: causes an action in an FTP program (which might be integrated into a web browser or Windows Explorer)
gopher: (well, that's not really prevalent anymore)
myapp:// will cause your (C#) app to start running. At that point, it can do anything a C# app can do. One thing it could choose to do is create a .html file on disk, and use
Process.Start("file://Path/To/My.html")
to cause the default web browser to open the document it just created.
UPDATE
You can certainly have your myapp:// protocol handler send an update to the web server that hosts the page in question. My assumption here is that the myapp:// handler is running on a client machine, and there is a web server on a different URL http://mydomain.com serving a page that includes a myapp:// reference.
http://mydomain.com?user=joe&result=123
?user=joe&result=123
to update response next time the Ajax callback is initiatedIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With