Closed Bug 1410357 Opened 7 years ago Closed 4 years ago

Network monitor does not capture requests made by extensions

Categories

(DevTools :: Netmonitor, defect, P3)

58 Branch
defect

Tracking

(firefox57 fix-optional)

RESOLVED DUPLICATE of bug 1642784
Tracking Status
firefox57 --- fix-optional

People

(Reporter: 61.1p57, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0 Build ID: 20171019222141 Steps to reproduce: --- manifest.json --- { "name": "Request", "version": "0.1", "manifest_version": 2, "permissions": [ "https://example.com/" ], "background": { "scripts": ["background.js"] } } --- background.js --- const request = new XMLHttpRequest(); request.open('GET', 'https://example.com/', true); request.onload = function () { if (this.status >= 200 && this.status < 400) console.log("response received.") }; request.send(); Load the demo above and open debug window. Actual results: "response received." appears in console, but nothing shows up in network monitor. Expected results: The request to https://example.com/ should be recorded.
Has STR: --- → yes
Component: Untriaged → Developer Tools: Netmonitor
The Network monitor is primarily used to monitor HTTP traffic related to the current page/browser tab. If I understand correctly background.js is not attached to any particular page, correct? You might use the Browser Toolbox... Do you see the request there? Honza
Flags: needinfo?(61.1p57)
According to the devtool, it's attached to a _generated_background_page.html page. The browser toolbox does show the request though, ok for a workaround but still creates inconveniences.
Flags: needinfo?(61.1p57)
Since it's not explicit in the STR and in case there's confusion that has stalled this, I think "Load the demo above and open debug window." is referring to about:debugging and the devtools that open from there that are specifically for debugging an addon (not "the current page/browser tab"). If the netmonitor is not supposed to work in this context, perhaps consider hiding the Network tab so addon devs don't assume they can rely on it?
I noticed the same issue today, and was really surprised by the behaviour as well. I had the same behaviour when sending the request from a background script, and same thing with requests sent from a browser action popup. I would have assumed all requests sent from an addon to be visible from the "debug" toolbox Network Tab of this addon, but they aren't. I found this really off-putting. Is this behaviour intended?
Product: Firefox → DevTools

I did more testing in bug 1642784 and it seems to be working for me. I can see HTTP requests coming from the backround scope in the Browser Toolbox's Network panel

Closing this as duplicate, but please ping me if you have a test case that can be used to reproduce the issue.

Honza

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