vlatkovski

openNewTab

May 15th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function openNewTab(url) {
  2.     if (! window.open(url) ) {
  3.         var done = false;
  4.         document.onclick = function() {
  5.             if (!done) window.open(url); done = true; return;
  6.         };
  7.     };
  8. };
  9.  
  10. openNewTab("http://twitter.com");
Advertisement
Add Comment
Please, Sign In to add comment