Index: chromeDevenvPoller__.js.tmpl
===================================================================
--- a/chromeDevenvPoller__.js.tmpl
+++ b/chromeDevenvPoller__.js.tmpl
@@ -1,8 +1,25 @@
+/*
+ * This file is part of the Adblock Plus build tools,
+ * Copyright (C) 2006-2013 Eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 (function()
 {
   var basename = {{metadata.get("general", "basename")|json}};
 
   function doPoll()
   {
     var request = new XMLHttpRequest();
     request.open("GET", "http://localhost:43816/");
Index: chromeInfo.js.tmpl
===================================================================
new file mode 100644
--- /dev/null
+++ b/chromeInfo.js.tmpl
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the Adblock Plus build tools,
+ * Copyright (C) 2006-2013 Eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+require.scopes.info = {
+  get addonID()
+  {
+    return chrome.i18n.getMessage("@@extension_id");
+  },
+  addonName: {{metadata.get('general', 'basename')|json}},
+  addonVersion: {{metadata.get('general', 'version')|json}},
+  addonRoot: "",
+
+  application: {{type|json}},
+  get applicationVersion()
+  {
+    {%- if type == 'opera' %}
+    var match = /\bOPR\/(\S+)/.exec(navigator.userAgent);
+    return (match ? match[1] : "0");
+    {%- else %}
+    return this.platformVersion;
+    {%- endif %}
+  },
+
+  platform: "chromium",
+  get platformVersion()
+  {
+    var match = /\bChrome\/(\S+)/.exec(navigator.userAgent);
+    return (match ? match[1] : "0");
+  }
+};
Index: packagerChrome.py
===================================================================
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -123,16 +123,20 @@ def createManifest(params):
   manifest = json.dumps(data, sort_keys=True, indent=2)
 
   return manifest.encode('utf-8')
 
 def createPoller(params):
   template = getTemplate('chromeDevenvPoller__.js.tmpl')
   return template.render(params).encode('utf-8');
 
+def createInfoModule(params):
+  template = getTemplate('chromeInfo.js.tmpl')
+  return template.render(params).encode('utf-8');
+
 def convertJS(params, files):
   from jshydra.abp_rewrite import doRewrite
 
   for item in params['metadata'].items('convert_js'):
     file, sources = item
     baseDir = os.path.dirname(item.source)
 
     # Make sure the file is inside an included directory
@@ -332,16 +336,21 @@ def createBuild(baseDir, type='chrome', 
     convertJS(params, files)
 
   if metadata.has_section('import_locales'):
     importGeckoLocales(params, files)
 
   if devenv:
     files['devenvPoller__.js'] = createPoller(params)
 
+  if (metadata.has_option('general', 'backgroundScripts') and
+      'lib/info.js' in re.split(r'\s+', metadata.get('general', 'backgroundScripts')) and
+      'lib/info.js' not in files):
+    files['lib/info.js'] = createInfoModule(params)
+
   zipdata = files.zipToString()
   signature = None
   pubkey = None
   if keyFile != None:
     signature = signBinary(zipdata, keyFile)
     pubkey = getPublicKey(keyFile)
   writePackage(outFile, pubkey, signature, zipdata)
 
