Centralize JavaScript-side ad-hoc test detection