Hi all

Since a long time I use a script found in the wiki (http://
wiki.greasespot.net/Knowing_Your_Own_Metadata) to auto-update my
scripts.
It always worked since Firefox 3

This morning, I install Firefox 5 and update to GreaseMonkey 0.9.6.
None of my scripts works anymore :-(
In the error console, I see :
"Error: /\/\/ @/ is not a function"

Linux Debian Testing 64bits
Firefox 5 x86_64
GreaseMonkey 0.9.6

The script :
/**
 * Read the GreaseMonkey parameters of this script
 * return an associative array: 'parameter name' => 'value'
 * copied from http://wiki.greasespot.net/Knowing_Your_Own_Metadata
 */
function parseHeaders(metadataBlock) {
  var headers = {};
  var line, name, prefix, header, key, value;

    var lines = metadataBlock.split(/\n/).filter(/\/\/ @/);
    for each (line in lines) {
      [, name, value] = line.match(/\/\/ @(\S+)\s*(.*)/);

      switch (name) {
        case "licence":
          name = "license";
          break;
      }

      [key, prefix] = name.split(/:/).reverse();

      if (prefix) {
        if (!headers[prefix])
          headers[prefix] = new Object;
        header = headers[prefix];
      } else
        header = headers;

      if (header[key] && !(header[key] instanceof Array))
        header[key] = new Array(header[key]);

      if (header[key] instanceof Array)
        header[key].push(value);
      else
        header[key] = value;
    }

    headers["licence"] = headers["license"];

  return headers;
}

Problem seems to come from this line "var lines = metadataBlock.split(/
\n/).filter(/\/\/ @/);"

Someone can help me, to solve this ?

Thanks in advance

ericc

-- 
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