Hey,

It is weird that you choose 'GM_getMetadata' as the name for this method, 
that's exactly what I used when I 
implemented<https://github.com/erikvold/scriptish/commit/2f092e8a1a847ac9b5b71e63d860da394c3c811d>this
 for 
Scriptish <https://addons.mozilla.org/en-US/firefox/addon/scriptish/>. Get 
Scriptish to try it out.

GM_getMetadata() will return a hash with all your header info if you do not 
provide a key. See the 
docs<https://github.com/erikvold/scriptish/wiki/GM_getMetadata> for 
more info.

Erik

On Saturday, February 12, 2011 7:56:03 AM UTC-8, Aurélien wrote:
>
> Hi, 
>
> It would be very nice to have access to a script metadata in order to 
> write generic code. 
>
> For example if we could get access to the function GM_getMetadata we 
> could write something like that : 
>
> var name = GM_getMetadata('name'); 
> var version = GM_getMetadata('version'); 
>
> if(name && version) 
>   alert('welcome to the script ' + name + ' v' + version); 
>
> I know this example is not very interesting, but that function would 
> enable to write less configuration in scripts like 
> http://userscripts.org/scripts/review/45988 or a version checker 
> script. 
> Moreover if you consider to implement this function, it would also be 
> great to have something like GM_listMetadata to get all the metadata 
> set in a script. 
>
> Cheers, 
>
> Aurélien

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to