Closed Bug 1130381 Opened 10 years ago Closed 10 years ago

Inline sources do not show up on Nightly

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: ejpbruel, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file index.html
STR:
1. Open the attached file in a recent fx-team build.

Expected results:
1. Index.html contains an onload handler with an inline source, so it should show
   up as a source in the sources list.

Actual results:
1. The sources panel never progresses past 'Sources loading...'.

I also tried loading the same file via a python SimpleHTTPServer, with the same results. In addition, when I try this in FF33, the source does show up, but I still cannot set a breakpoint on the inline source. This might be a separate bug.

Pbrosset says he can reproduce the issue. Just to be sure, it would be nice if someone else can confirm as well.
I see "Waiting for sources..." in Nightly (2015-02-06).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thanks for confirming. James, you're the resident inline sources expert, afaik. Any idea what could be going on here?
Flags: needinfo?(jlong)
Not a bug, it's a feature. :p

We don't show inline event handlers because.... there was a good reason. Oh I found it: https://github.com/mozilla/gecko-dev/blob/master/browser/devtools/debugger/debugger-panes.js#L140. More info in bug 1097873

The Debugger.Source that we get from these sources is weird. It has no url (because it's basically an eval source) but worse it has no `introductionScript` because the HTML page isn't a script. Therefore we have *no* idea where this script came from when we get it. At first I just showed "unknown" as the label in the source listing but that's not helpful at all.

The times when you want to actually debug this seems so rare...

So that's why. Not sure what the best action is here.
Flags: needinfo?(jlong)
Note that these were never shown, since the are eval source. The behavior on release should be exactly the same.
(In reply to James Long (:jlongster) from comment #4)
> Note that these were never shown, since the are eval source. The behavior on
> release should be exactly the same.

On release, I'm seeing index.html as a source, and I can set a breakpoint on the line containing the onload handler. However, the breakpoint never actually gets hit. So, I'm definitely not seeing the same behavior. I have no idea why :S

In bug 1097873 you suggested making introductionURL the URL of the HTML page that introduced the eval script. Technically a HTML page isn't a source, but it seems reasonable to treat it as if it is. What would be the problem with that approach?
Well, technically release is just simply wrong. The fact that the HTML shows up is either a hack or a coincidence, because there are 0 sources attached to it. And the rule right now is to show it when a source from the HTML shows up.

Not saying our current behavior is ideal, but it's more consistent than release. Eventually we want to change how we show inline source anyway (show them as individual sources nested under the HTML in the sources pane). Perhaps we should go ahead and force it to always show the HTML page.

We can make `introductionURL` the HTML page, but as far as I know, right now there's no way to even do that. When we get the script, we have no idea where it comes from. And we can't just assign the HTML page to it when it's an eval source with an unknown origin because there are probably internal scripts that behave like this, that we want to hide.

So somehow we probably need to fix it on the platform side?
(In reply to James Long (:jlongster) from comment #6)
> Well, technically release is just simply wrong. The fact that the HTML shows
> up is either a hack or a coincidence, because there are 0 sources attached
> to it. And the rule right now is to show it when a source from the HTML
> shows up.
> 
> Not saying our current behavior is ideal, but it's more consistent than
> release. Eventually we want to change how we show inline source anyway (show
> them as individual sources nested under the HTML in the sources pane).
> Perhaps we should go ahead and force it to always show the HTML page.
> 
> We can make `introductionURL` the HTML page, but as far as I know, right now
> there's no way to even do that. When we get the script, we have no idea
> where it comes from. And we can't just assign the HTML page to it when it's
> an eval source with an unknown origin because there are probably internal
> scripts that behave like this, that we want to hide.
> 
> So somehow we probably need to fix it on the platform side?

Yeah, sounds like it. I could probably look into that at some point. Shall I open a bug?
Sounds good, please do! bug 1097873 was a reminder to myself to look into that, so if you open that bug, feel free to resolve mine as a duplicate.
I've opened bug 1133509 for making introductionScript return the URL of the HTML page for inline scripts.

The behaviour in release looks like a bug, but since the behaviour in Nightly is actually the correct one, we can probably go ahead and resolve this bug as invalid.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: