Most modern browsers support the ctrl+click or command+click commands or look like open links in a new tab or in a new window.
In the application, I want the link to be disabled when clicked. But only if the target is the same window (if it opens, for example, in a new tab, I do not want the link to be disabled, since it is reasonable to click it again).
I made several attempts and debugged the event object, which is created by clicking, but I can not find any information about whether the target is a new tab or a new window.
Known workaround. Of course, you can check whether a certain key was pressed when clicking on a specific link, but this is not so, but since these commands vary from browser to browser and from OS to OS, it would be necessary to define a complex display and which accurately determines what the user has configured etc.
Is there any reliable way to determine if a location should be opened in a new tab or window?
source share