<p>What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts?</p>

<p>(Please, just one feature per answer.)</p>

<p>Similar threads:</p>

<ul>
<li><a href="https://stackoverflow.com/questions/61088/hidden-features-of-javascript">Hidden Features of JavaScript</a></li>
<li><a href="https://stackoverflow.com/questions/15496/hidden-features-of-java">Hidden Features of Java</a></li>
<li><a href="https://stackoverflow.com/questions/75538/hidden-features-of-c">Hidden Features of C++</a></li>
<li><a href="https://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features of C#</a></li>
</ul>

Data can be persisted across page loads by storing it as a mozilla preference value via
```
GM_setValue(keyname, value)
```
.
Here is a simple example that tallys the number of times your script has been executed - by a given browser:
```
var od = GM_getValue("odometer", 0);
od++;
GM_setValue("odometer", od);
GM_log("odometer=" + od);
```
GM values are analogous to cookies in that cookie values can only be accessed by the originated domain, GM values can only be accessed by the script that created them.