I think this will break gallery. I've got a couple of web gl shader scripts embedded in the HTML file as scripts with type not equal to text/javascript.

Oh, actually not, since you said head only.  But still you might want to check the type first.