Open
Bug 1461843
Opened 7 years ago
Updated 3 years ago
Copy & paste network headers are mangled
Categories
(DevTools :: Console, enhancement, P3)
DevTools
Console
Tracking
(Not tracked)
NEW
People
(Reporter: sfink, Unassigned)
Details
When I right click and select Copy Message, then paste it into a bugzilla comment form, the resulting text is missing newlines and has ellipses replacing some of the text. I would expect full, decently formatted text.
Updated•7 years ago
|
Product: Firefox → DevTools
Comment 1•7 years ago
|
||
Thanks for the report Steve!
I can reproduce that on my machine (Win10, Fx62 Nightly)
Honza
Priority: -- → P3
Comment 2•7 years ago
|
||
I was too fast with testing here. I actually can't reproduce the problem on my machine Win10, Fx62 (Nightly)
Here is what I am doing:
1) Create a new tab, open Firefox DevTools
2) Select the Network panel
3) Load google.com
4) Right Click on the first (document) request
5) Pick Copy -> Copy Request Headers
6) Paste the clipboard into Bugzilla
Here is my result:
GET / HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Pragma: no-cache
Cache-Control: no-cache
I quickly tested on Mac and it seems to work fine too.
@Steve, what I am doing wrong? And, what do you actually mean by "Copy Message"?
Honza
Flags: needinfo?(sphink)
Reporter | ||
Comment 3•7 years ago
|
||
Oh, hm. I think this is probably a Console problem.
My steps are
1) Create a new tab, open Firefox DevTools
2) Select the Console panel (the Network panel works too, but only because it shows the console on the bottom part)
3) Load google.com
4) Left-click on a GET response to open up the tabbed viewer
5) Anywhere within that tabbed viewer, right-click and select Copy message
6) Paste the clipboard into Bugzilla
Flags: needinfo?(sphink)
Comment 4•7 years ago
|
||
Thanks Steve, I can reproduce the problem now.
Some notes for anyone interested in fixing this bug:
1) The context menu action is here:
https://searchfox.org/mozilla-central/rev/93d2b9860b3d341258c7c5dcd4e278dea544432b/devtools/client/webconsole/utils/context-menu.js#131
2) The `clipboard text` is calculated here:
https://searchfox.org/mozilla-central/rev/93d2b9860b3d341258c7c5dcd4e278dea544432b/devtools/client/webconsole/webconsole-output-wrapper.js#122
It's using simple `element.textContent`, which apparently isn't enough for copying HTTP message info. The logic should be smarter and perhaps using implementation from the netmonitor module.
I am changing the component to bconsole, but fixing this bug might have an impact on netmonitor code too.
Honza
Component: Netmonitor → Console
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•