Closed Bug 1766821 Opened 3 years ago Closed 3 years ago

Context menu for Network side panel should copy value only instead of `name: value`

Categories

(DevTools :: Netmonitor, enhancement, P3)

Firefox 100
enhancement

Tracking

(firefox103 fixed)

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: valerio.cupelloni, Assigned: szatmary.zoltan1222, Mentored)

Details

Attachments

(2 files)

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

Steps to reproduce:

  • Open Network Monitor in DevTools
  • Right-click on header showed with ellipsis
  • Paste on text editor

Actual results:

When copy-paste an header showed with ellipsis, the copied value also contains the ellipsis making that value unusable.
The only way to have a full value copied is to switch to RAW mode, but I have to select all the headers because there is no way to right-click and copy a single one

Expected results:

I would like to copy in a simple way the entire value (better if only the header value without the header name) without ellipsis.

The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

Hi Valerio,

Could you share an example website where we can reproduce this and/or a screenshot of the bug?
We have not found any header with an ellipsis when trying to reproduce the issue.

Thanks!

Flags: needinfo?(valerio.cupelloni)
Attached image immagine.png
Flags: needinfo?(valerio.cupelloni)

Hi Julian,
the Google homepage with a user logged in should contain the Cookie header with ellipsis.
I've attached a screenshot.

Oh, right the ellipsis is in the middle, thanks for the screenshot.

So I can see that if I select the text and copy, I have the ellipsis, but if I right click and select "Copy" I have the full text.
When you say you "Right-click on header showed with ellipsis", can you clarify exactly how you trigger the copy (is it a default behavior on the operating system to copy on right click?)?

Thanks!

Flags: needinfo?(valerio.cupelloni)

Yes I see what you mean, but the operation you described copies all the header including the part with "<header-name>: "
Is there a way (maybe is simple lack of knowledge on my side :P) to copy only the header value without the ellipsis?

Flags: needinfo?(valerio.cupelloni)

Perhaps we could introduce new "Copy Name" and "Copy Value" items in the context menu.
Note that the menu is used in Headers, Cookies, Request, Response, Security panels (it's the default menu for Tree View component that is used in those panels)

Indeed it copies the name of the header as well. I wonder if that's useful at all? Shouldn't we always copy the value?
FWIW, chrome devtools only provide Copy Value (which, as you expect omits the header name).
Might be something to simply follow here?

Discussed in triage, we should rename the context menu item to "Copy Value" and only copy the value. "Copy all" should behave the same as today, and we should sanity check that this behavior is fine in all panels mentioned in comment #7.

Mentor: hmanilla
Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true
Priority: -- → P3
Summary: header copied value contains ellipsis → Context menu for Network side panel should copy value only instead of `name: value`

A few notes for any one picking this up.

  1. Change the the baseFormatter for the Copy to just return the value here https://searchfox.org/mozilla-central/rev/bf243bc817f97b0bb74af710bd9d874370468e8b/devtools/client/netmonitor/src/utils/context-menu-utils.js#15

  2. Create a new entry for Copy Value for localization in to replace the one for Copy https://searchfox.org/mozilla-central/rev/bf243bc817f97b0bb74af710bd9d874370468e8b/devtools/client/locales/en-US/netmonitor.properties#1242-1248. Maybe
    we can use netmonitor.context.copyValue

  3. Replace all the usages of netmonitor.context.copy https://searchfox.org/mozilla-central/search?q=L10N.getStr%28%22netmonitor.context.copy%22%29&path=&case=false&regexp=false

  4. Fix any failing tests or add tests for it.

Assignee: nobody → szatmary.zoltan1222
Status: NEW → ASSIGNED

Hi there!

I looked into it based on Hubert's instructions, and I submitted a revision to Phabricator. I'm sorry for any silly mistakes I might have made, it's my first revision to Firefox.

Thanks!

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: