Is it possible to capture “Open in New Tab” clicked event of context menu using javascript?


I know I can use capture the Right Click event by using jQuery's "contextmenu" but my question is, how can I capture the event after the context menu appears i.e. When the user clicks on "Open Link in New Tab" action.

Any help?

Thanks.

enter image description here

I found this solution

<script type='text/javascript'>
jQuery(function($){
    $('a').mousedown(function(event) {
        switch (event.which) {
            case 1:
                //alert('Left mouse button pressed');
                $(this).attr('target','_self');
                break;
            case 2:
                //alert('Middle mouse button pressed');
                $(this).attr('target','_blank');
                break;
            case 3:
                //alert('Right mouse button pressed');
                $(this).attr('target','_blank');
                break;
            default:
                //alert('You have a strange mouse');
                $(this).attr('target','_self"');
        }
    });
});

Here jQuery: Detect Mouse Click and Open Target in New Tab