I’m glad you already implemented this function, thank you a lot :D I am still using Firefox 3.6 so I cannot try Scriptish, but as soon as I install Firefox 4.0, I'll try it out !
About the name, I just tried to find something coherent with what has been done in the actual GM API : http://wiki.greasespot.net/Greasemonkey_Manual:API Aurélien On Feb 13, 8:42 pm, Erik Vold <[email protected]> wrote: > 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/2f092e8a1a847ac9b5b71e63...>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/45988or 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.
