This has nothing to do with browser settings if you are trying to open a new tab from a custom function.
In this page, open a JavaScript console and type:
document.getElementById("nav-questions").setAttribute("target", "_blank"); document.getElementById("nav-questions").click();
And it will try to open a popup regardless of your settings, because the 'click' comes from a custom action.
In order to behave like an actual 'mouse click' on a link, you need to follow spirinvladimir's advice and really create it:
document.getElementById("nav-questions").setAttribute("target", "_blank"); document.getElementById("nav-questions").dispatchEvent((function(e){ e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return e }(document.createEvent('MouseEvents'))));
Here is a complete example (do not try it on jsFiddle or similar online editors, as it will not let you redirect to external pages from there):
<!DOCTYPE html> <html> <head> <style> #firing_div { margin-top: 15px; width: 250px; border: 1px solid blue; text-align: center; } </style> </head> <body> <a id="my_link" href="http://www.google.com"> Go to Google </a> <div id="firing_div"> Click me to trigger custom click </div> </body> <script> function fire_custom_click() { alert("firing click!"); document.getElementById("my_link").dispatchEvent((function(e){ e.initMouseEvent("click", true, true, window, /* type, canBubble, cancelable, view */ 0, 0, 0, 0, 0, /* detail, screenX, screenY, clientX, clientY */ false, false, false, false, /* ctrlKey, altKey, shiftKey, metaKey */ 0, null); /* button, relatedTarget */ return e }(document.createEvent('MouseEvents')))); } document.getElementById("firing_div").onclick = fire_custom_click; </script> </html>