Try following may be helpful
<button id="open">open</button>
document.getElementById('open').onclick = function() {
window.open('http://google.com');
};
Note:
You can't open tabs in the background using javascript because this is set in the user's preferences in about:config, which you have no control over. The setting in about:config in Firefox is:
It is only possible if you will be generate the Click event with Already Pressed Control Key Dynamically.
e.g. Ctrl + Click will always open new tab and stay you on current tab.
browser.tabs.loadDivertedInBackground=true