Feat/network
Add the network tab to ndb
Preview JSON response

Preview image

Log request body

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.
What to do if you already signed the CLA
Individual signers
- It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
- Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
- The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
- The email used to register you as an authorized contributor must also be attached to your GitHub account.
ℹ️ Googlers: Go here for more info.
It looks exciting. Thanks for doing this! Do you think that it is ready for review or are you going to polish it first?
@ak239 thanks for checking. It's definitely not ready (yet) for being reviewed. I'm going to refactor the code.
But it's gonna be great if you can check to see whether you like the approach/feature in the meantime.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.
ℹ️ Googlers: Go here for more info.
@ak239 I think this PR is ready for review 🎉
@josepharhar good catch. I will look into it.
@josepharhar I fixed the issue. But the preview tabs doesn't seem to work with html response. Will double check it this evening.

@ak239 thanks for such detailed comments. I will address all of them.
Thank you so much for your patience. I'm not familiar with the codebase much. But I think we're getting closer and closer to what we wanted.
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.
We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.
Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).
ℹ️ Googlers: Go here for more info.
@ak239 I have been trying to debug it but couldn't figure it out myself. Sometimes, it works
The other times, it doesn't
It looks like the for some reason, my this._cacheRequests is an empty array even though I add the response to it each time.
The reason I have to store the responses in the frontend code is that this callback function doesn't work if I have async/await (and I need await the responses from the httpMoneyPatching.js). Therefore, storing the responses in the frontend makes sense for me.
Besides that, I didn't fully understand some parts of the code. I think I suppose to use this method to send the response body for the preview tab. I tried but it didn't work, I debugged and the "sessions/callbacks" array is empty. But calling this works.
Also, I need to register a callback when the user clicks on the item in the requests list. I use this but I don't think it's the proper way.
Any suggestions?
@ak239 did you have a chance to take a look at it?
@ak239 I want to follow up on this PR. Let me know what else I can do.
@ak239 ping you one last time.
@ak239 I know you're super busy. Please let me know if you want me to make any code changes.
FYI I use ndb almost every day and really appreciate your work on it.
Good work guys, this will make all node devs life easier! Keep it up!
What is the status on reviewing this and potentially getting it merged? I would really appreciate this feature being added to ndp. Thank!
Love this PR - would be thrilled to see it merged!
This Network tab is what i`ve been looking for years, thanks @khanghoang for this, hope this get merged soon.
hey folks, you can try this feature today via a custom build by running npx ndb-plus <node_script>
In the case of ndb main target is not a real target, it means that I need to add interceptor for this target and interceptor code should manually fetch all available targets and send a command to all of them and get responses from all of them.
@ak239 do you need assistance with the interceptor?
Hey Guys, any update on this PR?
@khanghoang I am getting this error on ndb-plus, works fine on ndb (using yarn)

@superhit0 it's because macOS has changed the permission type names :(
@khanghoang probably yeah
Any update on this?
我觉得这蛮重要的...为什么不更新呢