Request csrf tokens in JS when supported

Change-Id: I4a7d027f16ef56808748cfa83c6e9cad12e4b669
Merge "Request csrf tokens in JS when supported"