I am working on a Chrome extension. I would like to modify some contents when the (very first) page load happens.
I wonder if I use the method getContent()
in chrome.devtools.network.onRequestFinished.addListener
, how can I modify the content after it is returned from the method?
Is this method only for network/traffic observation? Can I modify the response body?
In the Network panel of devtools, right-click and select Copy as cURL. Paste / Edit the request, and then send it from a terminal, assuming you have the curl command.
To view the request or response HTTP headers in Google Chrome, take the following steps : In Chrome, visit a URL, right click , select Inspect to open the developer tools. Select Network tab. Reload the page, select any HTTP request on the left panel, and the HTTP headers will be displayed on the right panel.
This has never been possible.
See this bug in the Chromium project (from Nov. 2011):
There are a couple relevant discussions on how to work around this limitation for certain use cases:
Based on some of the discussion in the Chromium bug DB, I'd guess that modifying the content of the existing request may never be allowed for security reasons, but reading the response and redirecting might be allowed (someday when all the blocking issues are resolved).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With