Offline Page Not Interactive |
|||
Issue descriptionChrome Version: 59.0.3071.125 OS: Android What steps will reproduce the problem? (1) Visit https://www.amazon.com/Thats-Not-English-Britishisms-Americanisms/dp/1592408850# (2) Scroll down and click on the "Description" section ("An expat's witty and singithful exploration ..."). (3) Note that at the top of the resulting page is the text "< Back". (It's below the omnibox and above the Description.) (4) Leave Chrome and do something else on your phone so Chrome gets evicted due to memory pressure. Or simply close Chrome from the Recents menu. (5) Go into Android settings and disable wifi and/or mobile data. (6) Return to Chrome. Notice the page reappears, it is now badged as "Offline". (7) Tap the "< Back" link. What is the expected result? (1) Chrome returns to the main product listing page. What happens instead? (1) The tap is ignored.
,
Jul 27 2017
Indeed, the offline snapshots are 'inert', they don't run any JavaScript. That Back button has a JS handler, so it won't work in the offline snapshot. In this specific case it's a bit of a bummer because the Back only closes the screen-size popover, the content to actually go back to is on the page... But, in general case, running scripts in offline snapshots is disabled for following reasons: - Fundamentally, the offline page is loaded from disk, and possibly shared between users/devices locally. Normally it would have to follow stricter security rules, and we are currently avoid a lot of trouble and complexity by not allowing JS to run in those pages at all. - Often, pages do not behave well (and are frequently simply broken) when they are saved with JS and then JS is allowed to run (in event handlers for example), while there is no network. - Since we try to 'capture' the state of the page that was there before, we snapshot the current DOM, which is probably a result of JS working. When loading again, it's unclear how to restore JS state and restart JS in such a way that DOM matches JS 'expectations'. This can often be a page even more broken... Our default answer for web apps that want to be interactive while offline is "implement PWA". It is not an easy path, but it is more comprehensive one. At least it doesn't have drawbacks mentioned above. Please feel free to bring suggestions you think will improve the user experience though. We are thinking about how we can improve this and all thinking is welcome!
,
Jul 27 2017
Assinging to me for now, but likely will close as Won't Fix at some point since there is not specific plan to enable JS in offline snapshots at the moment, but feel free to use this as a tracking issue.
,
Jul 28 2017
Thanks for the detailed explanation. It sounds like you indeed have a hard problem!
,
Feb 8 2018
I'm curious about the current thinking on this issue. Care to update? Again, feel free to WontFix it if appropriate.
,
Mar 7 2018
Issue 819364 has been merged into this issue. |
|||
►
Sign in to add a comment |
|||
Comment 1 by mpear...@chromium.org
, Jul 27 2017