Context menu for Network side panel should copy value only instead of `name: value`
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(firefox103 fixed)
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.
Comment 1•3 years ago
|
||
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.
Comment 2•3 years ago
|
||
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!
Hi Julian,
the Google homepage with a user logged in should contain the Cookie header with ellipsis.
I've attached a screenshot.
Comment 5•3 years ago
|
||
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!
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?
Comment 7•3 years ago
|
||
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)
Comment 8•3 years ago
|
||
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?
Comment 9•3 years ago
|
||
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.
Comment 10•3 years ago
•
|
||
A few notes for any one picking this up.
-
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 -
Create a new entry for
Copy Value
for localization in to replace the one forCopy
https://searchfox.org/mozilla-central/rev/bf243bc817f97b0bb74af710bd9d874370468e8b/devtools/client/locales/en-US/netmonitor.properties#1242-1248. Maybe
we can usenetmonitor.context.copyValue
-
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®exp=false -
Fix any failing tests or add tests for it.
Assignee | ||
Comment 11•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 12•3 years ago
|
||
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!
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
bugherder |
Description
•