Hacker News new | ask | show | jobs
by sachinjain 1181 days ago
Chrome DevTools provides complete visibility into what's happening inside your web application, from the HTML DOM at any given point to the network requests your app fired. Chrome DevTools also provides latency information for every API/network request, performance insights, step-by-step debugging for your source code, and an interactive console.

Although Chrome DevTools lack the capability of modifying HTTP requests & responses - Rerouting URLs, Modifying Headers, Modifying API responses on the fly for quick prototyping & testing use cases.

Requestly an Open-Source browser extension - https://github.com/requestly/requestly fills this void. It leverages chrome webRequest API (MV2) [0] & chrome declarativeNetRequest API (MV3) [1] to provide support for most of the modifications. To override API request payload & response body, Requestly overrides native XHR & fetch objects' prototype, and registers its own interceptor.

Requestly desktop app [2] runs a local server (aka proxy) on localhost:8171 and provides options to connect installed browsers & mobile devices to the local proxy. The proxy module is a simple node-based MITM proxy available here [3]. A separate rule processor module applies the modifications defined by the user.

Listed down a few problems that HTTP modifications can solve in this article [4]

[0]: https://developer.chrome.com/docs/extensions/reference/webRe...

[1]: https://developer.chrome.com/docs/extensions/reference/decla...

[2]: https://requestly.io/desktop

[3]: https://github.com/requestly/requestly-proxy

[4]: https://sachinjain.hashnode.dev/the-missing-piece-in-chrome-...