You can use the Array object's AsJSON expression to get the contents of the array as a JSON string, which you can then put into local storage. When loading, use the Array object's Load action to load the array from the stored JSON string.
I don't know much of arrays and Json. I don't imagine how to prepare the array for this situation and how to save the informations of the each button in the arrays and in the local storage after and how to load and show the right buttons frames. I need more detailed informations, if is possible, but, thanks anyway.