Closed Bug 1407087 Opened 7 years ago Closed 5 years ago

Warn in about:debugging on match pattern failure

Categories

(WebExtensions :: Developer Tools, defect, P5)

All
macOS
defect

Tracking

(firefox57 wontfix, firefox58 affected)

RESOLVED DUPLICATE of bug 1446450
Tracking Status
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: kats, Unassigned)

Details

Attachments

(1 file)

Attached file manifest.json
Nightly 58 on OS X.

Create a folder foo with the following files:
  manifest.json
  foo.js
The manifest.json file is attached; foo.js is an empty file. Go to about:debugging#addons and click the button to load a temporary add-on, and select the manifest.json.

Actual results:
Error message shows up "There was an error during installation: Extension is invalid" with a retry button

Expected results:
A more useful error message.

After some bisecting I discovered the problem is that the "matches" property in my content_scripts is "*". If I change it to something like "https://foo.com/*" then the addon is loaded successfully. However this restriction is not clear either from the error message or from the MDN docs at [1].

[1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_scripts#Matching_URL_patterns
The browser log is:

1507680282231	addons.webextension.<unknown>	ERROR	Loading extension 'null': Reading manifest: Error processing content_scripts.0.matches.0: Value "*" must either: be one of ["<all_urls>"], match the pattern /^(https?|wss?|file|ftp|\*):\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$/, or match the pattern /^file:\/\/\/.*$/

Let's see if we can surface that up to about:debugging. Noting that web-ext lint does warn about this.

Also we could put a message like: "Having trouble loading the add-on? Try opening the browser console or running web-ext lint."
Priority: -- → P5
Summary: No good error message when loading a temporary addon with bad manifest → Warn in about:debugging on match pattern failure
Product: Toolkit → WebExtensions

The schema validation errors detected when installing an extension temporarily from about:debugging should all be visible in about:debugging (fixed in Firefox 67 by Bug 1446450).

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

Attachment

General

Created:
Updated:
Size: