Closed Bug 1572021 Opened 5 years ago Closed 4 years ago

Firefox developer tools: JavaScript files show up as HTML

Categories

(DevTools :: Debugger, defect, P3)

68 Branch
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sjef, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

I'm developing a browser application in IBM/HCL XPages. There are JavaScript sources that are correctly loaded as "application/x-javascript", yet those files have no .js extension. The application runs perfectly, but I cannot open any of those JavaScript sourced in the Debugger.

Actual results:

Some HTML is displayed instead of the JavaScript source contents so I cannot debug my JavaScript files that do not have a .js extension. See attached file.

Expected results:

The Debugger should have loaded the JavaScript of a file that is transferred as application/x-javascript.

I checked with an older Firefox version (64), and there it works correctly.

Hi,
Can you please attach the Javascript file?

Flags: needinfo?(sjef)

Sorry, but the contents of the JavaScript file are not relevant, as FF68 won't display any JavaScript file without the .js extension. The contents could even be:

function abc() {}

What we have is a browser-based application. The server is a HCL Domino XPages server. JavaScript files are stored in a database with a property 'JavaScript file' but without a .js extension. When contacting the server for a new session, the user has to connect (username/password). The website then displays the application to the user. When the Developer Tools are started, I can see the correct HTML, but when I inspect any of the JavaScript files that come from the database, the HTML of the login page seems to be displayed.

As you can see in the attached images these files used to be displayed correctly in the debugger of FF64.

Flags: needinfo?(sjef)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Debugger
Product: Firefox → DevTools

Does there happen to be a public URL we could look at that reproduces the issue? If not, do you think you could make a small Node app to reproduce what your server is returning?

I prepared one for you, I sent the info by mail to your mail address.

Great, thanks for the info, I was able to log in and check this out. The core bug at the moment is that this line doesn't run because of the missing file extension: https://searchfox.org/mozilla-central/rev/3366c3d24f1c3818df37ec0818833bf085e41a53/devtools/server/actors/utils/TabSources.js#346

That said, I really can't tell why we care about the extension in the first place here. Hopefully we can drop that logic entirely.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

This should be fixed in Nightly, could you verify?

Flags: needinfo?(sjef)

Seems fixed, thanks!!

Flags: needinfo?(sjef)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: