[GH-ISSUE #1629] [Scripting] Support both request.comment and response.comment #1622

Closed
opened 2026-03-03 19:52:59 +03:00 by kerem · 5 comments
Owner

Originally created by @gabrielmaldi on GitHub (May 7, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1629

Originally assigned to: @NghiaTranUIT on GitHub.

Description

Currently, you can only use either request.comment in onRequest or response.comment in onResponse.

If you set both, response.comment overrides request.comment.

In addition, both request.comment and response.comment are undefined in onResponse (having previously set request.comment to a value in onRequest). So you cannot do something like response.comment = request.comment + "\n" + "Something else".

It would also be great if both request and response got their own comment instance, and both had panels (right now only Request has a comment panel):

image

image

If this is not desired, I would settle with request.comment or response.comment having their value (which was set in onRequest) available in onResponse, to be able to concatenate with another value and this be shown in the Request > Comment panel.

Why this feature/change is important?

I'm working on a product which has custom encryption and compression of request and response body and query params. It uses it's own algorithm and dynamic keys. So it's an ideal use case for a Proxyman Addon that automatically decrypts and uncompresses requests and responses and displays the JSON body and query params in the Comment panel. Otherwise, doing this manually for each request is really cumbersome.

Thanks!

Originally created by @gabrielmaldi on GitHub (May 7, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1629 Originally assigned to: @NghiaTranUIT on GitHub. ## Description Currently, you can only use either request.comment in onRequest or response.comment in onResponse. If you set both, response.comment overrides request.comment. In addition, both request.comment and response.comment are undefined in onResponse (having previously set request.comment to a value in onRequest). So you cannot do something like `response.comment = request.comment + "\n" + "Something else"`. It would also be great if both request and response got their own comment instance, and both had panels (right now only Request has a comment panel): ![image](https://user-images.githubusercontent.com/3728897/236696190-6bad1f8a-c450-43b3-a609-7812d56182ea.png) ![image](https://user-images.githubusercontent.com/3728897/236696197-78b8425c-110e-4e25-abeb-d125c764132b.png) If this is not desired, I would settle with request.comment or response.comment having their value (which was set in onRequest) available in onResponse, to be able to concatenate with another value and this be shown in the Request > Comment panel. ## Why this feature/change is important? I'm working on a product which has custom encryption and compression of request and response body and query params. It uses it's own algorithm and dynamic keys. So it's an ideal use case for a Proxyman Addon that automatically decrypts and uncompresses requests and responses and displays the JSON body and query params in the Comment panel. Otherwise, doing this manually for each request is really cumbersome. Thanks!
kerem 2026-03-03 19:52:59 +03:00
Author
Owner

@NghiaTranUIT commented on GitHub (May 8, 2023):

Thanks for the detailed feedback @gabrielmaldi 👍

I prefer the simple solution, by fixing the request.comment on the onResponse(), so you can use this code:

response.comment = request.comment + "\n" + "Something else"

I'm going to fix it and send you a Beta now 👍


Just wondering: Are you able to decrypt your custom encryption by the Scripting tool?

<!-- gh-comment-id:1537650322 --> @NghiaTranUIT commented on GitHub (May 8, 2023): Thanks for the detailed feedback @gabrielmaldi 👍 I prefer the simple solution, by fixing the `request.comment` on the `onResponse()`, so you can use this code: ``` response.comment = request.comment + "\n" + "Something else" ``` I'm going to fix it and send you a Beta now 👍 -------------- Just wondering: Are you able to decrypt your custom encryption by the Scripting tool?
Author
Owner

@NghiaTranUIT commented on GitHub (May 8, 2023):

@gabrielmaldi you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.7.1_Fix_comment_on_the_Scripting.dmg

  • Fix the request.comment is undefined in the onResponse() func.
  • Able to view the JSON from the Comment View

CleanShot 2023-05-08 at 09 34 15@2x

https://user-images.githubusercontent.com/5878421/236726480-69f72b41-bca8-4f7c-be7c-a7574230c4b8.mp4

<!-- gh-comment-id:1537684342 --> @NghiaTranUIT commented on GitHub (May 8, 2023): @gabrielmaldi you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.7.1_Fix_comment_on_the_Scripting.dmg - Fix the `request.comment` is undefined in the `onResponse()` func. - Able to view the JSON from the Comment View ![CleanShot 2023-05-08 at 09 34 15@2x](https://user-images.githubusercontent.com/5878421/236726453-0fbd9a2d-0a83-4bd1-acaa-a12b3aca1fe4.jpg) https://user-images.githubusercontent.com/5878421/236726480-69f72b41-bca8-4f7c-be7c-a7574230c4b8.mp4
Author
Owner

@gabrielmaldi commented on GitHub (May 8, 2023):

Wow, thank you for the swift answer!

I tried the beta build and it works perfectly.

One minor detail I noticed is that if the row is selected before the server returns the response, only the request comment is rendered in the panel; and for it to refresh and include the response comment, I need to select another row and come back.

But I guess this is probably a tricky UI update pattern that may have trade-offs, so not gonna be picky 😊. This would also be solved by having a dedicated response comment panel, but I understand this is a bigger feature request and I'm fine with the current simple solution.

Just wondering: Are you able to decrypt your custom encryption by the Scripting tool?

Can't tell you just now because I haven't yet tried, but I'm confident it should work. I will use MD5, AES, Buffer and pako (zlib), some of which you already make available to scripting.

Thanks!

<!-- gh-comment-id:1538316625 --> @gabrielmaldi commented on GitHub (May 8, 2023): Wow, thank you for the swift answer! I tried the beta build and it works perfectly. One minor detail I noticed is that if the row is selected before the server returns the response, only the request comment is rendered in the panel; and for it to refresh and include the response comment, I need to select another row and come back. But I guess this is probably a tricky UI update pattern that may have trade-offs, so not gonna be picky 😊. This would also be solved by having a dedicated response comment panel, but I understand this is a bigger feature request and I'm fine with the current simple solution. > Just wondering: Are you able to decrypt your custom encryption by the Scripting tool? Can't tell you just now because I haven't yet tried, but I'm confident it should work. I will use MD5, AES, Buffer and pako (zlib), some of which you already make available to scripting. Thanks!
Author
Owner

@NghiaTranUIT commented on GitHub (May 8, 2023):

Thanks for sharing the bug 👍

Let me know if you need some help because the JavascriptCore (Apple) doesn't ship all features from NodeJS.

<!-- gh-comment-id:1538323796 --> @NghiaTranUIT commented on GitHub (May 8, 2023): Thanks for sharing the bug 👍 Let me know if you need some help because the JavascriptCore (Apple) doesn't ship all features from NodeJS.
Author
Owner

@gabrielmaldi commented on GitHub (Nov 17, 2025):

This is now covered by Custom Previewer Tabs. Thanks!

<!-- gh-comment-id:3543964420 --> @gabrielmaldi commented on GitHub (Nov 17, 2025): This is now covered by [Custom Previewer Tabs](https://docs.proxyman.com/basic-features/custom-previewer-tab). Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1622
No description provided.