How to open tab in chrome, without losing focus from the current tab?

example broken code:

window.open("ya.ru", "_blank").blur();
window.focus();


googled-googled, a working solution is not found
September 19th 19 at 13:11
1 answer
September 19th 19 at 13:13
Solution
But it works for chrome campaign current.
openNewBackgroundTab function(){
 var a = document.createElement("a");
 a.href = window.location.pathname;
 var evt = document.createEvent("MouseEvents");
 //the tenth parameter of initMouseEvent sets ctrl key
 evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
 true, false, false, false, 0, null);
a.dispatchEvent(evt);
}

var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(!is_chrome)
{
 var url = window.location.pathname;
 var win = window.open(url, '_blank');
 } else {
openNewBackgroundTab();
 }

Find more questions by tags JavaScriptGoogle Chrome