'Save a JS array to file on every reload in chrome or firefox?

I have a JS array whose value changes every time I reload the browser. I want to log the array data (in a file or append to a temp variable that stays even after reload) every time I reload the page.

I tried this script but it has to be manually executed after each reload. Any idea, how can I achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source