Reading List: handle AMP pages. |
|||||||
Issue descriptionThe AMP pages on the google search result page cannot be distilled by the Reading List. This is because the actual page content is in an iframe. Example page https://www.google.fr/amp/s/ampbyexample.com/?client=safari has an iframe to <iframe class="u2quVpIWVr0__amp-doc" allowfullscreen="true" scrolling="no" src="https://cdn.ampproject.org/v/s/ampbyexample.com/?amp_js_v=6#origin=https%3A%2F%2Fwww.google.fr&exp=a4a%3A0&channelid=0&cid=1&dialog=0&prerenderSize=1&visibilityState=prerender&paddingTop=54&history=1&p2r=0&horizontalScrolling=0&csi=0&storage=1&viewerUrl=https%3A%2F%2Fwww.google.fr%2Famp%2Fs%2Fampbyexample.com%2F" style="height: 116px;"></iframe> The iFrame prevent to inject the distillation javascript on the page. A possibility to work around this problem is to open the page directly without the google search container. The page can be opened directly in https://ampbyexample.com or via the google cache https://cdn.ampproject.org/c/s/ampbyexample.com/ This cause two issues: 1) detect that we are displaying a google AMP page. We can check that the host is a google domain and the path starts with /amp/ We may need a stronger test to avoid false positives, particularly as there are a lot of google domains. 2) get the amp address. A simple way to get the amp cache url is to replace www.google.com/amp by cdn.ampproject.org/c in the URL. Another possibility is to check the noscript tag in the google page <noscript> <meta content="0;url=https://cdn.ampproject.org/c/s/ampbyexample.com/" http-equiv="refresh"> </noscript>
,
Jan 17 2017
,
Jan 17 2017
,
Jan 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a4a3f4f5e4d89e1afb83192f2f556e25cd9190c6 commit a4a3f4f5e4d89e1afb83192f2f556e25cd9190c6 Author: olivierrobin <olivierrobin@chromium.org> Date: Wed Jan 18 18:27:22 2017 IOS Reading distillation: Handle Google AMP iFrame. Google search page presents AMP pages in iFrames. This prevents normal distillation from happening as the WKWebView does not allow injection in iFrames. This CL works around this issue by navigating to the iframe address when a Google AMP page is detected. BUG= 677848 Review-Url: https://codereview.chromium.org/2635193003 Cr-Commit-Position: refs/heads/master@{#444422} [modify] https://crrev.com/a4a3f4f5e4d89e1afb83192f2f556e25cd9190c6/ios/chrome/browser/reading_list/BUILD.gn [modify] https://crrev.com/a4a3f4f5e4d89e1afb83192f2f556e25cd9190c6/ios/chrome/browser/reading_list/reading_list_distiller_page.h [modify] https://crrev.com/a4a3f4f5e4d89e1afb83192f2f556e25cd9190c6/ios/chrome/browser/reading_list/reading_list_distiller_page.mm
,
Jan 19 2017
,
Jan 19 2017
[Auto-generated comment by a script] We noticed that this issue is targeted for M-57; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-57 label, otherwise remove Merge-TBD label. Thanks.
,
Jan 24 2017
Verified in 58.0.2991.0 dev, iPhone 6S iOS 10.1, iPhone 6 iOS 9.3.5 iPad mini 4 10.1
,
Mar 8 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by mard...@chromium.org
, Jan 3 2017