We are using software that registers its own protocol. We can run application from browser then by link like:
customprotocol://do_this.
but is there a way to check is such custom protocol supported by user`s system? If not we would like to ask user to install software first.
if (canHandle ('customprotocol')) {
// run software
}
else {
// ask to install
}
I know this question exists, but it is very old and dates back to 2010
I tried with window.onblur, with a timeout function, but I wasn’t successful. I know that iframe doesn’t have an error callback, so all options were unsuccessful.
Jana Jerinic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Steam has a custom protocol (steam://
), and even it uses two buttons:
Install Steam | Play Now
To test if a URL works, we can use fetch
, and if we get a successful response (2XX
result), it means the site exists. However, unfortunately, for security reasons, this does not apply to custom protocols.