右のタブのみを選択しますが、送信ボタンにはフォーカスしません:
function(tab) {
var winid = tab.windowId;
var tabid = tab.id;
chrome.tabs.getAllInWindow(winid, function(tabs) {
for (var j = 0; j < tabs.length;++j) {
if (tabs[j].id == tabid) {
chrome.tabs.executeScript(null, { code: "document.getElementById('submit').focus()" });
chrome.tabs.update(tabs[(j + 1) % tabs.length].id, {
'selected': true
});
break;
}
}
});