Change the judge flow

Judge the tab before pushing it into record and injecting script.