Network monitor shows HTTP response details while Fetch API prevents access to the data
Categories
(DevTools :: Netmonitor, defect)
Tracking
(Not tracked)
People
(Reporter: whimboo, Unassigned)
Details
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Firefox/90.0 ID:20210503094544
I noticed a situation with the Fetch API when the Network tab shows HTTP response data while the call to fetch() actually doesn't contain any data. This behavior is a bit irritating and maybe might need some investigation.
Steps to reproduce:
- Start a second Firefox with the
--remote-debugging-portcommand line argument set - Open the DevTools console in your regular Firefox instance
- Execute the following code:
var response = await fetch("http://localhost:9222/json/list", {
method: "GET",
mode: 'no-cors',
headers: {
'Content-Type': 'application/json',
},
});
alert(await response.text());
The alert shows no text, and I assume this is due to the cross-origin request and by disabling CORS. Running the same code in the Browser Toolbox will show no all the text.
So should the network monitor maybe also hide information that usually is not accessible from within content processes?
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Thanks for filing Henrik. There is some related work been done in Bug 1671147.
We are looking at showing a notification in these cases. Please feel free to look up the details
and contribute suggestions there.
I'll close this a a dupe.
Thanks
Description
•