You can try this code, but remember that changing the UI is not a good ideia:
var addEvent = (document.addEventListener) ?
function(target,event,fn){
if(target) return target.addEventListener(event,fn,false);
}:
function(target,event,fn){
if(target) return target.attachEvent(('on' + event),fn);
},
allLinks = document.links || document.getElementsByTagName('a');
for(var i=0;i<allLinks.length;i++)
addEvent(allLinks[i],'mouseup',function(e){
var e = e || event;
if(e.which===3){
alert('Open in new tab/window');
e.preventDefault();
return false;
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…