Prevent window.open from focusing
Solution 1:
The proper way would be to use extension API:
chrome.tabs.create({url: "http://...", selected: false});
Code should be placed in a background page. If you need it inside a content script you can pass a message to a background page, like so:
//content script
chrome.runtime.sendMessage({link: link});
//background page
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
if(message.link) {
chrome.tabs.create({url: message.link, selected: false});
}
});
Solution 2:
window.open(url, name, features);
window.focus();
You will see the new window for a short moment though.