0

I would like to write a plugin that calculates a cryptographic hash of every file rendered in the browser (images, html, css, etc), without causing a second get request for the various files. Ideally I could listen for each resource being loaded and get a copy of the bytestream that comes back.

Does anyone know if such a hook exists / what it would be called?

Thanks!

Jim
  • 2,111
  • 4
  • 25
  • 34
  • An image is just a DOM element, you can access dom elements as answered here: http://stackoverflow.com/a/19758800/1935500 – Aziz Saleh Sep 22 '14 at 01:42

1 Answers1

1

Not at the moment.

There is a feature request to allow (at least) read access to response body in chrome.webRequest.onCompleted, but it's not currently implemented.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • 2
    When I wrote the API draft, I was thinking of blocking or redirecting the original request in order to let the extension take ownership of the request. I'm not sure if it is feasible to have two response body readers for a single request, since it would complicate the request handling. E.g. when the extension cancels the request, should the original request also be aborted, and vice versa? I'll look for the possibility of having two readers though, since the use case in the question should reasonable. – Rob W Sep 22 '14 at 11:01