cef icon indicating copy to clipboard operation
cef copied to clipboard

Allow modification of response in CefResourceRequestHandler::OnResourceResponse

Open magreenblatt opened this issue 7 years ago • 3 comments

Original report by me.


The CefResponse object is currently read-only in the CefResourceRequestHandler::OnResourceResponse callback. It could be useful in some cases to allow modification of this object. For example, adding the "Content-Disposition: attachment; filename=download.pdf" header would trigger download of a PDF file instead of displaying in the PDF viewer extension.

magreenblatt avatar Oct 18 '19 14:10 magreenblatt

Original comment by Alex Maitland (Bitbucket: a-maitland).


Any thoughts on what would be involved in implementing this?

magreenblatt avatar Nov 26 '20 23:11 magreenblatt

Headers can be modified in InterceptedRequest::HandleResponseOrRedirectHeaders, so it just needs some plumbing to support the modification via the CEF API.

magreenblatt avatar Oct 28 '21 17:10 magreenblatt

Headers can be modified in InterceptedRequest::HandleResponseOrRedirectHeaders, so it just needs some plumbing to support the modification via the CEF API.

I tried modifying headers with AddHeader/RemoveHeader in InterceptedRequest::HandleResponseOrRedirectHeaders but the changes didn't reflect.

alextusinean avatar Jan 21 '24 00:01 alextusinean

@magreenblatt - has there been any more thought on implementing this going forward? This would be very helpful for us as we have a use case that would benefit from this.

taratari avatar Oct 20 '25 14:10 taratari