Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button to copy formatted ContentView #6033

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Rishabhg71
Copy link

@Rishabhg71 Rishabhg71 commented Mar 29, 2023

Description

Added Copy button in the HTTP content view that will copy formatted data to the clipboard
image

closes #5730

Checklist

  • I have updated tests where applicable.
  • I have added an entry to the CHANGELOG.

@Rishabhg71 Rishabhg71 marked this pull request as ready for review March 29, 2023 10:10
@Rishabhg71
Copy link
Author

I have added a copy button that will copy anything which is in the content view to the clipboard
data like JSON, JS, and CSS (text-based) work nicely but in the case of hex/image it's not ideal
image
If an image is tried to copy:

Format: Portable network graphics
Size:   272 x 170 px
gamma:  0.45454
aspect: 3780 x 3780

if the hex is tried to be copied:
image

0000000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52   .PNG........IHDR
0000000010 00 00 01 10 00 00 00 aa 08 06 00 00 00 65 2c 10   .............e,.
0000000020 b2 00 00 00 04 67 41 4d 41 00 00 b1 8e 7c fb 51   .....gAMA....|.Q
0000000030 93 00 00 00 20 63 48 52 4d 00 00 87 0f 00 00 8c   .... cHRM.......
0000000040 0f 00 00 fd 52 00 00 81 40 00 00 7d 79 00 00 e9   ....R...@..}y...
0000000050 8b 00 00 3c e5 00 00 19 cc 73 3c 85 77 00 00 0a   ...<.....s<.w...
0000000060 39 69 43 43 50 50 68 6f 74 6f 73 68 6f 70 20 49   9iCCPPhotoshop I
0000000070 43 43 20 70 72 6f 66 69 6c 65 00 00 48 c7 9d 96   CC profile..H...

to me, it seems like offset and ASCII representations seem kinda wrong

@Mattwmaster58
Copy link
Contributor

Exactly what I envisioned 👍

The image behavior is quite the rough edge, and it's been a while since I've looked at this codebase...but I can't image it would be too difficult to copy that to the clipboard.

Thank you for all your work

@Rishabhg71
Copy link
Author

@Mattwmaster58 well I have already tried that and stashed that image copy
problem is that png is really easy to copy to a clipboard but copying jpg/jpeg or other formats is a pain
i think its best to stick with raw data now. i will add image copy if any repo maintainer ask me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

copy raw request data button mitmweb
2 participants