Attempt to read in the manifest.json file if it exists (before trying install.rdf)
@@ -349,10 +349,18 @@ class FirefoxProfile(object):
# it will cause an exception thrown in Python 2.6.
try:
compressed_file = zipfile.ZipFile(addon_path, 'r')
+ if 'manifest.json' in compressed_file.namelist():
+ return parse_manifest_json(compressed_file.read('manifest.json'))
+
manifest = compressed_file.read('install.rdf')
finally:
compressed_file.close()
elif os.path.isdir(addon_path):
+ manifest_json_filename = os.path.join(addon_path, 'manifest.json')
+ if os.path.exists(manifest_json_filename):
+ with open(manifest_json_filename, 'r') as f:
+ return parse_manifest_json(f.read())
+
with open(os.path.join(addon_path, 'install.rdf'), 'r') as f:
manifest = f.read()
else:
