Currently, I am working on a Tampermonkey script and facing an issue.
In my script, I declared an array as var arr = ["alex", "felix"]
which can be updated dynamically based on the script's usage. Each time there is a change, I update the value by adding it to the array like this: arr.push("kelix")
The problem arises when the script is reloaded, and the array reverts back to its initial state var arr = ["alex", "felix"]
. The new value added is not preserved in the array. So, how can I ensure that changes made to the variable arr
are saved even after reloading the script?
Could anyone provide guidance on how to tackle this issue effectively?