zap-hud
zap-hud copied to clipboard
Request / response highlight option
It would be great to have an option to highlight one (or more?) strings in the Request / Response dialog. We could use this for alert 'evidence' and for search results. The ZAP desktop uses highlighting in this way ;)
@jaywon - sent you a collaboration invite : looks like I cant assign issues to you until you accept that
@psiinon accepted!
Assigned :)
@jaywon have you made any progress on this?
Having looked at it I think its non trivial :/ But we still really want this functionality. Currently the requests and responses are text areas, which cant typically have highlighting applied to. There are some options:
- Faking the textarea, as per https://stackoverflow.com/questions/12831101/format-text-in-a-textarea - but I'm worried that will cause HTML responses to be rendered in the div rather than being shown
- Some clever JS and CSS as per https://codersblock.com/blog/highlight-text-inside-a-textarea/ - this looks promising but complicated any could be hard to maintain
- Using a div instead of a textarea when highlighting, but we'd then need to provide an 'Edit' button or similar to switch 'mode' which might not be so intuative
Thoughts anyone?
Some clever JS and CSS as per https://codersblock.com/blog/highlight-text-inside-a-textarea/ - this looks promising but complicated any could be hard to maintain
I just briefly scrolled over this. I think this is the way to go. We can abstract it out to a new component, HighlightableTextArea or something. Shouldn't be an issue with maintenance as long as we make the component robust for this use case.