When my website is called from an external hyperlink it shall be re-opened within the same browser tab, if it is already open.
This can be achieved by specifying an appropriate target attribute within the hyperlink's HTML: <a href='http://my-website.org' target='my_target' />
However, this does not work, if the first tab is opened without a target being specified, e. g. by directly typing in the website's url. After this the hyperlink using my_target will pull up a second browser tab.
So, I want to set a default target name of the browser tab, if none exists, to ensure that this tab is used, if this default target is used in hyperlinks.
How can this be done in JavaScript?