New issue
Advanced search Search tips

Issue 736917 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

When clicking on Downloaded Page it is sometimes opened as live (by URL)

Project Member Reported by dim...@chromium.org, Jun 26 2017

Issue description

Chrome Version: 59.0.3071.92
OS: Android N

1. Open and Download any page on washingtonpost.com, for example:
https://www.washingtonpost.com/news/wonk/wp/2017/06/26/the-ultimate-symbol-of-the-pre-recession-boom-is-back/?utm_term=.00b3b3cb224b

2. Open Download Home, click on the saved page

3. Instead of a saved copy, with "Offline" indicator, a live page at this URL loads. Same happens even if phone is in airplane mode. Likely, the load is from http cache.

I tried the same in M61 Dev (61.0.3136.4) and it behaves as expected, serving offline page.


 

Comment 1 by dim...@chromium.org, Jun 26 2017

Figured out that the content of WP site is coming from a service worker they install. For some reason, the M61 Dev build does not get a service worker (might be a version check on the site?).

The correct functionality here is to skip service worker when the user clicks on a saved (downloaded) page in Download Home. This is a 'snapshot' that potentially has valuable data at the time of its capturing. When navigation to downloaded page happens, the special request header is added, 'forcing' offline page use.

Once at offline page (and with "Offline" indication in Omnibox) the user may either react to infobar offering reload to a live page or simply refresh. This removes the custom header and renavigates to the live page - service worker in this case.

Comment 2 by jianli@chromium.org, Jun 29 2017

Status: Started (was: Assigned)

Comment 3 by falken@chromium.org, Jun 30 2017

Components: Blink>ServiceWorker
I wrote on the code review but may be better here:

It kind of feels like there are two competing technologies here to handle the offline use case. One of the primary use cases of service workers is to serve the page when you're offline. It seems OfflinePages should really be named something like DownloadedPages. I can buy that we should navigate to the downloaded snapshot if the user intent is to do that, but bypassing the service worker in order to load an "offline page" sounds really weird.

How baked in is the name "offline page"?
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e16032626e22e7ab551070c6260f96876f7179ea

commit e16032626e22e7ab551070c6260f96876f7179ea
Author: Jian Li <jianli@chromium.org>
Date: Sat Jul 08 00:15:00 2017

Make service worker interceptor fall back to load the offline snapshot

When the user open the downloaded page, a specific offline header is
added in the request to mean to load the offline snapshot. In this
case, the service worker interceptor should fall back in order for
the subsequent offline page interceptor to bring up the offline
snapshot.

BUG= 736917 
TEST=new tests added

Change-Id: I5e57ed437d7534bd54f6406d4d527c4599bd9a41
Reviewed-on: https://chromium-review.googlesource.com/557479
Commit-Queue: Jian Li <jianli@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485108}
[modify] https://crrev.com/e16032626e22e7ab551070c6260f96876f7179ea/content/browser/BUILD.gn
[modify] https://crrev.com/e16032626e22e7ab551070c6260f96876f7179ea/content/browser/DEPS
[modify] https://crrev.com/e16032626e22e7ab551070c6260f96876f7179ea/content/browser/service_worker/service_worker_controllee_request_handler.cc
[modify] https://crrev.com/e16032626e22e7ab551070c6260f96876f7179ea/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
[modify] https://crrev.com/e16032626e22e7ab551070c6260f96876f7179ea/content/test/BUILD.gn

Status: Fixed (was: Started)

Sign in to add a comment