window.open()
メインスレッドから呼び出されると、デフォルトで新しいタブが開きます。javascript window.open from callback
しかし、ここでは新しいウィンドウで開くたびに(オペラ座16とGoogle Chromeの29)
<input type="button" value="Open" onclick="cb1()">
<script type="text/javascript">
function cb1() {
setTimeout(wo, 1000); //simple async
}
function wo()
{
var a = window.open("http://google.com", "w2");
a.focus();
}
</script>
が(笑、これはOpen a URL in a new tab (and not a new window) using JavaScriptのための私の答えです)。
ここでタブ(ブラウザのデフォルト設定)で開くことはできますか?
この現象はどのブラウザで発生しますか? – shanet
うまくいけば、これはあなたの_ [回答](http://stackoverflow.com/questions/2601761/change-browser-settings-by-script)_です。 –
すべてのブラウザテストページ<!DOCTYPE html>
の – user2819018