bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Console doesn't report missing scripts if referenced by file: URLs

NEW
Unassigned

Status

DevTools
Console
P3
normal
5 years ago
a month ago

People

(Reporter: jimb, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
When I load a page via a file: URL, if that page references a script that doesn't exist, I don't get any error in the console.

To reproduce, create a .html file like this:

<head>
  <script src="mootz.js"></script>
</head>
<body>
  Hi!
</body>

assuming there is no file named "mootz.js" in the same directory. Then, visit the file via a 'file:' url, open the web console, and hit reload. I, at least, get a complaint about not having specified a character set, but no mention that it couldn't load "mootz.js".
Thanks for the report Jim!

Jonas, we use an nsIWebProgressListener to track file URI loads in the web console, in onStateChange if the request is an imgIRequest or an nsIChannel, then we check the URI scheme (if it's "file"). [1] This works well but we are not notified when a file is not found.

What kind of listener/observer do we need to use for tracking file:// load failures? Thanks!

[1] See CPL__checkFileActivity() in https://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/utils.js#2528
Flags: needinfo?(jonas)
Priority: -- → P3
Sorry, I don't know. I suggest asking someone on the network team.
Flags: needinfo?(jonas)

Updated

a month ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.