Optimization for JS reenabling detection