Added query detection and opens tab when it finds one