Closed Bug 1375561 Opened 7 years ago Closed 7 years ago

Doing a faulty Ajax CORS requests do not show an error message in the console

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1331730

People

(Reporter: nchevobbe, Unassigned)

References

Details

STR: 
1. Go to https://codepen.io/nachtigall/pen/dRRqjm?editors=0010
2. Open the console

Expected result:
A message indicates that the request couldn't be done because of missing headers

Actual result:
Nothing is shown

If you open the page in Chrome, you will get an error message in the console.

---

The jquery example might look a bit silly because you need to specify a `crossDomain` property to false, but other libraries fail with "vanilla" requests ( e.g. ExtJs https://codepen.io/nachtigall/pen/NggLwV, RxJS https://codepen.io/nachtigall/pen/KqqemW ).
Priority: -- → P3
Summary: Some library Ajax CORS requests do not show an error message to the user → Some libraries Ajax CORS requests do not show an error message to the user
Summary: Some libraries Ajax CORS requests do not show an error message to the user → Doing a faulty Ajax CORS requests do not show an error message in the console
Hi Christoph, do you have any ideas why the CORS error message isn't being surfaced to the console in this case?
Flags: needinfo?(ckerschb)
(In reply to Brian Grinstead [:bgrins] from comment #1)
> Hi Christoph, do you have any ideas why the CORS error message isn't being
> surfaced to the console in this case?

Quick Summary for Nicolas:
Firefox offers two consoles, the Web Console as well as the Browser Console. The Browser Console captures all logging, whereas the Web Console only captures logs from that very tab. We are dealing with some issues that some errors don't show up in the web console, even though they should, like in this case. So I can recommend always checking the Browser console as well when looking for errors (at least for now).

In the Browser Console I get the following error:
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
> https://www.reddit.com/r/reactjs.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

The underlying problem is that we can't query a windowId [1], which is necessary to log to the web console. Kate is working on a patch over in Bug 1331730.

[1] https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsCORSListenerProxy.cpp#101-113
Flags: needinfo?(ckerschb)
See Also: → 1331730
With bug 1331730 being fixed, this is also fixed now. I just checked the given STRs and the CORS warnings show up now in the console.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.