[Greasemonkey] storing arrays with GM_setValue
Anthony Lieuallen
arantius at gmail.com
Sat Jun 4 11:06:57 EDT 2005
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."
Why not simple base 64? This appears to work (at least with this very
simple array):
<html>
<head>
<script type='text/javascript'>
var a=new Array(1,2,3,'a','b','c','d,e,f');
var ser=btoa(a);
var out=atob(ser);
</script>
</head>
<body>
<button onclick='alert(a)'>a</button><br>
<button onclick='alert(a.length)'>a.length</button><br>
<button onclick='alert(ser)'>ser</button><br>
<button onclick='alert(out)'>out</button><br>
<button onclick='alert(out.length)'>out.length</button><br>
More information about the Greasemonkey
mailing list