'Is it possible to know which button the user click on when opening a dialog to launch external handler?

I have HTML code below:

<a href="app_protocol:[email protected]">Open app</a>

When users click on the anchor, the browser will show a dialog to ask them to open the desktop app (myapp) or not. How to know which button the user clicks on: Cancel or Open? Thanks!

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source