Closed Bug 1775426 Opened 3 months ago Closed 1 month ago

Make it possible to log which extension cancels a network request

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: kershaw, Assigned: mleclair)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

See bug 1698289 #comment 12.
Sometimes a page doesn't load well because some web extension cancels a http request, but we don't know which extension is the culprit from the http log.
It'd be nice if we can add the information here to http log.

(In reply to Kershaw Chang [:kershaw] from comment #0)

See bug 1698289 #comment 12.
Sometimes a page doesn't load well because some web extension cancels a http request, but we don't know which extension is the culprit from the http log.
It'd be nice if we can add the information here to http log.

A reason code and the addon id of the extension blocking a request is actually already being associated to the related channel here in WebRequest.jsm:

If a channel was blocked because of an extension webRequest listener then channel.loadInfo.requestBlockingReason is going to be set to Ci.nsILoadInfo.BLOCKING_REASON_EXTENSION_WEBREQUEST.

The add-on id is stored in the property bag as "cancelledByExtension", e.g. it seems that (besides using it to make it visible in the DevTools network panel) we are using it also to improve the error we show for that in download blocked by addons (introdued in Bug 1681642):

Do you think there is anything missing (or not easily accessible from where we would like to have it available) or is this bug already covered and could be closed (e.g. as a duplicate of the bug that started to collect and associate these details to the related channel)?

Flags: needinfo?(kershaw)

Thanks for the information. I think the cancelledByExtension property is enough.
I'll move this bug back to necko.

This is what I think we should do:

  1. Check if LOG is enabled
  2. If yes, call getProperty("cancelledByExtension") to get the extension id.
  3. Log the extension id.
Severity: -- → N/A
Component: Request Handling → Networking
Flags: needinfo?(kershaw)
Priority: -- → P2
Product: WebExtensions → Core
Whiteboard: [necko-triaged]
Assignee: nobody → mleclair
Pushed by mleclair@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ff2747035a5c
Added extension id to http log to know which extension cancels a network request r=kershaw,necko-reviewers
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.