New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 716802 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 632867



Sign in to add a comment

Origins should be notified of image replacement

Project Member Reported by bengr@chromium.org, Apr 30 2017

Issue description

Client-side Lo-Fi removes images and replaces them with rectangular placeholders. It needs a mechanism to inform origins that such replacement will occur on a page. For example, the Intervention header can be sent on all requests on a page. Minimally, the request should be sent on all JS requests, frame src requests, and XHR requests.


 
Note for this bug, we will use the Intervention header:
  Intervention: <https://shorturl/relevant/spec>

There may be a later bug to use a newer feature, such as Feature-Policy, once it is supported.
Cc: sclit...@chromium.org
Owner: dougarnett@chromium.org
Looks like we can count on the CLIENT_LOFI_ON (or kClientLoFiOn) bit being set on the frame but it will not be set on the resource requests (gets cleared in WillSendRequest unless it is for an uncommitted main frame).

So we could hook intervention header logic in RenderFrameImpl with check on frame's PreviewsState or could put in the logic in DataReductionProxyNetworkDelegate if we defined a new PreviewsState bit to carry the signal that the client intervention is enabled.
I think the header would need to be added in Blink so that it can be accessed via  JS. Adding it at content or net layer is probably too late.

Comment 5 by bengr@chromium.org, May 8 2017

I agree with tbansal. I was hoping that the implementations of "Intervention" and "Save-Data" in Blink would serve as good implementation guides.
Looks feasible to add check in same Blink method that sets "Save-Data" ( FrameFetchContext::AddAdditionalRequestHeaders()) if we add and use a method similar to RenderFrameImpl::ShouldUseClientLoFiForRequest() that is able to access the PreviewsState value on the frame.

Comment 7 by bengr@chromium.org, May 9 2017

Labels: -Pri-1 Pri-2

Comment 8 by y...@yoav.ws, May 11 2017

Is the `Intervention` header defined somewhere? Is it something other browsers are expected to support as well in the future, or will it remain proprietary?

From a content adaptation perspective, I think this is very valuable, but would be significantly more valuable as a standard :)

Also, does this change require an Intent to Ship?
The Intervention header was introduced here for a document.write intervention: https://github.com/WICG/interventions/issues/17
We want to coalesce that header in the near term. We need a better long term approach though. 

We do need to write an Intent to Ship for Image Replacement and include discussion about this mechanism to expose to origins. [Last August sclittle sent out the Intent to Implement with subject: "Intent to Implement: Support for Image Replacement in Blink"]

Comment 10 by bengr@chromium.org, May 15 2017

Status: Started (was: Assigned)
Labels: -M-60 M-61
Status: Fixed (was: Started)
Don't see CL entry here but was fixed here: 
https://chromium.googlesource.com/chromium/src/+/701e51d2fe0c63fa66953aac76417df7e218ace8


Wrt Intent to Ship, sclittle was updating the original Intent to Implement for Image Replacement.

Comment 13 by efoo@chromium.org, Dec 5 2017

Components: Blink>Previews

Comment 14 by efoo@chromium.org, Dec 5 2017

Components: -UI>Browser>Previews

Sign in to add a comment