Detect new tabs opened from content scripts correctly (#517, #510)