Talk:GM.setValue: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m →Storing large amounts of data: Reply for Skagedal |
m Arantius moved page Talk:GM setValue to Talk:GM.setValue: Greasemonkey 4.0 |
||
(No difference)
|
Latest revision as of 14:30, 3 November 2017
[noref]
- How can I clear values from Firefox preferences set by my Greasemonkey script?
- Currently there is no API for this.
- The previous incarnation of this article had an example of alert(GM_setValue("foo", "bar"));. Currently miscapis.js and prefmanager.js does not have any return statements.
- If this is a desired behavior for GM developers to pursue, it will need to be corrected in the trunk.
Storing large amounts of data
So what if I do need to store large amounts of data? Is there any other API that allows for that? /Skagedal 16:12, 5 May 2009 (EDT)
@Skagedal Do some stress testing on your browser and also take into account that other machines may be slower than yours. I've done some tests on some of my own scripts and it almost never slows down the startup procedure. There are usually limits on a single preference though... keep that in mind too. Local Storage hopefully will be implemented properly sometime soon. Marti 16:22, 5 May 2009 (EDT)
- Thank you for the quick reply! I actually haven't written any code yet, currently just investigating the feasability of using Greasemonkey for my project. So, do you think it would be better with many small (I'm talking around 1000 to 100000) pairs of key/value, than encoding them all into one big value? /Skagedal 16:34, 5 May 2009 (EDT)
- You will just have to try and see what happens... Some systems have a 64K limit on a preference value too... usually I have a really slow machine around to compare results too. Also added stuff to the main GM Manual page for support. Marti 16:53, 5 May 2009 (EDT)