formatParameter() replaces "+" with a space, honours the
"View URL-encoded" toggle and falls back to "(unable to decode
value)" when decoding fails, but the context menu handler decodes
the raw value directly. Copying a parameter can therefore put
different text on the clipboard than the row shows, ignores the
toggle, and throws URIError on a malformed escape, leaving the
clipboard untouched without any feedback.
Move the decoding into a single helper used by both the view and
the copy handler, and fall back to the raw value when it cannot be
decoded. The rendered view is unchanged, only what "Copy value"
puts on the clipboard changes.
Fixed: 567556613
Change-Id: I73507d29d0dae1c54eed544a2745cec2c08a756a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/8485849
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>