Add setting to toggle js behavior.

From #6234.