[Android] [Reader mode]Instant reader mode for new tab or WebView

554 views
Skip to first unread message

Андрей Караман

unread,
Nov 14, 2016, 5:35:24 AM11/14/16
to Chromium-dev
Hi all.

Is it possible somehow to use reader mode or distiller when new tab is opening? Mean without showing content to user but show only distilled content?

Second - is it possible to add distiller to general WebView?

Regards,
Andrew.

Tommy Nyquist

unread,
Nov 14, 2016, 2:34:22 PM11/14/16
to hella...@gmail.com, Chromium-dev
Regarding opening distilled content, you might find it helpful to start with looking at the code in //chrome/browser/dom_distiller/tab_utils.h. It provides some functionality to distill content from one WebContents into another one, and also for distilling the content of WebContents and then navigating to the distilled content.

For distilling a URL directly, you could also look at the standalone extractor in

Specifically, you might want to look at DomDistillerService::ViewUrl. To get a DistillerPage, you could use DomDistillerService::CreateDefaultDistillerPage(const gfx::Size& render_view_size).

I'm not sure about what you mean regarding 'general WebView' though. Do you mean the Android WebView? If so, I don't believe they currently depend on the dom_distiller component.

The core code for DOM Distiller is available in //components/dom_distiller. That means basically the extraction part. For the reader mode UI, most of the code lives in various places within //chrome.

For chrome though, you could do a quick hack to see what this would look like by intercepting all navigations and replacing them using 
dom_distiller::url_utils::GetDistillerViewUrlFromUrl to force them to load the distilled content. In Java this would be exposed as DomDistillerUrlUtils#getDistillerViewUrlFromUrl.


--
Tommy

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Андрей Караман

unread,
Nov 18, 2016, 12:02:49 PM11/18/16
to Chromium-dev
Thanks Tommy,

That is little help me.But i stacked with another issue. After I get URL and try to open it`s took so much time.

Am I right that chromium just download full page, distill it and after - show result to user? 

понедельник, 14 ноября 2016 г., 12:35:24 UTC+2 пользователь Андрей Караман написал:

Torne (Richard Coles)

unread,
Nov 18, 2016, 12:45:08 PM11/18/16
to hella...@gmail.com, Chromium-dev
Yes, the distiller is a completely local process: it has to download the page first, and then it just works out which part is relevant and shows that. It's not a network service that would actually reduce bandwidth usage or improve page load time.

--
Reply all
Reply to author
Forward
0 new messages