const Meta = require('userscript-metadata')
const pkg = JSON.parse(JSON.stringify(require('../../package.json')))

let Metadata = {
  name: pkg.longName,
  namespace: pkg.namespace,
  author: pkg.author,
  version: pkg.version,
  description: pkg.description,
  include: pkg.include,
  exclude: pkg.exclude,
  grant: pkg.grant,
  run_at: 'document-start',
  license: pkg.license
}

exports.generate = function() {
  return Meta.validateAndStringify(Metadata).Right.stringified
}

@@ -375,105 +375,419 @@
 ense
-%0A%7D%0A%0Aexports.generate = function() %7B%0A  return Meta.validateAndStringify(Metadata).Right.stringified
+,%0A  copyright: %602015 - $%7Bnew Date().getFullYear()%7D (c) $%7Bpkg.author%7D%60%0A%7D%0A%0Aconst validateCustom = Meta.validateAndStringifyWith(%7B%0A  items: %7B%0A    ...Meta.DEFAULT_ITEMS,%0A    copyright: new Meta.StringItem(%7B%0A      key: 'copyright'%0A    %7D)%0A  %7D%0A%7D)%0A%0Aexports.generate = function() %7B%0A  const result = validateCustom(Metadata)%0A  if (Meta.isRight(result)) %7B%0A    return result.Right.stringified%0A  %7D%0A%0A  throw %22Invalid metadata%22
 %0A%7D%0A

add custom metadata key