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

RESOLVED DUPLICATE of bug 1331730

Status

()

Firefox
Developer Tools: Console
P3
normal
RESOLVED DUPLICATE of bug 1331730
5 months ago
2 months ago

People

(Reporter: nchevobbe, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 months ago
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 ).
(Reporter)

Updated

5 months ago
Priority: -- → P3
(Reporter)

Updated

5 months ago
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
(Reporter)

Updated

5 months ago
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: → bug 1331730

Comment 3

2 months ago
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
Last Resolved: 2 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1331730
You need to log in before you can comment on or make changes to this bug.