Можно ли поставить в очередь переключение вкладок и сообщить фоновому сценарию, когда можно обработать следующий переход вкладок?
Например, в content.js
chrome.runtime.sendMessage("Do something", function(resp) {
doSomethingFor3Seocnds().then(function(resp) {
// now it's OK to go to the next tab
})
}
background.js
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){
chrome.tabs.update(sender.tab.id, {"active": true}, function(tab){
// only run if OK to go to next tab
return sendResponse(tab)
});
});