Interesting enough to find out the Reader function in Safari is actually Javascript and there are many interesting stuff from the 2000 line code:

* 5 main parts in the file:
* 1. define const
* 2. helper functions
* 3. CandidateElement
* 4. String Prototype extension
* 5. ReaderArticleFinder (main)
*
* findArticle: look for suggested candidate, otherwise look for others
* when looking for articles, check basic score of each elements (text length, text depth, id and class name, language)
* then cleanArticleNode: find pruneElements and remove them by shouldPruneElement: classname, textlength, imagearea, calculateLinkDensity
*

Way to call it:
* var ReaderArticleFinderJS = new ReaderArticleFinder(document);
* //var article = ReaderArticleFinderJS.findArticle();
* ReaderArticleFinderJS.isReaderModeAvailable();
* ReaderArticleFinderJS.prepareToTransitionToReader();

 

Blog also for this: http://joevennix.com/2011/05/09/Hacking-Safari-Reader.html

Understanding Safari Reader的更多相关文章

  1. 收藏这些Safari快捷键,让你的Mac浏览网页更加方便

    文章内容及图片来源于:知乎,如果涉及版权问题,请联系作者删除 文章收录于:风云社区(提供上千款各类mac软件的下载) Safari是Mac上的原生浏览器,功能自然很强大,现在每天在Mac上使用的最多的 ...

  2. APPLE-SA-2019-3-25-4 Safari 12.1

    APPLE-SA-2019-3-25-4 Safari 12.1 Safari 12.1 is now available and addresses the following: Safari Re ...

  3. Edge/Chrome/火狐/Safari/Opera和IE

    据DigitalTrends网站报道,谷歌Chrome浏览器性能远超竞争对手的时代已经成为过去.目前流行的浏览器水平基本相当.IE 11被Windows 10中的Edge浏览器取而代之.Mozilla ...

  4. What's New in iOS9 iOS9功能改进

    What's New in iOS9 This article summarizes the key developer-related features introduced in iOS 9, w ...

  5. iOS 9之SFSafariViewController

    金田( github 示例源码) 有时候需要在App内部打开一个网页,例如为了展示公司官网,产品列表信息,Facebook,微博等.以前都是使用 UIWebView,iOS 8引入了WKWebView ...

  6. APPLE-SA-2019-3-25-1 iOS 12.2

    APPLE-SA-2019-3-25-1 iOS 12.2 iOS 12.2 is now available and addresses the following: CFStringAvailab ...

  7. IE、FF、Safari、OP不同浏览器兼容报告

    IE.FF.Safari.OP不同浏览器兼容报告 1         浏览器内核简介 Trident IE浏览器(GreenBrowser绿色浏览器, 遨游浏览器....都是IE) Geckos Fi ...

  8. Understanding Virtual Memory

    Understanding Virtual Memory by Norm Murray and Neil Horman Introduction Definitions The Life of a P ...

  9. (转) Written Memories: Understanding, Deriving and Extending the LSTM

    R2RT   Written Memories: Understanding, Deriving and Extending the LSTM Tue 26 July 2016 When I was ...

随机推荐

  1. axios构建缓存池存储基础数据

    项目中经常出现需要多次使用的后端数据,通常的做法是通过变量缓存数据,或者通过类似vuex的东西来进行缓存,但是麻烦在于很可能需要判断一大堆的条件,或者说如果有权限控制的时候数据能否读取也是很麻烦的事情 ...

  2. hdu 2266 dfs+1258

    How Many Equations Can You Find Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 ...

  3. Delegate比较全面的例子(需整理)

    将Delegate理解为接口,只有一个方法的接口,这样最容易理解.这个方法只有声明,没有实现,实现在别的类.(实际上应该把它看作函数指针,不过接口更容易理解些.) 在你的类中有一个Delegate就相 ...

  4. iOS UI-文本视图(UITextView)

    #import "ViewController.h" @interface ViewController ()<UITextViewDelegate> @propert ...

  5. @RequiresPermissions ,@RequiresUser , @RequiresGuest ,@RequiresRoles 解释

    转载地址:https://blog.csdn.net/AinUser/article/details/64920968?locationNum=1&fps=1 @RequiresPermiss ...

  6. css中 font常用的样式属性

    今天我总结一下文本常用的字体样式 1.font常用样式 1)字体类型 语法:font-family: +字体类型:    如: font-family:宋体; 2)字体大小 语法:font-size: ...

  7. SQL Server 调优系列进阶篇 - 查询语句运行几个指标值监测

    前言 上一篇我们分析了查询优化器的工作方式,其中包括:查询优化器的详细运行步骤.筛选条件分析.索引项优化等信息. 本篇我们分析在我们运行的过程中几个关键指标值的检测. 通过这些指标值来分析语句的运行问 ...

  8. 用sql + Ado设置access的字段的默认值

    procedure TFormLOrder.ModifyDB; var F: Integer; begin with TADOQuery.Create(nil) do try // Connectio ...

  9. 常用docker

    随便什么版本的linux 接入daocloud.io 在发现镜像中选择DockerHub 搜索对应的image,然后部署. 手动输入YAML即可 aria: image: cuteribs/aria2 ...

  10. NetworkManager 命令配置nmcli注意

    1.使用nmcli connection modify对connection进行修改的时候,ipv4.addresses的输入格式为"ip/mask空格gateway",例如172 ...