Does GreaseMonkey have something built in so you can store data per-site or per-page? For example, say you wanted to tweak StackOverflow.com so you can add a note to each of the questions in your favorites list and sort on that note. Does GreaseMonkey have something built-in to store those notes? Or perhaps can the scripts self-modify, such that you just define an array or object and keep the data there?
Yes - GM_setValue.
This method allows user script authors to persist simple values across page-loads. Strings, booleans, and integers are currently the only allowed data types
The values are restricted to the simple datatypes: string, boolean and integer. The values will be stored in Firefox preferences (located in about:config) which is not designed for storing huge amounts of data.
http://wiki.greasespot.net/GM_setValue
If GM_setValue doesn't cut it the linked question/answers shows other great possibilities: alternatives to GM_setValue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With