# \[SOLVED\] How to Edit Respon and Request in a Web Page?

**URL:** <https://onehack.st/t/solved-how-to-edit-respon-and-request-in-a-web-page/74260>\
**Category:** Tutorials & Methods\
**Tags:** solved, browsers\
**Created:** [March 21, 2020, 12:55pm UTC](https://onehack.st/t/solved-how-to-edit-respon-and-request-in-a-web-page/74260 "2020-03-21T12:55:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcquad97](https://onehack.st/user_avatar/onehack.st/mcquad97/32/35637_2.png) [@mcquad97](https://onehack.st/u/mcquad97)\
**Post date:** [March 21, 2020, 12:55pm UTC](https://onehack.st/t/solved-how-to-edit-respon-and-request-in-a-web-page/74260/1 "2020-03-21T12:55:49Z")

</div>

Hallo, anybody know how to modify response and request a webpage in chrome. using inspect element? or how?

---

<div class="post-metadata">

**Author:** ![Sarah](https://onehack.st/user_avatar/onehack.st/sarah/32/166974_2.png) [@Sarah](https://onehack.st/u/Sarah)\
**Post date:** [March 22, 2020, 5:51am UTC](https://onehack.st/t/solved-how-to-edit-respon-and-request-in-a-web-page/74260/2 "2020-03-22T05:51:12Z")

</div>

# #1

## ![image](https://onehack.st/uploads/default/original/3X/2/2/220648fea2ac1b1ab0cda3d82d71e417be603e89.png) Tamper Chrome (extension)

_Offered by: Tamper Chrome_

Allows the user to modify requests as they happen.

To use it, refresh the website and look at the developer tools (left-click → inspect element). Tamper Chrome will appear in a new tab. See the tutorial here:

 ![image](https://onehack.st/uploads/default/original/3X/a/6/a67ed95e69349aac9550854afbf415901e149017.png) ![image](https://onehack.st/uploads/default/original/3X/9/c/9cea96794a78b7e7a96b9a7b44b7acafd780e1ce.png) ![image](https://onehack.st/uploads/default/original/3X/9/c/9cea96794a78b7e7a96b9a7b44b7acafd780e1ce.png) ![image](https://onehack.st/uploads/default/original/3X/e/d/eddafcf7498e84a9180778f027f320050f57497f.png) ![image](https://onehack.st/uploads/default/original/3X/3/c/3ca6fdc99fd60b9436c1d86fb2a04c9213389563.jpeg)

> <https://github.com/google/tamperchrome/blob/master/README.md>

Tamper Chrome allows you to monitor requests sent by your browser and the responses. You can also modify requests as they go out, and to a limited extent modify the responses (headers, css, javascript or XMLHttpRequest responseText).

See what websites are sending in the background, modify submissions, switch out scripts, alter AJAX responses, Tamper Chrome puts the power of your browser back in your hands.

Tamper Chrome will prompt you to install its companion application when you first run it.

If you need help go to:  
[https://groups.google.com/forum/#!forum/tamper-chrome-help](https://groups.google.com/forum/#!forum/tamper-chrome-help)

> **[Tamper Chrome (extension) - Chrome Web Store](https://chromewebstore.google.com/detail/tamper-chrome-extension/hifhgpdkfodlpnlmlnmhchnkepplebkb)**
>
> Allows the user to modify requests as they happen.

* * *

# #2

> **[Intercepting and Modifying responses with Chrome via the Devtools Protocol](https://www.f5.com/company/blog/intercepting-and-modifying-responses-with-chrome-via-the-devtools-protocol)**
>
> Learn how to intercept and modify JavaScript on the fly using Chrome’s devtools protocol.

# #3

## stackoverflow ~copy-pasted~

I just released a Devtools extension that does just that 🙂

It’s called tamper, it’s based on [mitmproxy](http://www.mitmproxy.org/) and it allows you to see all requests made by the current tab, modify them and serve the modified version next time you refresh.

It’s a pretty early version but it should be compatible with OS X and Windows. Let me know if it doesn’t work for you.

You can get it here [http://dutzi.github.io/tamper/](http://dutzi.github.io/tamper/)

**How this works**

As @Xan commented below, the extension communicates through Native Messaging with a python script that extends [mitmproxy](http://mitmproxy.org/).

The extension lists all requests using `chrome.devtools.network.onRequestFinished` .

When you click on of the requests it downloads its response using the request object’s `getContent()` method, and then sends that response to the python script which saves it locally.

It then opens file in an editor (using `call` for OSX or `subprocess.Popen` for windows).

The python script uses mitmproxy to listen to all communication made through that proxy, if it detects a request for a file that was saved it serves the file that was saved instead.

I used Chrome’s proxy API (specifically `chrome.proxy.settings.set()` ) to set a PAC as the proxy setting. That PAC file redirect all communication to the python script’s proxy.

One of the greatest things about mitmproxy is that it can also modify HTTPs communication. So you have that also 🙂

> <https://stackoverflow.com/questions/18310484/modify-http-responses-from-a-chrome-extension>

---

<div class="post-metadata">

**Author:** ![mcquad97](https://onehack.st/user_avatar/onehack.st/mcquad97/32/35637_2.png) [@mcquad97](https://onehack.st/u/mcquad97)\
**Post date:** [March 22, 2020, 8:00am UTC](https://onehack.st/t/solved-how-to-edit-respon-and-request-in-a-web-page/74260/3 "2020-03-22T08:00:43Z")

</div>

oh nice, i’ll try.  
thank you ^^
