简体   繁体   中英

How to open a desktop app from Angular application?

I have an Angular App running in my browser (Chrome, IE and Firefox). On Click of a button , it should open a local app, which is a stand alone desktop app, already installed in my system.

First of all, Is it possible? Will Angular / Browser allow such actions?

If possible, which all are the possible ways?

Can somebody help me?

It is possible to do that using protocols, by default browser supports file:// and some other custom protocols that opens up the files in the browser window, applications like slack and discord use custom protocols that are built using electron into the applications and in the machine registry that chrome can trigger to open up an application from the web application.

https://glebbahmutov.com/blog/electron-app-with-custom-protocol/

Yes, it is possible via calling application protocol, registered at the time of installation time in our system.

Example:

You can open postman app installed via snapcraft from the browser

syntax:

postman:///

Note: You should know the registered protocol of the app and the app should not portable

via HTML:

<a href="postman:///">Open Postman</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM