Closed Bug 1654833 Opened 4 years ago Closed 4 years ago

Improve error message when webRequest event listener is passed an invalid `urls` value

Categories

(WebExtensions :: Request Handling, enhancement, P5)

enhancement

Tracking

(firefox82 fixed)

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: robwu, Assigned: masterwayz, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file)

When a webRequest listener is being passed an invalid match pattern, the resulting error is next to useless. See bug 1654524 for example. The global JS console contains:

[Exception... "Illegal value" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: chrome://extensions/content/parent/ext-webRequest.js :: registerEvent :: line 46" data: no]

bug 1637431 added a helper to create a MatchPatternSet, with a fall back to a human-readable error. We should use this helper at https://searchfox.org/mozilla-central/rev/227f22acef5c4865503bde9f835452bf38332c8e/toolkit/components/extensions/parent/ext-webRequest.js#46

Mentor: rob
Keywords: good-first-bug

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Request Handling
Severity: -- → S3
Priority: -- → P5
Assignee: nobody → michael
Status: NEW → ASSIGNED

I've talked with robwu about this bug on Matrix. This patch contains the fix along with a test to make sure that it stays working.

Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8123bf1bdf73
Improve error message when webRequest listener is passed an invalid urls filter r=robwu
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: