Closed Bug 518301 Opened 15 years ago Closed 11 years ago

"not well-formed" error when loading non-XML local file with XMLHTTPRequest

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
trivial

Tracking

()

RESOLVED DUPLICATE of bug 384298

People

(Reporter: marcus, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux; sv-SE) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3)  konqueror/4.3.1
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090910 Iceweasel/3.5.3 (Debian-3.5.3-1)

Whenever a local file is loaded from a file:// URL with XHR, the error console shows a "not well-formed" error. This happens for all files regardless of content and file name extension, so also for files that have nothing to do with XML. The fact that it is logged at "Error" level makes it quite annoying.

The error does not have any other consequences, the loading succeeds anyway.

Probably a better heuristic for local files would be to assume XML for files with an "xml" extension, and not try to validate otherwise.

Reproducible: Always

Steps to Reproduce:
Execute following code:
  var request = new XMLHttpRequest();
  request.open("get", "file:///path/to/WarAndPeace.txt", false);
  request.send();
  alert(request.responseText);

Actual Results:  
The contents of the file is alerted. The console has a "not well-formed" error message.

Expected Results:  
The contents of the file is alerted. No error message in the console.
I can reproduce it on linux with a nightly build.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reproduced on Mac. This is really annoying and conceals actual errors.
Component: XML → DOM: Mozilla Extensions
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.