Only run profile js on pages that need it
Merge pull request #8120 from cirosantilli/profile-js-only-needed

Only run profile js on pages that need it