Improved popup and app detection