Closed Bug 1656852 Opened 4 years ago Closed 2 years ago

Can't click on link inside Console > Network > Headers

Categories

(DevTools :: Netmonitor, enhancement, P3)

79 Branch
enhancement

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: maxime.defaucheux, Assigned: angelinasen1)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

I'm a web developer, so I use Firefox console everyday.
Each time I get an error from Symfony I need to click on a link provided by Symfony inside headers.
So basically, the only thing I do is opening my console and going to Network tab.
I'm using Mac OS 10.15.6

Actual results:

There, when I click on any link, nothing happens.

Expected results:

When I click on a link, it should open the link (preferably with a new tab).

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

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

Thanks for reporting!

This is a good idea.

Severity: -- → S3
Type: defect → enhancement
Priority: -- → P3

Looks like the click event is lost somewhere or not handled properly when the click happens on a link

I just found this place where we call stopPropagation in the Tree component
https://searchfox.org/mozilla-central/rev/36aa22c7ea92bd3cf7910774004fff7e63341cf5/devtools/client/shared/components/tree/TreeView.js#471

Also here is the StringRep component that does the "linkifying" of text (auto converting text to <a>s)
Perhaps we are not handling clicking on those links properly?
https://searchfox.org/mozilla-central/rev/36aa22c7ea92bd3cf7910774004fff7e63341cf5/devtools/client/shared/components/reps/reps/string.js#212

Honza

Assignee: nobody → angelinasen1
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached image Request headers link

Hello, Honza!

So, I have done some research and found out that OpenLink and isInContentPage props in the component
https://searchfox.org/mozilla-central/rev/36aa22c7ea92bd3cf7910774004fff7e63341cf5/devtools/client/shared/components/reps/reps/string.js#212
are undefined and that's why links don't have href and onclick attributes. I think this can be a reason too?

Thanks for the update!

Yes, this could be a problem too. How come they are undefined? Is the value lost along the way or it's never set properly?

Honza

Depends on D129407

Hello, Honza!

There is some workaround for StringRep in HeadersPanel
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js#453

So openLink was not set there, I tried to use OpenContentLink function from
https://searchfox.org/mozilla-central/source/devtools/client/shared/link.js#59

So now you can open Referer link in Netmonitor Headers Panel. Please check the patch ;)

(In reply to Angelina from comment #8)

So openLink was not set there, I tried to use OpenContentLink function from
https://searchfox.org/mozilla-central/source/devtools/client/shared/link.js#59

Angelina, do you have a patch you could share?
Don't worry if it isn't finished. I just want to try whatever you've tried. Thank you

Honza

Flags: needinfo?(angelinasen1)

(In reply to Angelina from comment #7)

Created attachment 9247600 [details]
Bug 1656852 click on a link in Network Headers panel r?honza

Depends on D129407

Honza, yes, this one ;)

Flags: needinfo?(angelinasen1)
Flags: needinfo?(odvarko)
Attached patch patchSplinter Review

Ah, yes, sorry :-)

I was testing the patch and I found and alternative solution

  • There is already an openLink method in the app.js file (the main file for the NetworkMonitor)
  • The openLink property is passed to all side panels alredy
  • If I pass the openLink prop to the StringRep explicitly it's called but crashes on "top.openWebLinkIn" is undefined
  • Btw. It's a bit suprising that openLink wasn't passed into the StringRep already...
  • Calling the shared openContentLink from within the openLink in app.js seems to be solving the problem (and is used everywhere in the Netmonitor I think)

Bomsy, what do you think?

Flags: needinfo?(odvarko) → needinfo?(hmanilla)

Hello, Bomsy! Please review. Should I update my patch?

Calling the shared openContentLink from within the openLink in app.js seems to be solving the problem (and is used everywhere in the Netmonitor I think)

I agree, this is the way to go

The openLink property is passed to all side panels already

I'm wondering if we can get rid of passing openLink through all these components as they do not seem to be used a lot. We can just lazily import it into the component when needed, but this is a follow up.

Thanks

Flags: needinfo?(hmanilla)

(In reply to Hubert Boma Manilla (:bomsy) from comment #14)

I'm wondering if we can get rid of passing openLink through all these components as they do not seem to be used a lot. We can just lazily import it into the component when needed, but this is a follow up.

Yes, good point. I vote doing this (together with analysis) in a separate bug.

Attachment #9247600 - Attachment description: Bug 1656852 click on a link in Network Headers panel r?honza → Bug 1656852 click on a link in Network Headers Panel r?honza

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:angelinasen1, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(odvarko)
Flags: needinfo?(angelinasen1)

This to ok to land. I've pushed it.

Flags: needinfo?(odvarko)
Flags: needinfo?(angelinasen1)
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/531de34ab726
click on a link in Network Headers Panel r=Honza,bomsy
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: