Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

How to code a website's HTML to be compatible with reader view?

  • 3 답장
  • 2 이 문제를 만남
  • 32 보기
  • 최종 답변자: LorenAmelang

more options

Hi,

I'm a web developer and I have a few questions about how to write code which will display predictably for the reader view.

Is there any documentation on how the "reader view" strips code and what it displays? At first glance it looks to be set up for simple article and blog sites using html5 elements like: <nav>,

,<article> etc... ?

Thanks,

Alaktu

Hi, I'm a web developer and I have a few questions about how to write code which will display predictably for the reader view. Is there any documentation on how the "reader view" strips code and what it displays? At first glance it looks to be set up for simple article and blog sites using html5 elements like: <nav>, <section>,<article> etc... ? Thanks, Alaktu

모든 댓글 (3)

more options

Try:

  • resource://gre/modules/reader/
  • resource://gre/chrome/toolkit/content/global/reader/

https://github.com/mozilla/readability

more options

In general, the more semantic you make your HTML, the better it will display in reader mode. When possible, use html5 tags that describe the content well. If you do these things and reader mode still does not work, you should file a bug at https://github.com/mozilla/readability.

If you have a specific page, post it here and we can offer advice on how to make it work better in reader mode as well.

more options

Some clues for people who aren't getting the Reader icon at all:

http://stackoverflow.com/questions/30730300/optimize-website-to-show-reader-view-in-firefox/30750212#30750212


You have to add div or p tags to achieve a page to initiate the ReaderView.



http://stackoverflow.com/questions/30661650/how-does-firefox-reader-view-operate-ff-version-38-0-5/30688312#30688312


Reading through the gitHub code, this morning, the process is that page elements are listed in a likelyhood order - with section, p, div, article at the top of the list (ie most likely) and then each of these "nodes" is given a score based on things such as comma counts and class names that apply to the node. The score value decides if the HTML page can be "page viewed" in Firefox. I am not absolutely clear if the score value is set by Firefox or by the readability function.

You need at least one p tag around the text, you want to see in Reader View and at least 516 characters in 7 words inside the text.

I also note that images in figure tags within the outer p tags are retained in Reader View.



And for the original question:

http://stackoverflow.com/questions/15206695/how-is-reader-mode-in-firefox-triggered


Firefox on Android uses readability.js as the basis for its "Reader Mode" support. Here is a content guide for making pages that are easy to extract content: http://www.readability.com/developers/guidelines

The original readability code used in Firefox comes from: http://code.google.com/p/arc90labs-readability/

Note that not all pages can be converted into Reader Mode, in fact, that's not the intention. If you come across a page that you think should be handled by Reader Mode, please file a bug: https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Android



Seems like Mozilla should provide a guide on this level...

글쓴이 LorenAmelang 수정일시