Any reason not to make it automatic?

For something similar, see @ruimalheiro 's code from today:
https://github.com/learningequality/ka-lite/pull/191/files