How to enable iOS 5 Safari Reader on my website?

后端 未结 11 2615
故里飘歌
故里飘歌 2020-11-28 18:48

How does the Reader function of Mobile Safari in iOS 5 work? How do I enable it on my site. How do I tell it what content on my page is an article to trigger this function?<

11条回答
  •  旧时难觅i
    2020-11-28 19:52

    This question (How to disable Safari Reader in a web page) has more details. Copied here:


    I'm curious to know more about what triggers the Reader option in Safari and what does not. I wouldn't plan to implement anything that would disable it, but curious as a technical exercise.

    Here is what I've learned so far with some basic playing around:

    You need at least one H tag It does not go by character count alone but by the number of P tags and length Probably looks for sentence breaks '.' and other criteria Safari will provide the 'Reader' if, with a H tag, and the following:

    1 P tag, 2417 chars 4 P tags, 1527 chars 5 P tags, 1150 chars 6 P tags, 862 chars If you subtract 1 character from any of the above, the 'Reader' option is not available.

    I should note that the character count of the H tag plays a part but sadly did not realize this when I determined the results above. Assume 20+ characters for H tag and fixed throughout the results above.

    Some other interesting things:

    Setting for P tags removes them from the count Setting display to none, and then showing them 230ms later with Javascript avoided the Reader option too

    I'd be interested if anyone can determine this in full.

提交回复
热议问题