Browser popup event capture

Viewed 162

Is there a way to capture event of confirm popup generated by browsers.

I have an application wherein I try to open my file in Visual Studio Code using:

<a href="vscode://file/Users/abc/Desktop/about.html">Launch VS Code</a>

On click of this link, browser asks me Open Visual Studio Code? and Yes or No.

Can I capture that event of user on that popup and do some other task? Thanks in advance

----------------- Partial Solution -----------------

<a (click)="openVSCode()">Launch VS Code</a>

function openVSCode(){
  window.open('vscode://file/Users/abc/Desktop');
  window.open('vscode://file/Users/abc/Desktop/about.html');
}

The only downside to this is that there will be 2 browser generated popups opening at the same time. Else this fix seems to work.

0 Answers
Related