Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome extensions - Other ways to read response bodies than chrome.devtools.network?

I'd like to read (not modify) the response body for all requests that match some pattern in a Chrome extension. I'm currently using chrome.devtools.network.onRequestFinished, which gives you a Request object with a getContent() method. This works just fine, but of course requires the devtools to be open for the extension to work. Ideally the extension would be a popup, but chrome.webRequest.onCompleted doesn't seem to give access to the response body. There is a feature request to allow the webRequest API to edit response bodies - but can webRequest even read them? If not, is there any other way to read response bodies outside of devtools extensions?

like image 556
Josh Avatar asked May 01 '12 04:05

Josh


People also ask

Can Chrome extensions communicate with each other?

In addition to sending messages between different components in your extension, you can use the messaging API to communicate with other extensions.


1 Answers

The feature request you linked to implies that there is no support for reading either:

Unfortunately, this request is not trivial. (...) Regarding reading the Response Body: This is challenging from a performance perspective. (...) So overall, this is just not easy to achieve...

So, no, there doesn't seem to be a way for an extension to access network response bodies, except for devtools.

like image 122
rbp Avatar answered Sep 21 '22 12:09

rbp