conditional checks

avoid running DOM selectors on pages where elements don’t exist