save js to make it possible to go back

This is basically working, but the setting is not saved. There is an
assertion error that I don’t know where comes from