Closed Bug 1638581 Opened 5 years ago Closed 5 years ago

ChannelWrapper.matches throws on webRequest listeners with "xbl" filter.type

Categories

(WebExtensions :: Request Handling, defect, P1)

defect

Tracking

(firefox-esr68 unaffected, firefox76 unaffected, firefox77 unaffected, firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

(Regression)

Details

(Keywords: dev-doc-complete, regression)

Attachments

(1 file)

While looking into the reasons behind Bug 1638476 I noticed that the webRequest listener registered by AdBlock Plus does contain all the filter type values currently listed as supported in the webRequest API schemas (as part of the ResourceType enum) and the "xbl" filter type is triggering an exception when WebRequest.jsm calls ChannelWrapper.matches.

In Bug 1636900 "xbl" has been removed from the values support by ChannelWrapper, but it is still listed as supported in the webRequest API schema.

We should:

  • add a regression test to prevent to miss to notice if the values in the ResourceType enum are not in sync with what ChannelWrapper.matches does actually support
  • remove "xbl" from the values listed as supported in the ResourceType enum
  • when a webRequest listener is registered, we should log a warning (instead of throwing an error) and remove unsupported ResourceType values from the normalized values
Assignee: nobody → lgreco
Blocks: 1638476
Severity: -- → S1
Status: NEW → ASSIGNED
Priority: -- → P1
Blocks: 1636900
Has Regression Range: --- → yes
Regressed by: 1636900

Sorry for not realizing this would break when suggesting and reviewing bug 1636900!

Set release status flags based on info from the regressing bug 1636900

Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/4329b5a4d83e Deprecate xbl from webRequest ResourceType enum and log a warning if still used by extensions. r=mixedpuppy
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

(In reply to :Gijs (he/him) from comment #2)

Sorry for not realizing this would break when suggesting and reviewing bug 1636900!

No worries at all, we should have covered that enum with a test sooner to prevent it from regressing without being noticed.

Summary: ChannelWrapper.matches throws on webRequest listeners with "xbl" filter. ype → ChannelWrapper.matches throws on webRequest listeners with "xbl" filter.type

Does this page also needs to be updated?

Flags: needinfo?(lgreco)

(In reply to kernp25 from comment #7)

Does this page also needs to be updated?

yes, I was convinced that I did already set a dev-doc-needed already on this bug, but apparently I didn't, thanks for needinfo-ing me

I see that you did also mention that 15 days ago in bug 1636900 and that a dev-doc-needed has been added on that issue, but maybe it will not be clear that it is related to changes to the WebExtensions API docs, I'll add it here and provide some details about the kind of changes we need.

Flags: needinfo?(lgreco)

Scope for the dev-doc-needed:

Maybe we could also add a note about this last point also in the metadata for RequestFilter defined in https://github.com/mdn/browser-compat-data/blob/790eeb364cf5f19e589830b5242547890fbf7039/webextensions/api/webRequest.json#L115-L135.

Keywords: dev-doc-needed

(In reply to Luca Greco [:rpl] [:luca] [:lgreco] from comment #9)

Scope for the dev-doc-needed:

I've marked "xbl" as unsupported in the BCD table: https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType#Browser_compatibility

I've added a note to the BCD table: https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/WebRequest/RequestFilter#Browser_compatibility

Marking as dev-doc-complete, but please let me know if you need anything else.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: