Revert "Only inject gon variables and perform redirects for HTML"
!19279 (merged) somehow re-introduced this commit even though we reverted it in !19942 (merged).
Closes #36612 (closed).
!19279 (merged) somehow re-introduced this commit even though we reverted it in !19942 (merged).
Closes #36612 (closed).