2つ以上じゃない?
if (tabs.length > 1 && shouldPrompt) {
ここの1を99とかにしたら?