Skip to content

Instantly share code, notes, and snippets.

@yxkelan
Last active December 19, 2015 18:09
Show Gist options
  • Save yxkelan/5996877 to your computer and use it in GitHub Desktop.
Save yxkelan/5996877 to your computer and use it in GitHub Desktop.
#JavaScript The safari has a pop-up blocker silencer not show when a link is blocked.
var link = $('<a></a>');
link.attr('target','_blank'); //Open a new tab
function newopen(newlink){
if(newlink){
var win = window.open(newlink, '_blank');
if (win == null || typeof(win) == undefined){
link.attr('href',newlink);
link[0].click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment