Open Bug 2007298 Opened 9 months ago Updated 8 months ago

The Network tab does not display requests from Web Workers blocked by CSP

Categories

(DevTools :: Netmonitor, defect, P3)

Firefox 147
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: roman.deev06, Unassigned, NeedInfo)

References

Details

Attachments

(1 file)

Attached image network.png —

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0

Steps to reproduce:

  1. Open https://www.openstreetmap.org/#layers=V
  2. Open Network tab in DevTools
  3. Open Split console
  4. Click on the button labeled Top in the text input line in the Console
  5. Switch to the Web Worker context (there must be an item with a uuid)
  6. Execute await fetch("https://goolge.com")

Actual results:

Nothing happens on the Network tab

In the global browser console (cmd + option + shift + I) also nothing

Expected results:

The blocked request should be displayed on the Network tab

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

The severity field is not set for this bug.
:bomsy, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hmanilla)

Will check if a channel is created here and if we miss showing it for some reason.

Flags: needinfo?(hmanilla) → needinfo?(jdescottes)

CSP errors are handled in https://searchfox.org/firefox-main/source/devtools/server/actors/resources/network-events-content.js

We setup notification observers in all processes but only in the main thread.

I suspect that requests blocked by CSP originating from a worker thread are not creating observer notifications in the main thread. Valentin, does that make sense?

Flags: needinfo?(jdescottes) → needinfo?(valentin.gosu)

I suspect that requests blocked by CSP originating from a worker thread are not creating observer notifications in the main thread. Valentin, does that make sense?

Yes, I think that's correct.
Web-Workers and Service workers would use FetchChild implementation - instead of HttpChannelChild.
On the parent side the channel will use the main thread (nsHttpChannel) via FetchService::Fetch
We may be able to send a notification to the main thread in mozilla::dom::FetchChild::DoFetchOp, and use that to correlate requests in devtools if that helps?

Flags: needinfo?(valentin.gosu)
Severity: -- → S3
Priority: -- → P3
Flags: needinfo?(hmanilla)
See Also: → 1886790
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: