[Greasemonkey] storing arrays with GM_setValue
chris feldmann
cfeldmann at gmail.com
Sat Jun 4 03:36:00 EDT 2005
p.s.
>Can you make assumptions about the contents of your array?
Oh, yes. I can make assumptions!
On 6/4/05, chris feldmann <cfeldmann at gmail.com> wrote:
>
> >No?
>
> Hm. Maybe....
> join? uneval? eval? I tried valueOf(). Are you suggesting I need to learn
> all those pesky functions?
> Kidding. That was pretty much what I was looking for. Especially uneval.
> That's really a function? Wow, neat.
>
> Thanks, man.
>
>
> On 6/4/05, Jeremy Dunck <jdunck at gmail.com> wrote:
> >
> > On 6/4/05, chris feldmann <cfeldmann at gmail.com> wrote:
> > > No matter how I try to serialize an array through GM_setValue, I get
> > an
> > > error: (roughly) "Attempt to set a preference with variable type:
> > Object."
> >
> > Can you make assumptions about the contents of your array?
> >
> > If so:
> > ["test", "me"].join(",")
> >
> > If not, maybe:
> > var a = ["test", "me"];
> > GM_setValue("anarray", uneval(a));
> > var b = eval(GM_getValue("anarray");
> >
> > No?
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050604/3eba4dc2/attachment.htm
More information about the Greasemonkey
mailing list