Closed Bug 1536900 Opened 5 years ago Closed 5 years ago

Provide details of why an extension is invalid

Categories

(WebExtensions :: Untriaged, defect)

60 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1446450

People

(Reporter: wolf+mozilla, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

Install new temporary extension of directory (using the manifest.json) in order to test it during development. The extensions has invalid manifest.json.

Actual results:

The error shown is:

There was an error during installation: Extension is invalid

which is not that useful to put it mildly.

Expected results:

The error shown should contain the actual error

There was an error during installation: Reading manifest: Error
processing commands.ext-edit.suggested_key: Expected object
instead of "Ctrl+Shift+I"

Patch is fairly simple

diff --git a/toolkit/mozapps/extensions/internal/XPIInstall.jsm b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
index c3c0dd4b1223..634aeda92fdb 100644
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -405,7 +405,7 @@ async function loadManifestFromWebManifest(aUri, aPackage) {
await extension.initAllLocales() : null;

if (extension.errors.length > 0) {

  • throw new Error("Extension is invalid");
  • throw new Error("Extension is invalid: " + extension.errors.join(", "));
    }

let bss = (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko)

Once more properly formatted

diff --git a/toolkit/mozapps/extensions/internal/XPIInstall.jsm b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
index c3c0dd4b1223..634aeda92fdb 100644
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -405,7 +405,7 @@ async function loadManifestFromWebManifest(aUri, aPackage) {
                 await extension.initAllLocales() : null;

   if (extension.errors.length > 0) {
-    throw new Error("Extension is invalid");
+    throw new Error("Extension is invalid: " + extension.errors.join(", "));
   }

   let bss = (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko)
Product: Firefox → WebExtensions

This is already addressed in Firefox Beta and Nightly and will be in the next major release (67)

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.