If you only wanted to do this for specific links, you could simply embed a tag in the href and look for the tag.
For example; say I decide to use: ?xgtab& as an indicator to open the page in an [External Giani Tab]
- open in a new tab: The domain name newtab.com is available for rent
- open in current tab: On Site Machining Worldwide | In-Place Machining Company
- open in a new tab: https://www.elsewhere.com?xgtab&
and then just use a more advanced selector:
$( "a[href*='?xgtab&']" ).attr("target","moredetail");
This will embed the xgtab arg in the request - but I doubt that will cause a problem if you choose a tag that is unlikely to be used by the websites you are linking to.