Closed Bug 1182083 Opened 5 years ago Closed 4 years ago

In the Network tab of the Developer Panel, the Preview tab is blank despite there being HTML in the Response tab.


(DevTools :: Netmonitor, defect, major)

39 Branch
Not set


(firefox42 fixed)

Firefox 42
Tracking Status
firefox42 --- fixed


(Reporter: andrew, Assigned: sjakthol)



(Keywords: regression)


(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

Perform a POST or GET request to a resource (via Angular HTTP in my case). The resource has a problem (It's not been finished yet!) so it replies with HTML errors instead of JSON. This bug also applies to Firefox Developer Edition. I have only tested it on OSX.

Actual results:

The Preview window of the Network panel is blank. It used to work and generate the rendered HTML of the error. Now there is nothing. It looks like a regression of 956357.

Expected results:

It should have displayed the HTML of the error message that I got through response in the preview, as trying to work out what went wrong from just the raw HTML is difficult.
Severity: normal → major
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Could you attach a minimal testcase showing up the issue, please.
Flags: needinfo?(andrew)
The issue appears to be with any malformed HTML.

As an example open the network panel and then go to

You'll see that there is the HTML in the response tab, but the preview tab is entirely empty.
Flags: needinfo?(andrew)
Regression range:
Component: Untriaged → Developer Tools: Netmonitor

Triggered by:
a7de66143752	Patrick Brosset — Bug 1122507 - Fix the way the new network security tab toggles in the network panel now that we have the allTabs menu. r=past
Blocks: 1122507
Ever confirmed: true
Flags: needinfo?(pbrosset)
This may be a duplicate of bug 1175427.
See Also: → 1175427
I unfortunately won't have time to take a look at this in the coming weeks. Transferring to Panos who, I think, should have some time next week.
Flags: needinfo?(pbrosset) → needinfo?(past)
So, I did have some time to take a quick look.

In the netmonitor sidebar, the #preview-tabpanel element is present and contains the expected HTML response.

If I compare this with another test case that works correctly, the only difference I see is that the "security" tab is shown when it works, and not shown when it fails.
In fact, I managed to have an empty preview tab even with a well-formed HTML page served by HTTP (not HTTPS):

- open
- open the netmonitor and reload
- try to display the preview tab

So my take on this is that the new security tab is somehow messing with the 'selectedIndex' of the tabpanel.
When clicking on the "preview" tab, the <tabpanels> gets a selectedIndex of 6, which is the index of the security tab, not the one of the preview tab. So it should be 7 instead.
This confirms that it's due to bug 1122507, but only started to occur when the security tab was added (which might have been at the same time, I don't remember).

If the above is correct, then the code here is to blame:
Patrick's analysis seems plausible and corroborates the observations made in bug 1175427 and bug 1164196. Unfortunately I won't have time to look into this in the near future, but perhaps Sami can?
Flags: needinfo?(past) → needinfo?(sjakthol)
I'll take a look. I remember when adding the security tab there was similar issues that we resolved by changing the order of the tabs (i.e. Security before Preview). Too bad we never got to bottom of the issues then...
Flags: needinfo?(sjakthol)
Gah, this is the very same issue I saw when working on bug 932179. I tried to argue that the way netmonitor hides the __tabpanel__ is wrong (bug 932179 comment 11) but eventually lost my case.

Here's what MDN says [1] for hiding tabpanels inside a tabbox:
> Panels should never be hidden;

Let me repeat that since last time I made the same quote made no difference:
> Panels should never be hidden;

That's pretty explicit and leaves little to doubt. And indeed, if the tabpanel is __not__ hidden, the previews is shown. Bugs 1164196 and 1175427 are duplicates. Since this bug has the most information, I'll do the work on this bug.

I'll attach a patch one I get it trough try and fix tests that might rely on this incorrect behavior.

Assignee: nobody → sjakthol
Duplicate of this bug: 1164196
Duplicate of this bug: 1175427
Here's the patch. Previews are once again visible on non-https sites.

Attachment #8638870 - Flags: review?(vporof)
Attachment #8638870 - Flags: review?(vporof) → review+
Keywords: checkin-needed
Closed: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.