Fix gazillions of JS errors on some pages (regression)

Regression from 2f03308 (lesson: don't make small changes to external
code without testing them well).

Change-Id: I1085848ab9e60d5745bf719fa2535902adf9c89f