My Novel Reader

小说阅读脚本,统一阅读样式,内容去广告、修正拼音字、段落整理,自动下一页

目前为 2017-08-20 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @id mynovelreader@ywzhaiqi@gmail.com
  3. // @name My Novel Reader
  4. // @name:zh-CN 小说阅读脚本
  5. // @name:zh-TW 小說閱讀腳本
  6. // @version 5.6.9
  7. // @namespace https://github.com/ywzhaiqi
  8. // @author ywzhaiqi
  9. // @contributor Roger Au, shyangs, JixunMoe、akiba9527 及其他网友
  10. // @description 小说阅读脚本,统一阅读样式,内容去广告、修正拼音字、段落整理,自动下一页
  11. // @description:zh-CN 小说阅读脚本,统一阅读样式,内容去广告、修正拼音字、段落整理,自动下一页
  12. // @description:zh-TW 小說閱讀腳本,統一閱讀樣式,內容去廣告、修正拼音字、段落整理,自動下一頁
  13. // @license GPL version 3
  14. // @grant GM_xmlhttpRequest
  15. // @grant GM_addStyle
  16. // @grant GM_getValue
  17. // @grant GM_setValue
  18. // @grant GM_getResourceURL
  19. // @grant GM_openInTab
  20. // @grant GM_setClipboard
  21. // @grant GM_registerMenuCommand
  22. // @grant GM_info
  23. // @grant unsafeWindow
  24. // @connect *
  25. // @homepageURL https://gf.qytechs.cn/scripts/292/
  26. // @require https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
  27. // @require https://cdn.staticfile.org/underscore.js/1.7.0/underscore-min.js
  28. // @require https://cdn.staticfile.org/keymaster/1.6.1/keymaster.min.js
  29. // @require https://gf.qytechs.cn/scripts/2672-meihua-cn2tw/code/Meihua_cn2tw.js?version=7375
  30.  
  31. // @include *://read.qidian.com/*,*.aspx
  32. // @include *://readbook.qidian.com/bookreader/*,*.html
  33. // @include *://read.qidian.com/BookReaderOld/*,*.aspx
  34. // @include *://read.qidian.com/BookReader/*,*.aspx
  35. // @exclude http://read.qidian.com/BookReader/vol,*,*.aspx
  36. // @include *://wwwploy.qidian.com/BookReader/*,*.aspx
  37. // @include *://free.qidian.com/Free/ReadChapter.aspx?*
  38. // @include *://www.qdmm.com/BookReader/*,*.aspx
  39. // @include *://www.qdwenxue.com/BookReader/*,*.aspx
  40. // @include *://chuangshi.qq.com/read/bookreader/*.html*
  41. // @include *://chuangshi.qq.com/*bk/*/*-r-*.html*
  42. // @include *://yunqi.qq.com/*bk/*/*.html
  43. // @include *://dushu.qq.com/read.html?bid=*
  44. // @include *://www.jjwxc.net/onebook.php?novelid=*
  45. // @include *://book.zongheng.com/chapter/*/*.html
  46. // @include *://www.xxsy.net/books/*/*.html
  47. // @include *://book.zhulang.com/*/*.html
  48. // @include *://www.17k.com/chapter/*/*.html
  49. // @include *://mm.17k.com/chapter/*/*.html
  50. // @include *://www.kanxia.net/k/*/*/*.html
  51. // @include *://www.qingdi.com/files/article/html/*/*/*.html
  52. // @include *://www.xkzw.org/*/*.html
  53. // @include *://shouda8.com/*/*.html
  54. // @include *://novel.hongxiu.com/*/*/*.shtml
  55. // @include *://www.readnovel.com/novel/*.html
  56. // http://www.tianyabook.com/*/*.htm
  57.  
  58. // @include *://tieba.baidu.com/p/*
  59. // @include *://booklink.me/*
  60. // @include *://2.booklink.me/*
  61.  
  62. // booklink.me
  63. // @include *://www.shumil.com/*/*.html
  64. // @include *://www.wcxiaoshuo.com/wcxs-*-*/
  65. // @include *://www.xiaoshuoz.com/wcxs-*-*/
  66. // @include *://www.quledu.com/wcxs-*-*/
  67. // @include *://www.ranwen.cc/*/*/*/*.html
  68. // @include *://www.ranwen.net/files/article/*/*/*.html
  69. // @include *://www.ranwena.com/files/article/*/*/*.html
  70. // @include *://www.64mi.com/*/*/*/*.html
  71. // @include *://www.bxs.cc/*/*.html*
  72. // @include *://www.laishuwu.com/html/*/*/*.html
  73. // @include *://www.binhuo.com/html/*/*/*.html
  74. // @include *://www.haoqi99.com/haoqi99/*/*/*.shtml
  75. // @include *://www.shuhe.cc/*/*/
  76. // @include *://www.dudukan.net/html/*/*/*.html
  77. // @include *://www.hahawx.com/*/*/*.htm
  78. // @include *://www.zhuzhudao.com/txt/*/*/
  79. // @include *://www.zhuzhudao.cc/txt/*/*/
  80. // @include *://www.dahaomen.net/txt/*/*/
  81. // @include *://www.tadu.com/book/*/*/
  82. // @include *://www.aishoucang.com/*/*.html
  83. // @include *://www.wanshuba.com/Html/*/*/*.html
  84. // @include *://www.zhuishu.net/files/article/html/*/*/*.html
  85. // @include *://www.sqsxs.com/*/*/*.html*
  86. // @include *://www.caiwei.tw/html/*/*.html
  87. // @include *://www.hotsk.com/Html/Book/*/*/*.shtml
  88. // @include *://www.92to.com/*/*/*.html
  89. // @include *://www.qirexs.com/read-*-chapter-*.html
  90. // @include *://www.du00.com/read/*/*/*.html
  91. // @include *://www.qishuwu.com/*/*/
  92. // @include *://www.wandoou.com/book/*/*.html
  93. // @include *://www.6yzw.org/*/*.html
  94. // @include *://www.6yzw.com/*/*.html
  95. // @include *://www.daomengren.com/*/*.html
  96. // @include *://muyuge.com/*/*.html
  97. // @include *://www.muyuge.net/*/*.html
  98. // @include *://bbs.vyming.com/novel-read-*-*.html
  99. // @include *://www.9imw.com/novel-read-*-*.html
  100. // @include *://www.23zw.com/olread/*/*/*.html
  101. // @include *://www.50zw.com/book_*/*.html
  102. // @include *://www.xiangcunxiaoshuo.com/shu/*/*.html
  103. // @include *://www.lwxs520.com/books/*/*/*.html
  104. // @include *://www.zashu.net/books/*/*/*.html
  105. // @include *://www.yunlaige.com/html/*/*/*.html
  106. // @include *://www.cfwx.net/files/article/html/*/*/*.html
  107. // @include *://www.qiuwu.net/html/*/*/*.html
  108. // @include *://www.fengwu.org/html/*/*/*.html
  109. // @include *://www.wenxue8.org/html/*/*/*.html
  110.  
  111. // @include *://www.xs84.com/*_*/*
  112. // @include *://www.geiliwx.com/GeiLi/*/*/*.shtml*
  113. // @include *://www.123yq.com/read/*/*/*.shtml
  114. // @include *://www.123yq.org/read/*/*/*.shtml
  115. // @include *://www.dhzw.com/book/*/*/*.html
  116. // *://www.du00.cc/read/*/*/*.html
  117. // @include *://www.aszw.com/book/*/*/*.html
  118. // @include *://www.xsbashi.com/*_*/
  119. // @include *://www.vodtw.com/Html/Book/*/*/*.html
  120. // @include *://www.fhxs.com/read/*/*/*.shtml
  121. // @include *://www.snwx.com/book/*/*/*.html
  122.  
  123. // www.sodu.so
  124. // @include *://www.jiaodu8.com/*/*/*/*.html
  125. // @include *://www.fktxt.com/book/*/*.html
  126. // @include *://www.186s.cn/files/article/html/*/*/*.html
  127. // @include *://www.6xs.cn/xs/*/*/*.html
  128. // @include *://www.chaojiqiangbing.com/book/*/*/*.html
  129. // @include *://book.moka123.com/book/*/*/*.html
  130. // @include *://www.suimeng.com/files/article/html/*/*/*.html
  131. // @include *://www.hao662.com/haoshu/*/*/*.html
  132.  
  133. //www.verydu.net
  134. // http://www.yawen8.com/*/*/*.html
  135. // @include *://www.tsxs.cc/files/article/html/*/*/*.html
  136. // @include *://www.ziyuge.com/*/*/*/*/*.html
  137.  
  138. // 其它网站
  139. // @include *://book.sfacg.com/Novel/*/*/*/
  140. // @include *://www.7dsw.com/book/*/*/*.html
  141. // @include *://www.d586.com/*/*/
  142. // @include *://www.bookgew.com/Html/Book/*/*/*.htm
  143. // @include *://read.shuhaha.com/Html/Book/*/*/*.html
  144. // @include *://www.shuhaha.com/Html/Book/*/*/*.html
  145. // @include *://www.biqi.me/files/article/html/*/*/*.html
  146. // @include *://www.ttzw.com/book/*/*.html
  147. // @include *://www.uukanshu.com/*/*/*.html
  148. // @include *://www.uukanshu.net/*/*/*.html
  149. // @include *://www.173ed.com/read/*/*.html
  150. // @include *://www.a240.com/read/*/*.html
  151. // @include *://www.zhuishu.com/*/*.html
  152. // @include *://www.shuangde.cc/*/*.html
  153. // @include *://www.shenmaxiaoshuo.com/ml-*-*/
  154. // @include *://www.86kankan.com/read/*/*.html
  155. // @include *://www.fkzww.com/*/*/*.html
  156. // @include *://www.151kan.com/*/*/*/*.html
  157. // @include *://www.bookabc.net/*/*/*.html
  158. // @include *://www.xshuotxt.com/*/*/*/*.html
  159. // @include *://www.doulaidu.com/*/*/*.html
  160. // @include *://www.d586.com/*/*/
  161. // @include *://www.kanshu.la/book/*/*html
  162. // @include *://www.wtcxs.com/files/article/html/*/*/*.html
  163. // @include *://www.5du5.com/book/*/*/*.html
  164. // @include *://book.kanunu.org/*/*/*.html
  165. // @include *://www.kanunu8.com/book*/*.html
  166. // @include *://paitxt.com/*/*/*.html
  167. // @include *://www.shunong.com/yuedu/*/*/*.html
  168. // @include *://book.yayacms.com/*/book_*_*.html
  169. // @include *://www.yqhhy.cc/*/*/*.html
  170. // @include *://www.nuoqiu.com/static/*/*.html
  171. // @include *://www.17yue.com/*/*/*.html
  172. // @include *://dukeba.com/book/*/*/*.shtml
  173. // @include *://www.wenchangshuyuan.com/html/*/*/*.html
  174. // @include *://www.pofeng.net/xiaoshuo/*/*.html
  175. // @include *://www.epzww.com/book/*/*
  176. // @include *://*.xiaoshuokan.com/haokan/*/*.html
  177. // @include *://www.wobudu.com/*/*.html
  178. // @include *://www.qb5.com/xiaoshuo/*/*/*.html
  179. // @include *://www.x23us.com/html/*/*/*.html
  180. // @include *://www.23us.com/html/*/*/*.html
  181. // @include *://www.23us.cc/html/*/*/*.html
  182. // @include *://www.23wx.com/html/*/*/*.html
  183. // @include *://www.xs222.com/html/*/*/*.html
  184. // @include *://www.bixiage.com/*/*/*/*.html
  185. // @include *://www.ranwenxiaoshuo.com/files/article/html/*/*/*.html
  186. // @include *://www.ranwenxiaoshuo.com/*/*-*-*.html
  187. // @include *://www.bjxiaoshuo.com/bjxs-*-*/
  188. // @include *://www.59shuku.com/xiaoshuo/*/*.htm
  189. // @include *://www.16kbook.org/Html/Book/*/*/*.shtml
  190. // @include *://www.dixiaoshuo.com/Html/*/*.html
  191. // @include *://www.nieshu.com/Book/*/*/*.shtml
  192. // @include *://www.tlxsw.com/files/article/html/*/*/*.html
  193. // @include *://www.1kanshu.com/files/article/html/*/*/*.html
  194. // @include *://www.uutxt.org/book/*/*/*.html
  195. // @include *://www.5800.cc/*/*/*/*.html
  196. // @include *://www.biquge.com/*/*.html
  197. // @include *://www.biquge.la/book/*/*.html
  198. // @include *://www.biquge.com.tw/*/*.html
  199. // @include *://www.biquge.tw/*_*/*.html
  200. // @include *://www.biqugezw.com/*/*.html
  201. // @include *://www.biquzi.com/*_*/*.html
  202. // @include *://www.qududu.com/book/*/*/*.html
  203. // @include *://www.free97.cn/book/*/*/*.html
  204. // @include *://www.122s.com/book/*/*.html
  205. // @include *://www.123du.net/dudu-*/*/*.html
  206. // @include *://www.123du.cc/dudu-*/*/*.html
  207. // @include *://www.123du.net/book/*/*.html
  208. // @include *://www.hwafa.com/*/*.html
  209. // @include *://www.qmshu.com/html/*/*/*.html
  210. // @include *://dlzw.cc/article-*-*.html
  211. // @include *://www.shushu5.com/read/*/*.html
  212. // @include *://www.xiaoyanwenxue.com/files/article/html/*/*/*.html
  213. // @include *://www.3gsc.com.cn/bookcon/*_*_*
  214. // @include *://www.bj-ibook.cn/book/*/*/*.htm
  215. // @include *://www.baoliny.com/*/*.html
  216. // @include *://www.dajiadu.net/files/article/html/*/*/*.html
  217. // @include *://www.yankuai.com/files/article/html/*/*/*.html
  218. // @include *://www.docin.net/*/*.html
  219. // @include *://www.dushuge.net/html/*/*/*.html
  220. // @include *://www.xunshu.org/xunshu/*/*/*.html
  221. // @include *://www.moneyren.com/book/*/*/*.shtml
  222. // @include *://wemaxfilipino.com/*/*/*.html
  223. // @include *://www.85618892.cn/xiaoshuo/*/*/*.shtml
  224. // @include *://www.bookba.net/Html/Book/*/*/*.html
  225. // @include *://www.moksos.com/*/*/*.html
  226. // @include *://dudu8.net/novel/*/*/*.html
  227. // @include *://www.dawenxue.net/html/*/*/*.html
  228. // @include *://www.yanmoxuan.org/book/*/*/*.html
  229. // @include *://www.duyidu.com/xiaoshuo/*/*/*.html
  230. // @include *://www.69zw.com/xiaoshuo/*/*/*.html
  231. // @include *://www.kan7.com/xiaoshuo/*/*/*.html
  232. // @include *://www.laishu.com/book/*/*/*.shtml
  233. // @include *://www.bxwx.org/b/*/*/*.html
  234. // @include *://www.bxzw.org/*/*/*/*.shtml
  235. // @include *://www.360118.com/html/*/*/*.html
  236. // @include *://www.59to.com/files/article/xiaoshuo/*/*/*.html
  237. // @include *://www.dyzww.com/cn/*/*/*.html
  238. // @include *://www.9wh.net/*/*/*.html
  239. // @include *://www.luoqiu.net/html/*/*/*.html
  240. // @include *://www.luoqiu.com/html/*/*/*.html
  241. // @include *://www.epzw.com/files/article/html/*/*/*.html
  242. // @include *://www.dashubao.co/book/*/*/*.html
  243. // @include *://b.faloo.com/p/*/*.html
  244. // @include *://www.baikv.com/*/*.html
  245. // @include *://www.66721.com/*/*/*.html
  246. // @include *://www.3dllc.com/html/*/*/*.html
  247. // @include *://www.xstxt.com/*/*/
  248. // @include *://www.zzzcn.com/3z*/*/
  249. // @include *://www.zzzcn.com/modules/article/App.php*
  250. // @include *://www.nilongdao.com/book/*/*/*.html
  251. // @include *://xs321.net/*/*/
  252. // @include *://read.guanhuaju.com/files/article/html/*/*/*.html
  253. // @include *://www.book108.com/*/*/*.html
  254. // @include *://5ycn.com/*/*/*.html
  255. // @include *://www.zhaoxiaoshuo.com/chapter-*-*-*/
  256. // @include *://*zbzw.com/*/*.html
  257. // @include *://manghuangji.cc/*/*.html
  258. // @include *://www.aiqis.com/*/*.html
  259. // @include *://www.fftxt.net/book/*/*.html
  260. // @include *://www.5kwx.com/book/*/*/*.html
  261. // @include *://www.uuxiaoshuo.net/html/*/*/*.html
  262. // @include *://www.sanyyo.org/*.html
  263. // @include *://www.chinaisbn.com/*/*/*.html
  264. // @include *://www.caihongwenxue.com/Html/Book/*/*/*.html
  265. // @include *://www.shushuw.cn/shu/*/*.html
  266. // @include *://www.78xs.com/article/*/*/*.shtml
  267. // @include *://www.woaixiaoshuo.com/xiaoshuo/*/*/*.html
  268. // @include *://www.ty2016.com/book/*/*.html
  269. // @include *://wx.ty2016.com/*/*/*.html
  270. // @include *://www.my285.com/*/*/*/*.htm
  271. // @include *://www.5858xs.com/html/*/*/*.html
  272. // @include *://book.58xs.com/html/*/*/*.html
  273. // @include *://book.mihua.net/*/*/*/*.html
  274. // @include *://www.hjwzw.com/Book/Read/*,*
  275. // @include *://www.hjwzw.com/Book/Read/*_*
  276. // @include *://www.365essay.com/*/*.htm
  277. // @include *://www.gengxin8.com/read/*/*.html
  278. // @include *://www.365xs.org/books/*/*/*.html
  279. // @include *://www.wuruo.com/files/article/html/*/*/*.html
  280. // @include *://*.8shuw.net/book/*/*.html
  281. // @include *://www.pashuw.com/BookReader/*/*.html
  282. // @include *://read.shanwen.com/html/*/*/*.html
  283. // @include *://www.qqxs.cc/xs/*/*/*.html
  284. // @include *://www.69shu.com/txt/*/*
  285. // @include *://www.e8zw.com/book/*/*/*.html
  286. // @include *://www.8535.org/*/*/*.html*
  287. // @include *://www.yfzww.com/books/*/*/*.htm
  288. // @include *://www.lewen8.com/lw*/*.html
  289. // @include *://www.pinwenba.com/read/*/*.html
  290. // @include *://down1.qidian.com/bookall/*.htm*
  291. // @include *://www.77nt.com/*/*.html
  292. // @include *://www.quanbenba.com/yuedu/*/*/*.html
  293. // @include *://www.sto.cc/book-*-*.html
  294. // @include *://www.151xs.com/wuxiazuoxiong/*/chapter/*/
  295. // @include *://www.qududu.net/book/*/*/*.html
  296. // @include *://www.qingdou.cc/chapter*
  297. // @include *://www.shuyuewu.com/kan*
  298. // @include *://www.1553.net/*/*
  299. // @include *://www.269s.com/*/*/*
  300. // @include *://www.33yq.com/read/*/*/*.shtml
  301. // @include *://233yq.com/xiaoshuo/*.html
  302. // @include *://www.50zw.co/book_*/*.html
  303. // @include *://www.bqg5200.com/xiaoshuo/*/*/*.html
  304. // @include *://www.50zw.la/book_*/*.html
  305. // @include *://www.qu.la/book/*/*.html
  306. // @include *://www.luoqiu.com/read/*/*.html
  307. // @include *://www.54tushu.com/book_library/chaptershow/theId/*.html
  308. // @include *://www.snwx8.com/book/*/*/*.html
  309. // @include *://read.qidian.com/chapter/*
  310. // @include *://www.23zw.me/olread/*/*/*.html
  311. // @include *://www.piaotian.com/html/*/*/*.html
  312. // @include *://www.piaotian.net/html/*/*/*.html
  313. // @include *://www.dhzw.org/book/*/*/*.html
  314. // @include *://www.biqiuge.com/book/*/*.html
  315. // @include *://www.baquge.com/files/article/html/*/*/*.html
  316. // @include *://www.baquge.tw/files/article/html/*/*/*.html
  317. // @include *://www.qu.la/book/*/*.html
  318. // @include *://www.bxwx9.org/b/*/*/*.html
  319. // @include *://www.miaobige.com/*/*/*.html
  320. // @include *://www.52dsm.com/chapter/*/*.html
  321. // @include *://www.banfusheng.com/chapter/*/*.html
  322. // @include *://www.remenxs.com/du_*/*/
  323. // @include *://www.shuhai.com/read/*/*.html
  324. // @include *://www.hbooker.com/chapter/book_chapter_detail/*
  325. // @include *://www.mht.la/*/*/*.html
  326. // @include *://www.paomov.com/*/*/*.html
  327. // @include *://www.moyuanwenxue.com/xiaoshuo/*/*/*.htm
  328. // @include *://www.ggdown.com/modules/article/reader.php?aid=*
  329. // @include *://www.daizhuzai.com/*/*.html
  330. // @include *://www.mywenxue.com/xiaoshuo/*/*/*.htm
  331. // @include *://www.yueduyue.com/*/*.html
  332. // @include *://www.67shu.com/*/*/*.html
  333. // @include *://www.wangshuge.com/books/*/*/*.html
  334. // @include *://www.23sw.net/*/*/*.html
  335. // @include *://www.ybdu.com/xiaoshuo/*/*/*.html
  336. // @include *://www.shudaizi.org/book/*/*.html
  337. // @include *://www.ymoxuan.com/book/*/*/*.html
  338. // @include *://www.67shu.com/*/*/*.html
  339. // @include *://www.bookxuan.com/*/*.html
  340. // @include *://www.2kxs.com/xiaoshuo/*/*.html
  341. // @include *://www.88dushu.com/xiaoshuo/*/*/*.html
  342. // @include *://www.wutuxs.com/html/*/*/*.html
  343.  
  344. // 移动版
  345. // @include *://wap.yc.ireader.com.cn/book/*/*/
  346. // @include *://m.jjwxc.net/book2/*/*
  347.  
  348. // @exclude */List.htm
  349. // @exclude */List.html
  350. // @exclude */List.shtml
  351. // @exclude */index.htm
  352. // @exclude */index.html
  353. // @exclude */index.shtml
  354. // @exclude */Default.htm
  355. // @exclude */Default.html
  356. // @exclude */Default.shtml
  357.  
  358. // @run-at document-end
  359. // ==/UserScript==
  360.  
  361.  
  362. var isChrome = !!window.chrome;
  363. var isFirefox = navigator.userAgent.indexOf("Firefox") != -1;
  364. var isWindows = (navigator.platform == "Win32") || (navigator.platform == "Windows");
  365.  
  366. // 其它设置
  367. var config = {
  368. soduso: false, // www.sodu.so 跳转
  369. content_replacements: true, // 小说屏蔽字修复
  370. fixImageFloats: true, // 图片居中修正
  371. paragraphBlank: true, // 统一段落开头的空格为 2个全角空格
  372. end_color: "#666666", // 最后一页的链接颜色
  373. PRELOADER: true, // 提前预读下一页
  374.  
  375. xhr_time: 15 * 1000,
  376. dumpContentMinLength: 3, // 检测重复内容的最小行数
  377. };
  378.  
  379. var READER_AJAX = "reader-ajax"; // 内容需要 ajax 的 className
  380.  
  381.  
  382. // Unicode/2000-2FFF:http://zh.wikibooks.org/wiki/Unicode/2000-2FFF
  383. // Unicode/F000-FFFF:https://zh.wikibooks.org/wiki/Unicode/F000-FFFF
  384.  
  385. // replace 中的简写
  386. var CHAR_ALIAS = {
  387. '\\P': '[\\u2000-\\u2FFF\\u3004-\\u303F\\uFE00-\\uFF60\\uFFC0-\\uFFFF]', // 小说中添加的特殊符号
  388. };
  389.  
  390. // ===== 自动尝试的规则 =====
  391. var Rule = {
  392. titleRegExp: /第?\s*[一二两三四五六七八九十○零百千万亿0-91234567890]{1,6}\s*[章回卷节折篇幕集]/i,
  393. titleReplace: /^章节目录|^文章正文|^正文|全文免费阅读|最新章节|\(文\)/,
  394.  
  395. // nextRegExp: /[上前下后][一]?[页张个篇章节步]/,
  396. nextSelector: "a[rel='next'], a:contains('下一页'), a:contains('下一章'), a:contains('下一节'), a:contains('下页')",
  397. prevSelector: "a[rel='prev'], a:contains('上一页'), a:contains('上一章'), a:contains('上一节'), a:contains('上页')",
  398. // 忽略的下一页链接,匹配 href
  399. nextUrlIgnore: [
  400. /(?:(?:index|list|last|LastPage|end)\.)|BuyChapterUnLogin|^javascript:/i,
  401.  
  402. /BookReader\/vip,/i,
  403. /BookReader\/LastPageNew\.aspx/i,
  404. /read\.qidian\.com\/BookReader\/\d+,0\.aspx$/i,
  405. /read\.qidian\.com\/$/i,
  406. /free\.qidian\.com\/Free\/ShowBook\.aspx\?bookid=/i,
  407.  
  408. /book\.zongheng\.com\/readmore/i,
  409. /www\.shumilou\.com\/to-n-[a-z]+-\d+\.html/i,
  410. /\/0\.html$/i,
  411. ],
  412. nextUrlCompare: /\/\d+(_\d+)?\.html?$|\/wcxs-\d+-\d+\/$|chapter-\d+\.html$|\/\d+_\d+\/$/i, // 忽略的下一页链接(特殊),跟上一页比较
  413.  
  414. // 按顺序匹配,匹配到则停止。econtains 完全相等
  415. indexSelectors: ["a[href='index.html']", "a:contains('返回书目')", "a:contains('章节目录')", "a:contains('章节列表')",
  416. "a:econtains('最新章节')", "a:contains('回目录')","a:contains('回书目')", "a:contains('目 录')", "a:contains('目录')"],
  417.  
  418. contentSelectors: ["#pagecontent", "#contentbox", "#bmsy_content", "#bookpartinfo", "#htmlContent",
  419. "#text_area", "#chapter_content", "#chapterContent", "#partbody", "#BookContent",
  420. "#article_content", "#BookTextRead", "#booktext", "#BookText", "#readtext", "#readcon", "#text_c", "#txt_td", "#TXT", "#txt", "#zjneirong",
  421. ".novel_content", ".readmain_inner", ".noveltext", ".booktext", ".yd_text2",
  422. "#contentTxt", "#oldtext", "#a_content", "#contents", "#content2", "#contentts", "#content1", "#content", ".content"
  423. ],
  424.  
  425. // (测试)尝试查找书名。顶部章节导航的最后一个链接可能是书名。
  426. bookTitleSelector: ".h1title > .shuming > a[title], .chapter_nav > div:first > a:last",
  427.  
  428. contentRemove: "script, iframe", // 内容移除选择器
  429. removeLineRegExp: /<p>[ \s。;,!\.∷〖]*<\/p>/g, // 移除只有一个字符的行
  430.  
  431. // 以下不常改
  432. replaceBrs: /(<br[^>]*>[ \n\r\t]*){1,}/gi, // 替换为<p>
  433. };
  434.  
  435. // ===== 自定义站点规则 =====
  436. Rule.specialSite = [
  437. // 详细版规则示例。注:该网站已无法访问。
  438. {siteName: "泡书吧", // 站点名字... (可选)
  439. url: "^https?://www\\.paoshu8\\.net/Html/\\S+\\.shtm$", // // 站点正则... (~~必须~~)
  440.  
  441. // 获取标题
  442. titleReg: /(.*?)最新章节 [-_\\\/](.*?)[-_\/].*/, // 书籍标题、章节标题正则 (可选)
  443. titlePos: 0, // 书籍标题位置:0 或 1 (可选,默认为 0)
  444. titleSelector: "#title h1",
  445.  
  446. indexSelector: "a:contains('回目录')", // 首页链接 jQuery 选择器 (不填则尝试自动搜索)
  447. prevSelector: "a:contains('翻上页')", // 上一页链接 jQuery 选择器 (不填则尝试自动搜索)
  448. nextSelector: "a:contains('翻下页')", // 下一页链接 jQuery 选择器 (不填则尝试自动搜索)
  449.  
  450. // 获取内容
  451. contentSelector: "#BookText", // 内容 jQuery 选择器 (不填则尝试自动搜索)
  452. useiframe: false, // (可选)下一页加载是否使用 iframe
  453. // mutationSelector: "#chaptercontainer", // (可选)内容生成监视器
  454. // 对内容的处理
  455. contentHandle: false, // (可选)是否对内容进行特殊处理,诸如拼音字修复等,诸如起点等网站可禁用
  456. fixImage: true, // (可选),图片居中,不分大小
  457. contentReplace: /(\*W|(w|\(w).{10,25}(吧\*|)|\))|看小说就上|本书首发|泡.{1,6}吧|百度搜索阅读最新最全的小说|http:\/\/www.paoshu8.com\/|无弹窗/g, // 需要移除的内容正则 (可选)
  458. contentPatch: function(fakeStub){ // (可选)内容补丁。解决翻页是脚本的情况
  459. var $next = fakeStub.find('#LinkMenu');
  460. $next.html($next.html().replace(/<script>ShowLinkMenu.*?(<a.*?a>).*?(<a.*?a>).*?script>/,'$1$2') +
  461. '<a href=\'List.shtm\'>回目录</a>');
  462. }
  463. },
  464. {siteName: '起点新版-阅文',
  465. url: '^https?://read\\.qidian\\.com/chapter/.*',
  466. bookTitleSelector: '#bookImg',
  467. titleSelector: 'h3.j_chapterName',
  468.  
  469. prevSelector: '#j_chapterPrev',
  470. nextSelector: '#j_chapterNext',
  471. indexSelector: function(obj) {
  472. var url = obj.find(".chapter-control a:contains('目录')").attr('href');
  473. return url;
  474. },
  475.  
  476. contentSelector: '.read-content.j_readContent',
  477. contentRemove: '',
  478. contentReplace: [
  479. '手机用户请到m.qidian.com阅读。',
  480. '起点中文网www.qidian.com欢迎广大书友光临阅读,最新、最快、最火的连载作品尽在起点原创!.*'
  481. ],
  482. },
  483. // 特殊站点,需再次获取且跨域。添加 class="reader-ajax",同时需要 src, charset
  484. {siteName: '起点新版',
  485. url: '^https?://read\\.qidian\\.com/BookReader/.*\\.aspx',
  486. bookTitleSelector: '.story_title .textinfo a:nth-child(1)',
  487. titleSelector: '.story_title h1',
  488.  
  489. prevSelector: '#pagePrevRightBtn',
  490. nextSelector: '#pageNextRightBtn',
  491. indexSelector: function() {
  492. return location.href.replace(/,.*?\.aspx$/, '.aspx').replace('BookReaderNew', 'BookReader');
  493. },
  494.  
  495. mutationSelector: "#chaptercontainer", // 内容生成监视器
  496. mutationChildCount: 1,
  497. contentSelector: '#content, .bookreadercontent',
  498. contentRemove: 'a[href="http://www.qidian.com"]',
  499. contentReplace: [
  500. '手机用户请到m.qidian.com阅读。'
  501. ],
  502. contentPatch: function(fakeStub){
  503. fakeStub.find('script[src$=".txt"]').addClass('reader-ajax');
  504. },
  505. },
  506. {siteName: "起点中文、起点女生、起点文学",
  507. url: "^https?://(www|read|readbook|wwwploy|cga|big5ploy)\\.(qidian|qdmm|qdwenxue)\\.com/BookReader/.*",
  508. // titleReg: "小说:(.*?)(?:独家首发)/(.*?)/.*",
  509. titleSelector: "#lbChapterName",
  510. bookTitleSelector: ".page_site > a:last",
  511. // contentSelector: "#hdContent",
  512. nextUrl: function($doc){ // 为了避免起点某次改版后把1页拆成2页,然后造成重复载入第一页的情况
  513. var html = $doc.find('script:contains(nextpage=)').html();
  514. if (!html) return;
  515. var m = html.match(/nextpage='(.*?)'/);
  516. if (m) return m[1];
  517. },
  518. prevUrl: function($doc){
  519. var html = $doc.find('script:contains(prevpage=)').html();
  520. if (!html) return;
  521. var m = html.match(/prevpage='(.*?)'/);
  522. if (m) return m[1];
  523. },
  524. contentReplace: {
  525. "\\[img=(.*)\\]": "<p><img src='$1'></p><p>",
  526. "\\[+CP.*(http://file.*\\.jpg)\\]+": "<p><img src='$1'></p><p>",
  527. "\\[bookid=(\\d+),bookname=(.*?)\\]": "<a href='http://www.qidian.com/Book/$1.aspx'>$2</a>",
  528. "www.cmfu.com发布|起点中文网www.qidian.com欢迎广大书友光临阅读.*": "",
  529. '(<p>\\s+)?<a href="?http://www.(?:qidian|cmfu).com"?>起点中文网.*': '',
  530.  
  531. '([\\u4e00-\\u9fa5])[%¥]+([\\u4e00-\\u9fa5])': '$1$2', // 屏蔽词修正,例如:风%%骚
  532. },
  533. contentRemove: "span[id^='ad_'], .read_ma",
  534. contentPatch: function(fakeStub){
  535. fakeStub.find('script[src$=".txt"]').addClass('reader-ajax');
  536. },
  537. },
  538. {siteName: "起点中文网免费频道",
  539. url: "^https?://free\\.qidian\\.com/Free/ReadChapter\\.aspx",
  540. titleSelector: ".title > h3",
  541. bookTitleSelector: ".site_rect > a:last",
  542. contentSelector: "#chapter_cont, #content",
  543. contentRemove: ".nice_books",
  544. contentReplace: {
  545. "\\[img=(.*)\\]": "<p><img src='$1'></p><p>",
  546. "\\[+CP.*(http://file.*\\.jpg)\\]+": "<p><img src='$1'></p><p>",
  547. "\\[bookid=(\\d+),bookname=(.*?)\\]": "<a href='http://www.qidian.com/Book/$1.aspx'>$2</a>",
  548. "www.cmfu.com发布|起点中文网www.qidian.com欢迎广大书友光临阅读.*": "",
  549. '(<p>\\s+)?<a href="?http://www.(?:qidian|cmfu).com"?>起点中文网.*': ''
  550. },
  551. contentPatch: function(fakeStub) {
  552. fakeStub.find('#chapter_cont, #content > script:first').addClass('reader-ajax');
  553. }
  554. },
  555. {siteName: "创世中文网",
  556. url: "^https?://(?:chuangshi|yunqi)\\.qq\\.com/|^http://dushu\\.qq\\.com/read.html\\?bid=",
  557. bookTitleSelector: '.bookNav > a:last()',
  558. titleSelector: '.story_title > h1',
  559.  
  560. nextSelector: '#rightFloatBar_nextChapterBtn',
  561. prevSelector: '#rightFloatBar_preChapterBtn',
  562. indexSelector: function() {
  563. var m = location.href.match(/\/bk\/\w+\/(.*?)-r-\d+.html/);
  564. if (m) {
  565. return 'http://chuangshi.qq.com/bk/ls/' + m[1] + '-l.html';
  566. } else {
  567. return 'http://chuangshi.qq.com/bk/ls/' + unsafeWindow.bid + '-l.html';
  568. }
  569. },
  570.  
  571. contentSelector: ".bookreadercontent",
  572. contentHandle: false,
  573. mutationSelector: "#chaptercontainer", // 内容生成监视器,第一次运行用到,以后用下面的 getContent 函数
  574. mutationChildCount: 1,
  575. startFilter: function() {
  576. // 下一页需要提前加 1
  577. unsafeWindow.uuid = parseInt(unsafeWindow.uuid) + 1 + '';
  578. },
  579. getContent: function($doc, callback) { // this 指 parser
  580. function _getReadPageUrl(uuid) {
  581. if (!uuid) {
  582. return 'javascript:void(0);';
  583. }
  584. var url = location.href.replace(/[?|#].*/gi, '');
  585. return url.replace(/(\d)+\.html/, uuid + '.html');
  586. }
  587.  
  588. function getPageUrlHtml(preChapterUUID, nextChapterUUID) {
  589. var preReadUrl = _getReadPageUrl(preChapterUUID),
  590. nextReadUrl = _getReadPageUrl(nextChapterUUID);
  591.  
  592. return '<a id="rightFloatBar_preChapterBtn" href="' + preReadUrl + '">上一页</a>' +
  593. '<a id="rightFloatBar_nextChapterBtn" href="' + nextReadUrl + '">下一页</a>' + '\n';
  594. }
  595.  
  596. var done = function (data) {
  597. unsafeWindow.uuid = data.nextuuid; // 给下一页用
  598.  
  599. callback({
  600. html: getPageUrlHtml(data.preuuid, data.nextuuid) + data.Content
  601. });
  602. };
  603. exportFunction(done, unsafeWindow, { defineAs: "gm_mnr_cs_callback" });
  604.  
  605. unsafeWindow.CS.page.read.main.getChapterContent(unsafeWindow.bid, unsafeWindow.uuid,
  606. unsafeWindow.gm_mnr_cs_callback);
  607. },
  608. },
  609. {siteName: "纵横中文网",
  610. url: "^https?://book\\.zongheng\\.com/\\S+\\/\\d+\\.html$",
  611. contentHandle: false,
  612. // titleReg: "(.*?)-(.*)",
  613. titleSelector: "em[itemprop='headline']",
  614. bookTitleSelector: ".tc h2",
  615. contentSelector: '#readerFt',
  616. contentPatch: function(fakeStub){
  617. fakeStub.find('.watermark').remove();
  618. // 给第几章添加空格
  619. var chapterTitle = fakeStub.find(".tc > h2").text();
  620. var chapterTitle1 = fakeStub.find(".tc > h2 em").text();
  621. if(chapterTitle1) {
  622. chapterTitle = chapterTitle.replace(chapterTitle1, " ") + chapterTitle1;
  623. }
  624. fakeStub.find("title").text(
  625. fakeStub.find(".tc > h1").text() + "-" + chapterTitle
  626. );
  627. }
  628. },
  629. {siteName: "晋江文学网",
  630. url: /^https?:\/\/www\.jjwxc\.net\/onebook\.php\S*/,
  631. titleReg: /《(.*?)》.*[ˇ^](.*?)[ˇ^].*/,
  632. titlePos: 0,
  633. titleSelector: 'h2',
  634. // bookTitleSelector: 'h1 .bigtext',
  635. indexSelector: ".noveltitle > h1 > a",
  636. contentSelector: '.noveltext',
  637. contentHandle: false,
  638. contentRemove: 'font[color], hr',
  639. contentPatch: function(fakeStub){
  640. // fakeStub.find('h2').remove();
  641. fakeStub.find('#six_list, #sendKingTickets').parent().remove();
  642. fakeStub.find("div.noveltext").find("div:first, h1, div[style]:last").remove();
  643. }
  644. },
  645. {siteName: '晋江文学城_手机版',
  646. url: '^http://m\\.jjwxc\\.net/book2/\\d+/\\d+',
  647. titleReg: /《(.*?)》.*[ˇ^](.*?)[ˇ^].*/,
  648. titlePos: 0,
  649. titleSelector: 'h2',
  650. contentSelector: 'div.grid-c > div > .b.module > div:first',
  651. },
  652. {siteName: "潇湘书院",
  653. url: "^https?://www\\.xxsy\\.net/books/.*\\.html",
  654. titleReg: "(.*?) (.*)",
  655. contentSelector: "#zjcontentdiv",
  656. nextSelector: "a[title='阅读下一章节']",
  657. contentHandle: false,
  658. contentReplace: "本书由潇湘书院首发,请勿转载!",
  659. contentPatch: function(fakeStub){
  660. fakeStub.find("title").text(fakeStub.find('meta[name="keywords"]').attr("content"));
  661. }
  662. },
  663. {siteName: "逐浪",
  664. url: /^https?:\/\/book\.zhulang\.com\/.*\.html/,
  665. titleReg: /(.*?)-(.*)/,
  666. contentSelector: "#readpage_leftntxt",
  667. contentHandle: false,
  668. contentPatch: function(fakeStub){
  669. var title = fakeStub.find(".readpage_leftnzgx a:first").text() + "-" +
  670. fakeStub.find(".readpage_leftntit").text();
  671. fakeStub.find('title').html(title);
  672. }
  673. },
  674. {siteName: "小说阅读网",
  675. url: "^https?://www\\.readnovel\\.com/novel/.*\\.html",
  676. titleSelector: ".bgtop > h1",
  677. bookTitleSelector: ".nownav > a:eq(4)",
  678. contentSelector: "#article, .zhangjie",
  679. contentRemove: "div[style], .miaoshu, .zhichi, .bottomAdbanner",
  680. contentPatch: function(fakeStub) {
  681. // 删除标题不需要的部分
  682. fakeStub.find(".bgtop > h1 > span").remove();
  683. }
  684. },
  685. // {siteName: "磨铁",
  686. // url: '^https?://www.motie.com/book/\\d+_\\d+',
  687. // contentSelector: '.page-content'
  688. // },
  689.  
  690. {siteName: "百度贴吧(手动启用)",
  691. enable: false,
  692. url: /^https?:\/\/tieba\.baidu.com\/p\//,
  693. titleSelector: "h1.core_title_txt",
  694. bookTitleSelector: ".card_title_fname",
  695. nextSelector: false,
  696. indexSelector: 'a.card_title_fname',
  697. prevSelector: false,
  698.  
  699. contentSelector: "#j_p_postlist",
  700. contentRemove: "#sofa_post, .d_author, .share_btn_wrapper, .core_reply, .j_user_sign",
  701. style: ".clear { border-top:1px solid #cccccc; margin-bottom: 50px; visibility: visible !important;}", // 显示楼层的分割线
  702. },
  703. // {siteName: "天涯在线书库(部分支持)",
  704. // url: /www\.tianyabook\.com\/.*\.htm/,
  705. // titleSelector: ".max, h1:first",
  706. // bookTitleSelector: "td[width='70%'] > a[href$='index.htm']",
  707. // contentSelector: "div > span.middle, #texts",
  708. // contentHandle: false,
  709. // },
  710. {siteName: "天涯书库",
  711. url: /www\.ty2016\.com\/.+\.html$/,
  712. titleSelector: "h1",
  713. bookTitleSelector: ".crumb a[href='./']",
  714.  
  715. indexSelector: "td a[href='./']",
  716.  
  717. contentSelector: "#main",
  718. contentRemove: '.crumb, table',
  719. contentHandle: false,
  720. },
  721.  
  722. // {siteName: "易读",
  723. // url: "^https?://www.yi-see.com/read_\\d+_\\d+.html",
  724. // contentSelector: 'table[width="900px"][align="CENTER"]'
  725. // },
  726. {siteName: "燃文",
  727. url: /^https?:\/\/www\.(?:ranwena?\.(cc|net|com)|64mi\.com)\/.*\.html$/,
  728. titleReg: /(.*?)-(.*?)-燃文/,
  729. contentSelector: "#oldtext, #contents",
  730. contentRemove: "div[style], script",
  731. contentReplace: [
  732. /\((&nbsp;)*\)/g,
  733. /最快更新78小说|\(?百度搜.\)|访问下载tXt小说|百度搜\|索|文\|学|文学全文.字手打|\((&nbsp;)+|牛过中文..hjsm..首发.转载请保留|\[本文来自\]|♠思♥路♣客レ|※五月中文网 5y ※|无错不跳字|最快阅读小说大主宰.*|跟我读H-u-n 请牢记|非常文学|关闭&lt;广告&gt;|w w.*|”娱乐秀”|更多精彩小[说說].*|高速更新/g,
  734. /[\(\*◎]*(百度搜)?文.?[學学].?[馆館][\)\*)]*|\(百度搜\)/g,
  735. /提供无弹窗全文字在线阅读.*|高速首发.*如果你觉的本章节还不错的话.*/g,
  736. /书网∷更新快∷无弹窗∷纯文字∷.t!。/g,
  737. /一秒记住,本站为您提供热门小说免费阅读。/g,
  738. /\(更新速度最快记住即可找到\)|芒果直播网|.mgzhibo .|去 读 读|看小说就到/g,
  739. ]
  740. },
  741. {siteName: "燃文小说网",
  742. url: "^https?://www\\.ranwenxiaoshuo\\.com/files/article/html/\\d+/\\d+/\\d+\\.html|http://www\\.ranwenxiaoshuo\\.com/\\w+/\\w+-\\d+-\\d+\\.html",
  743. titleReg: /(.*?)最新章节(.*?)在线阅读.*/,
  744. contentSelector: "#fontsize",
  745. contentReplace: "天才一秒记住[\\s\\S]+为您提供精彩小说阅读。",
  746. },
  747. {siteName: "燃文小说",
  748. url: "^https?://www\\.ranwen\\.net/files/article/\\d+/\\d+/\\d+\\.html",
  749. titleReg: "(\\S+) (.*) - 燃文小说",
  750. contentReplace: "\\(.*燃文小说.*\\)|【 注册(不可用)会员可获私人书架,看书更方便!永久地址: 】 "
  751. },
  752. {siteName: "无错小说网",
  753. url: /^https?:\/\/www\.(?:wcxiaoshuo|xiaoshuoz|quledu)\.com\/wcxs[-\d]+\//,
  754. titleReg: /(.*?)最新章节.*?-(.*?)-.*/,
  755. titlePos: 1,
  756. nextSelector: "a#htmlxiazhang",
  757. prevSelector: "a#htmlshangzhang",
  758. indexSelector: "a#htmlmulu",
  759. contentReplace: [
  760. 'ilo-full-src="\\S+\\.jpg" ',
  761. {
  762. '(<center>)?<?img src..(http://www.wcxiaoshuo.com)?(/sss/\\S+\\.jpg).(>| alt."\\d+_\\d+_\\d*\\.jpg" />)(</center>)?': '$3',
  763. "/sss/da.jpg": "打", "/sss/maws.jpg": "吗?", "/sss/baw.jpg": "吧?", "/sss/wuc.jpg": "无", "/sss/maosu.jpg": ":“", "/sss/cuow.jpg": "错", "/sss/ziji.jpg": "自己", "/sss/shenme.jpg": "什么", "/sss/huiqub.jpg": "回去", "/sss/sjian.jpg": "时间", "/sss/zome.jpg": "怎么", "/sss/zhido.jpg": "知道", "/sss/xiaxin.jpg": "相信", "/sss/faxian.jpg": "发现", "/sss/shhua.jpg": "说话", "/sss/dajiex.jpg": "大姐", "/sss/dongxi.jpg": "东西", "/sss/erzib.jpg": "儿子", "/sss/guolair.jpg": "过来", "/sss/xiabang.jpg": "下班", "/sss/zangfl.jpg": "丈夫", "/sss/dianhua.jpg": "电话", "/sss/huilaim.jpg": "回来", "/sss/xiawu.jpg": "下午", "/sss/guoquu.jpg": "过去", "/sss/shangba.jpg": "上班", "/sss/mingtn.jpg": "明天", "/sss/nvrenjj.jpg": "女人", "/sss/shangwo.jpg": "上午", "/sss/shji.jpg": "手机", "/sss/xiaoxinyy.jpg": "小心", "/sss/furene.jpg": "夫人", "/sss/gongzih.jpg": "公子", "/sss/xiansg.jpg": "先生", "/sss/penyouxi.jpg": "朋友", "/sss/xiaoje.jpg": "小姐", "/sss/xifup.jpg": "媳妇", "/sss/nvxudjj.jpg": "女婿", "/sss/xondi.jpg": "兄弟", "/sss/lagong.jpg": "老公", "/sss/lapo.jpg": "老婆", "/sss/meimeid.jpg": "妹妹", "/sss/jiejiev.jpg": "姐姐", "/sss/jiemeiv.jpg": "姐妹", "/sss/xianggx.jpg": "相公", "/sss/6shenumev.jpg": "什么", "/sss/cuoaw.jpg": "错", "/sss/fpefnyoturxi.jpg": "朋友", "/sss/vfsjgigarn.jpg": "时间", "/sss/zzhiedo3.jpg": "知道", "/sss/zibjib.jpg": "自己", "/sss/qdonglxi.jpg": "东西", "/sss/hxiapxint.jpg": "相信", "/sss/fezrormre.jpg": "怎么", "/sss/nvdrfenfjfj.jpg": "女人", "/sss/jhiheejeieev.jpg": "姐姐", "/sss/xdifagojge.jpg": "小姐", "/sss/gggugolgair.jpg": "过来", "/sss/maoashu.jpg": ":“", "/sss/gnxnifawhu.jpg": "下午", "/sss/rgtugoqgugu.jpg": "过去", "/sss/khjukilkaim.jpg": "回来", "/sss/gxhigfadnoxihnyy.jpg": "小心", "/sss/bkbskhhuka.jpg": "说话", "/sss/xeieavnfsg.jpg": "先生", "/sss/yuhhfuiuqub.jpg": "回去", "/sss/pdianphua.jpg": "电话", "/sss/fabxianr.jpg": "发现", "/sss/feilrpto.jpg": "老婆", "/sss/gxronfdri.jpg": "兄弟", "/sss/flfaggofng.jpg": "老公", "/sss/tymyigngtyn.jpg": "明天", "/sss/dfshfhhfjfi.jpg": "手机", "/sss/gstjhranjgwjo.jpg": "上午", "/sss/fmgeyimehid.jpg": "妹妹", "/sss/gxgihftutp.jpg": "媳妇", "/sss/cerztifb.jpg": "儿子", "/sss/gfxgigagbfadng.jpg":"下班", "/sss/gstjhranjg.jpg":"下午", "/sss/hjeirerm6eihv.jpg": "姐妹", "/sss/edajihexr.jpg": "大姐", "/sss/wesfhranrrgba.jpg": "上班", "/sss/gfognggzigh.jpg": "公子", "/sss/frurtefne.jpg": "夫人", "/sss/fzagnggfbl.jpg": "丈夫", "/sss/nvdxfudfjfj.jpg": "女婿", "/sss/xdidafnggx.jpg": "相公", "/sss/zenme.jpg": "怎么", "/sss/gongzi.jpg": "公子", "/sss/ddefr.jpg": "",
  764. },
  765. ".*ddefr\\.jpg.*|无(?:错|.*cuoa?w\\.jpg.*)小说网不[少跳]字|w[a-z\\.]*om?|.*由[【无*错】].*会员手打[\\s\\S]*",
  766. "是 由",
  767. "无错不跳字|无广告看着就是爽!|一秒记住.*|全文免费阅读.*|8 9 阅阅 读 网|看小说最快更新|“小#说看本书无广告更新最快”",
  768. "[\\x20-\\x7e》]?无(?:.|&gt;)错.小说.{1,2}[Ww]+.*?[cC][oO][mM]",
  769. "<无-错>",
  770. "—无—错—小说",
  771. "\\+无\\+错\\+",
  772. "&amp;无&amp;错&amp;小说",
  773. "无错小说 www.quled[Uu].com",
  774. ],
  775. contentPatch: function(fakeStub){
  776. // 去除内容开头、结尾的重复标题
  777. var title = fakeStub.find("#htmltimu").text().replace(/\s+/, "\\s*");
  778. var content = fakeStub.find("#htmlContent");
  779. content.find("div[align='center']").remove();
  780. if(title.match(/第\S+章/)){
  781. content.html(content.html().replace(new RegExp(title), "").replace(new RegExp(title), ""));
  782. }
  783. }
  784. },
  785. {siteName: '凤舞文学网',
  786. url: '^https?://www\\.wenxue8\\.org/html/\\d+/\\d+/\\d+\\.html',
  787. contentReplace: [
  788. {
  789. '<img src="/keywd/R43.gif">':'爱', '<img src="/keywd/A13.gif">': '情', '<img src="/keywd/D10.gif">': '床',
  790. '<img src="/keywd/Y19.gif">': '奸', '<img src="/keywd/H21.gif">': '屁', '<img src="/keywd/Z23.gif">': '逼',
  791. '<img src="/keywd/G42.gif">': '身', '<img src="/keywd/Y2.gif">':'性', '<img src="/keywd/D32.gif">':'热',
  792. '<img src="/keywd/I44.gif">':'挺', '<img src="/keywd/H30.gif">':'贱', '<img src="/keywd/H25.gif">':'荡',
  793. '<img src="/keywd/V7.gif">':'肉', '<img src="/keywd/O22.gif">':'吮', '<img src="/keywd/H9.gif">':'春',
  794. '<img src="/keywd/K36.gif">':'日', '<img src="/keywd/O15.gif">':'胸', '<img src="/keywd/S31.gif">':'欲',
  795. '<img src="/keywd/F20.gif">':'射', '<img src="/keywd/N12.gif">':'禁', '<img src="/keywd/R26.gif">':'殿',
  796. '<img src="/keywd/X6.gif">':'诱', '<img src="/keywd/U46.gif">': '娇',
  797. '<img src="/keywd/M24.gif">': '操', '<img src="/keywd/B4.gif">':'骚', '<img src="/keywd/O3.gif">':'阴',
  798. }
  799. ]
  800. },
  801. {siteName: "书迷楼",
  802. url: /^https?:\/\/www\.shumil\.(?:co|us|com)\/.*html$/,
  803. titleReg: /(.*) (.*?) 书迷楼/,
  804. titlePos: 1,
  805. contentSelector: "#content",
  806. contentRemove: 'a, center',
  807. contentReplace: [
  808. 'div lign="ener"&gt;|.*更多章节请到网址隆重推荐去除广告全文字小说阅读器',
  809. '起点中文网www.qidian.com欢迎广大书.*',
  810. '书迷楼最快更新.*',
  811. '更新最快最稳定',
  812. '\\(\\.\\)R?U',
  813. {'<p>\\?\\?': '<p>'},
  814. '\\(www.\\)',
  815. '章节更新最快',
  816. '-乐-读-小-说--乐读x-',
  817. '《乐》《读》小说.乐读.Com',
  818. '纯文字在线阅读本站域名手机同步阅读请访问',
  819. '-优-优-小-说-更-新-最-快-www.uuxs.cc-',
  820. '\\(本章免费\\)',
  821. '书迷楼www.shumilou.co',
  822. '书迷楼 ()',
  823. ],
  824. fixImage: true,
  825. contentPatch: function(fakeStub){
  826. fakeStub.find("#content").find("div.title:last")
  827. .appendTo(fakeStub.find('body'));
  828. fakeStub.find("#content").find("div.title, p > b, div[style]").remove();
  829. }
  830. },
  831. {siteName: "冰火中文",
  832. url: /^https?:\/\/www\.binhuo\.com\/html\/[\d\/]+\.html$/,
  833. titleReg: /(.*?)最新章节,(.*?)-.*/,
  834. fixImage: true,
  835. contentRemove: 'font[color="red"]',
  836. contentReplace: {
  837. "&lt;冰火#中文.*|冰火中文&nbsp;(www.)?binhuo.com(?:【首发】|)|冰.火.中文|绿色小说|lvsexs|冰火中文": "",
  838. "LU5.coM|lU5.com|LU5.com":"",
  839. "([^/])www\\.binhuo\\.com(?:\\.com|)": "$1",
  840. "\\(.*?平南文学网\\)": "",
  841. },
  842. contentPatch: function(fakeStub){
  843. fakeStub.find("#BookText").append(fakeStub.find("img.imagecontent"));
  844. }
  845. },
  846. {siteName: "百晓生",
  847. url: /^https?:\/\/www\.bxs\.cc\/\d+\/\d+\.html/,
  848. titleReg: /(.*?)\d*,(.*)/,
  849. contentRemove: 'a, #txtright',
  850. contentReplace: [
  851. /一秒记住【】www.zaidu.cc,本站为您提供热门小说免费阅读。/ig,
  852. /(文&nbsp;學馆w&nbsp;ww.w&nbsp;xguan.c&nbsp;om)/ig,
  853. /(百晓生更新最快最稳定\)/g,
  854. /\((?:&nbsp;)*(?:无弹窗)?全文阅读\)/ig,
  855. /\[<a.*?首发\[百晓生\] \S+/ig,
  856. /高速首发.*本章节是地址为/ig,
  857. /\/\/(?:&nbsp;|访问下载txt小说|高速更新)+\/\//ig,
  858. /(www\.)?bxs\.cc|www\.bxs(\.com)?/ig,
  859. /百晓生.不跳字|不跳字。|更新快纯文字/ig,
  860. /\.\[,!\]/ig,
  861. /(未完待续&nbsp;http:\/\/www.Bxs.cc&nbsp;89免费小说阅《百晓生文学网》)/g,
  862. /〖百晓生∷.*〗|《?百晓生文学网》?|最快阅读小说大主宰,尽在百晓生文学网.*|ww.x.om|欢迎大家来到.*?bxs\.cc|百晓生阅读最新最全的小说.*|百晓生网不少字|站长推荐.*|文字首发|百.晓.生.|关闭.*广告.*|飘天文学|本站域名就是.*|\(.{0,5}小说更快更好.{0,5}\)|(请在)?百度搜索.*|一秒记住.*为您提供精彩小说阅读.|百晓生|¤本站网址:¤|\/\/&nbsp;访问下载txt小说\/\/◎◎|纯站点\\".*值得收藏的/ig,
  863. /文[学學][馆館]|www\.biquge\.cc|(http:\/\/)?www\.Bxs\.cc|(请牢记)?soudu.org/ig,
  864. /请搜索,小说更好更新更快!|最快文字更新无弹窗无广|\(即可找到本站\)|无广告看着就是爽!|更多全本txt小说请到下载|∷更新快∷∷纯文字∷/ig,
  865. /永久网址,请牢记!/ig,
  866. /&nbsp;&gt;<\/p>/ig,
  867. ],
  868. },
  869. {siteName: "浩奇文学网",
  870. url: /^https?:\/\/www\.haoqi99\.com\/.*\.shtml$/,
  871. titleReg: /^(.*?)--(.*?)-/,
  872. },
  873. {siteName: "书河小说网",
  874. url: /^https?:\/\/www\.shuhe\.cc\/\d+\/\d+/,
  875. titleReg: "([^\\d]+)\\d*,(.*?)_",
  876. contentSelector: "#TXT",
  877. contentReplace: /一秒记住.*为您提供精彩小说阅读.|\{请在百度搜索.*首发阅读\}|(书河小说网.*?无弹窗)|wxs.o|ww.x.om|[\[【\(].{1,30}[\]\)】]|ff37;.*|书河小说网高速首发.*|TXT下载|全文阅读|第一书河小说网|百书斋.*|首发来自书河小说网|本书最新章节|书河小说网/ig,
  878. },
  879. {siteName: "爱收藏",
  880. url: /^https?:\/\/www\.aishoucang\.com\/\w+\/\d+\.html/,
  881. titleReg: "(.*?)-(.*?)-爱收藏",
  882. contentSelector: "#zhutone",
  883. contentReplace: {
  884. "<a[^>]*>(.*?)</a>": "$1",
  885. ".爱收藏[^<]*": ""
  886. }
  887. },
  888. {siteName: "木鱼哥",
  889. url: /^https?:\/\/(www\.)?muyuge\.(com|net)\/\w+\/\d+\.html/,
  890. titleSelector: "#yueduye h1",
  891. bookTitleSelector: ".readerNav > li > a:last",
  892. indexSelector: ".readerFooterPage a[title='(快捷:回车键)']",
  893. // useiframe: true,
  894. // mutationSelector: "#content",
  895. // mutationChildCount: 1,
  896. nextSelector: 'a:contains(下章)',
  897. prevSelector: 'a:contains(上章)',
  898. indexSelector: 'a:contains(目录)',
  899. contentRemove: ".vote",
  900. contentReplace: {
  901. "<a[^>]*>(.*?)</a>": "$1",
  902. "看更新最快的小说就搜索—— 木鱼哥——无弹窗,全文字": "",
  903. "【看最新小说就搜索.*全文字首发】": "",
  904. "<p>.*?无弹窗</p>":"",
  905. "bb\\.king|【木&nbsp;鱼&nbsp;哥&nbsp;.*?】|【一秒钟记住本站:muyuge.com.*木鱼哥】":"",
  906. "——推荐阅读——[\\s\\S]+": "",
  907. "【\\s*木\\s*鱼\\s*哥.*?】":"",
  908. "div&gt;|&lt;-》": "",
  909. "\\(.pn. 平南\\)": "",
  910. },
  911. startFilter: function() {
  912. clearInterval(unsafeWindow.show);
  913. }
  914. },
  915. {siteName: "追书网",
  916. url: "^https?://www\\.zhuishu\\.net/files/article/html/.*\\.html",
  917. titleReg: /(?:正文 )?(.*) (\S+) \S+ - .*/,
  918. titlePos: 1,
  919. indexSelector: ".pagebottom>a:contains('目录')",
  920. nextSelector: ".pagebottom>a:contains('下一页')",
  921. prevSelector: ".pagebottom>a:contains('上一页')",
  922. fixImage: true,
  923. contentSelector: "#content",
  924. contentReplace: {
  925. "([^/])www\\.ZhuisHu\\.net": "$1",
  926. },
  927. contentPatch: function(fakeStub){
  928. fakeStub.find("#content > .title, #content > .pagebottom").appendTo(fakeStub.find("body"));
  929.  
  930. fakeStub.find("#content").find("center, b:contains('最快更新')").remove();
  931. }
  932. },
  933. {siteName: "猪猪岛小说",
  934. url: "^https?://www\\.zhuzhudao\\.(?:com|cc)/txt/",
  935. titleReg: "(.*?)最新章节-(.*?)-",
  936. contentReplace: /[“"”]?猪猪岛小说.*|<\/?a[^>]+>|w+\.zhuZhuDao\.com|看更新最快的.*/ig
  937. },
  938. {siteName: "逸名文学屋",
  939. url: "^https?://(bbs\\.vyming|www\\.9imw)\\.com/novel-read-\\d+-\\d+\\.html",
  940. contentSelector: "#showcontent",
  941. bookTitleSelector: ".headinfo a:first",
  942. contentRemove: "p:contains(精品推荐:), p:contains(,免费小说阅读基地!), a",
  943. contentReplace: [
  944. "逸名文学屋:"
  945. ]
  946. },
  947. {siteName: "奇书屋",
  948. url: "^https?://www.qishuwu.com/\\w+/\\d+/",
  949. titleReg: "(.*)_(.*)_.*_奇书屋",
  950. },
  951. {siteName: "17k小说网",
  952. url: /^https?:\/\/\S+\.17k\.com\/chapter\/\S+\/\d+\.html$/,
  953. titleReg: /(.*?)-(.*?)-.*/,
  954. contentSelector: "#chapterContent",
  955. contentRemove: ".chapter_update_time, h1, .qrcode, #authorSpenk, .like_box, #hotRecommend, .ct0416, .recent_read, div[style], #miniVoteBox",
  956. contentReplace: [
  957. '本书首发来自17K小说网,第一时间看正版内容!'
  958. ],
  959. contentPatchAsync: function($doc, callback) {
  960. if (unsafeWindow.console.clear) {
  961. unsafeWindow.console.clear = null;
  962. }
  963.  
  964. function waitFor(condition, callback, timeout, timeoutFn) {timeout = timeout || 30 * 1000;timeoutFn = timeoutFn || function() {};var startTime = Date.now();var timeId = setInterval(function() { if (condition()) { callback(); clearInterval(timeId); } else if ((Date.now() - startTime) > timeout) { timeoutFn(); clearInterval(timeId); }}, 500);}
  965.  
  966. var Q = unsafeWindow.Q
  967.  
  968. // 计算上一章节下一章节
  969. function calPages() {
  970. var json = Q.bookBigData.json
  971. var bookId = Q.bookid;
  972.  
  973. for (var i=0, c; c = json.list[i]; i++) {
  974. if (c == Q.chapterid) {
  975. var prevChapter = (0 === i ? null : json.list[i - 1])
  976. var nextChapter = (i + 1 < json.list.length ? json.list[i + 1] : null)
  977.  
  978. if (nextChapter) {
  979. var nextUrl = '/chapter/' + bookId + '/' + nextChapter + '.html';
  980. $doc.find('a:contains(下一章)')
  981. .attr('href', nextUrl);
  982.  
  983. Q.chapterid = nextChapter;
  984. }
  985. if (prevChapter) {
  986. var prevUrl = '/chapter/' + bookId + '/' + prevChapter + '.html';
  987. $doc.find('a:contains(上一章)')
  988. .attr('href', prevUrl);
  989. }
  990. break;
  991. }
  992. }
  993. }
  994.  
  995. if (!Q.bookBigData.json) {
  996. waitFor(function() {
  997. return !!Q.bookBigData.json;
  998. }, function() {
  999. calPages();
  1000. callback()
  1001. })
  1002. } else {
  1003. calPages();
  1004. callback()
  1005. }
  1006. }
  1007. },
  1008. {siteName: "看下文学",
  1009. url: "^https?://www\\.kanxia\\.net/k/\\d*/\\d+/\\d+\\.html$",
  1010. titleReg: /(.*?)-(.*)TXT下载_看下文学/,
  1011. contentReplace: /看下文学/g
  1012. },
  1013. {siteName: "青帝文学网",
  1014. url: /^https?:\/\/www\.qingdi\.com\/files\/article\/html\/\d+\/\d+\/\d+\.html$/,
  1015. titleReg: /(.*?)最新章节_(.*?)_青帝文学网_.*/
  1016. },
  1017. {siteName: "侠客中文网",
  1018. url: /^https?:\/\/www\.xkzw\.org\/\w+\/\d+\.html/,
  1019. contentSelector: ".readmain_inner .cont",
  1020. contentPatch: function(fakeStub){
  1021. fakeStub.find('title').html(fakeStub.find('.readmain_inner h2').text());
  1022. }
  1023. },
  1024. {siteName: "ChinaUnix.net",
  1025. url: /^https?:\/\/bbs\.chinaunix\.net\/thread-.*\.html/,
  1026. contentSelector: ".t_f:first"
  1027. },
  1028. {siteName: "123du 小说",
  1029. url: /^https?:\/\/www\.123du\.(?:net|cc)\//,
  1030. titleReg: "(.*)-(.*) 百家乐",
  1031. titlePos: 1,
  1032. contentSelector: "#content, #contents",
  1033. contentReplace: "一秒记住.www.*|小说最新更新,来123读书www.123du.net",
  1034. contentRemove: "a",
  1035. contentPatch: function(fakeStub){
  1036. var content = fakeStub.find("#DivContentBG").html().match(/第\d*页([\s\S]*)一秒记住/)[1];
  1037. $('<div id="content"/>').html(content).appendTo(fakeStub.find('body'));
  1038. }
  1039. },
  1040. {siteName: "动力中文",
  1041. url: "^https?://dlzw\\.cc/article.*\\.html",
  1042. nextSelector: "span:contains('下一篇') > a",
  1043. prevSelector: "span:contains('上一篇') > a",
  1044. indexSelector: "#pt a[href^='http']"
  1045. },
  1046. {siteName: "塔读文学",
  1047. url: "^https?://www\\.tadu\\.com/book/\\d+/\\d+/",
  1048. bookTitleSelector: '.title em:first',
  1049. contentSelector: "#partContent",
  1050. contentPatch: function(fakeStub){
  1051. var m = fakeStub.find("body").html().match(/\.html\(unescape\("(.*)"\)/);
  1052. if(m){
  1053. var unescapeContent = m[1];
  1054. fakeStub.find("#partContent").html(unescape(unescapeContent));
  1055. }
  1056. }
  1057. },
  1058. {siteName: "第一中文",
  1059. url: "^https?://www\\.dyzww\\.com/cn/\\d+/\\d+/\\d+\\.html$" ,
  1060. contentReplace: {
  1061. '<img.*?ait="(.*?)".*?>': "$1",
  1062. 'www\\.dyzww\\.com.*|♂|шШщ.*': ""
  1063. }
  1064. },
  1065. {siteName: "来书屋",
  1066. url: "^https?://www.laishuwu.com/html/\\d+/\\d+/\\d+.html",
  1067. titleSelector: ".chaptertitle h2",
  1068. bookTitleSelector: ".chaptertitle h1",
  1069. contentReplace: "txt\\d+/",
  1070. },
  1071. {siteName: "万书吧",
  1072. url: "^https?://www\\.wanshuba\\.com/Html/\\d+/\\d+/\\d+\\.html",
  1073. titleReg: "(.*?),(.*?)-万书吧",
  1074. titlePos: 1,
  1075. contentSelector: ".yd_text2",
  1076. contentReplace: [
  1077. "\\[www.*?\\]",
  1078. "\\(&nbsp;&nbsp;\\)",
  1079. "提供无弹窗全文字在线阅读,更新速度更快文章质量更好,如果您觉得不错就多多分享本站!谢谢各位读者的支持!",
  1080. "高速首发.*?,本章节是.*?地址为如果你觉的本章节还不错的话请不要忘记向您qq群和微博里的朋友推荐哦!"
  1081. ]
  1082. },
  1083. {siteName: "大文学",
  1084. url: "^https?://www\\.dawenxue\\.net/html/\\d+/\\d+/\\d+\\.html",
  1085. titleReg: "(.*?)-(.*)-大文学",
  1086. contentSelector: "#clickeye_content",
  1087. contentReplace: "\\(?大文学\\s*www\\.dawenxue\\.net\\)?|\\(\\)",
  1088. },
  1089. {siteName: "奇热",
  1090. url: "^https?://www\\.qirexs\\.com/read-\\d+-chapter-\\d+\\.html",
  1091. titleReg: "(.*?)-(.*?)-",
  1092. titlePos: 1,
  1093. contentSelector: "div.page-content .note",
  1094. contentRemove: "a",
  1095. contentReplace: "”奇热小说小说“更新最快|首发,/.奇热小说网阅读网!|奇热小说网提供.*|\\(手机用户请直接访问.*"
  1096. },
  1097. {siteName: "热点",
  1098. url: "^https?://www\\.hotsk\\.com/Html/Book/\\d+/\\d+/\\d+\\.shtml",
  1099. titleReg: "(.*?) 正文 (.*?)- 热点书库 -",
  1100. contentReplace: "\\(热点书库首发:www.hotsk.com\\)|www.zhuZhuDao.com .猪猪岛小说."
  1101. },
  1102. {siteName: "落秋中文",
  1103. url: "^https?://www\\.luoqiu\\.(com|net)/html/\\d+/\\d+/\\d+\\.html",
  1104. titleReg: "(.*?)-(.*?)-",
  1105. contentReplace: "&lt;/p&gt;"
  1106. },
  1107. {siteName: "全本小说网",
  1108. url: "^https?://www\\.qb5\\.com/xiaoshuo/\\d+/\\d+/\\d+\\.html",
  1109. titleReg: "(.*)_(.*)_",
  1110. contentRemove: "div[class]",
  1111. contentReplace: "全.{0,2}本.{0,2}小.{0,2}说.{0,2}网.{0,2}|[wWw ]+.{1,10}[CccǒOmMМ ]+",
  1112. },
  1113. {siteName: "手牵手小说网",
  1114. url: "^https?://www\\.sqsxs\\.com/.*\\d+/\\d+/\\d+\\.html",
  1115. bookTitleSelector: '#sitebar a:last',
  1116. contentReplace: [
  1117. "◆免费◆",
  1118. "★百度搜索,免费阅读万本★|访问下载txt小说.百度搜.|免费电子书下载|\\(百度搜\\)|『文學吧x吧.』|¤本站网址:¤",
  1119. "[☆★◆〓『【◎◇].*?(?:yunlaige|云 来 阁|yunlaige|免费看).*?[☆◆★〓』】◎◇]",
  1120. "【手机小说阅读&nbsp;m.】",
  1121. "BAIDU_CLB_fillSlot.*",
  1122. "&nbsp;关闭</p>",
  1123. "&nbsp;&nbsp;&nbsp;&nbsp;\\?",
  1124. "\\[☆更.新.最.快☆无.弹.窗☆全.免.费\\]",
  1125. '\\(.*?平南文学网\\)',
  1126. '{首发}|【首发】',
  1127. '=长=风',
  1128. '-优-优-小-说-更-新-最-快-\\.',
  1129. '发现一家非常好吃的手工曲奇店铺,可搜索淘宝.*',
  1130. '强烈推荐一家手工曲奇店,在淘宝搜索.*',
  1131. { "。\\.": "。" },
  1132. ]
  1133. },
  1134. {siteName: "六月中文网,盗梦人小说网",
  1135. url: "^https?://www\\.(?:6yzw\\.org|6yzw\\.com|daomengren\\.com)/.*\\.html",
  1136. bookTitleSelector: ".con_top>a:last",
  1137. contentRemove: "a[href]",
  1138. contentReplace: [
  1139. "纯文字在线阅读本站域名 520xs.Com 手机同步阅读请访问 M.520xs.Com",
  1140. "{飘天文学[\\s\\S]*您的支持就是我们最大的动力}",
  1141. "((未完待续),|精彩推荐:,)?最新最快更新热门小说,享受无弹窗阅读就在:",
  1142. "一秒记住【】,本站为您提供热门小说免费阅读。",
  1143. "百度搜索 本书名.*",
  1144. "欢迎您的光临,任何搜索引擎搜索.*给大家带来的不便深感抱歉!!",
  1145. "\\(?&nbsp;&nbsp; ?提供』。如果您喜欢这部作品,欢迎您来创世中文网[\\s\\S]+",
  1146. "[\\((]未完待续.{1,2}本文字由.*",
  1147. "//添加开头|会员特权抢先体验",
  1148. "更新最快|更新快纯文字|看最新章节|六月中文网|78小说|h﹒c﹒d|穿越小说吧 sj131|\\*五月中文网5.c om\\*",
  1149. "\\d楼[\\d\\-: ]+(?:&nbsp;)+ \\|(?:&nbsp;)+|吧主\\d+(?:&nbsp;)+|支持威武,嘎嘎!",
  1150. "www,|&nbsp;\\\\|“梦”(&nbsp;| )*“小”(&nbsp;| )*(“说” )?“网”|“岛”(&nbsp;| )+“说”",
  1151. /(百度搜索 )?本书名 \+ 盗梦人 看最快更新/ig,
  1152. "520xs.com ”520小说“小说章节更新最快",
  1153. "看最新最全小说|最快更新,(?:无弹窗)?阅读请。",
  1154. "纯文字在线阅读本站域名  手机同步阅读请访问",
  1155. "m.手机最省流量的站点。",
  1156. "本文由 …… 首发",
  1157. "(首发)|【首发】",
  1158. "&amp;nbsp",
  1159. ]
  1160. },
  1161. {siteName: "飞卢小说网",
  1162. url: "^https?://b\\.faloo\\.com/p/\\d+/\\d+\\.html",
  1163. titleSelector: "#title h1",
  1164. bookTitleSelector: "div.nav > a:last",
  1165. bookTitleReplace: '小说$',
  1166.  
  1167. nextSelector: "a#next_page",
  1168. prevSelector: "a#pre_page",
  1169. indexSelector: "a#huimulu",
  1170.  
  1171. contentSelector: "#main > .main0",
  1172. contentRemove: "> *:not(#con_imginfo, #content), .p_content_bottom",
  1173. contentReplace: [
  1174. "飞卢小说网 b.faloo.com 欢迎广大书友光临阅读,最新、最快、最火的连载作品尽在飞卢小说网!",
  1175. ],
  1176. contentPatch: function(fakeStub){
  1177. fakeStub.find("#content").find(".p_gonggao").remove();
  1178. // fakeStub.find("#con_imginfo").prependTo("#content");
  1179. }
  1180. },
  1181. {siteName: "顶点小说",
  1182. url: "^https?://www\\.(?:23us|x23us|23wx|xs222)\\.(?:com|cc)/html/\\d+/\\d+/\\d+\\.html$",
  1183. titleReg: "(.*?)-\\S*\\s(.*?)-顶点小说",
  1184. titlePos: 0,
  1185. bookTitleSelector: '.crumbs > div > a:last',
  1186. indexSelector: "#footlink a:contains('返回目录')",
  1187. prevSelector: "#footlink a:contains('上一页')",
  1188. nextSelector: "#footlink a:contains('下一页')",
  1189. contentSelector: "#contents",
  1190. contentReplace: [
  1191. "\\(看小说到顶点小说网.*\\)|\\(\\)|【记住本站只需一秒钟.*】",
  1192. '一秒记住【.*读及下载。',
  1193. 'www.xstxt.org',
  1194. 'wenxuemi.com',
  1195. '23us.com',
  1196. '顶点小说 X23US.com更新最快',
  1197. ],
  1198. contentPatch: function(fakeStub){
  1199. var temp=fakeStub.find('title').text();
  1200. var realtitle = temp.replace(/第.*卷\s/,'');
  1201. fakeStub.find('title').html(realtitle);
  1202. }
  1203. },
  1204. {siteName: '23中文',
  1205. url: '^https?://www\\.23zw\\.(com|me)/.*\\.html',
  1206. contentSelector: '#chapter_content',
  1207. contentRemove: 'h1',
  1208. contentReplace: [
  1209. '的朋友,你可以即可第一时间找到本站哦。',
  1210. '手机看小说哪家强\\?手机阅读网',
  1211. ',最快更新.*?最新章节!',
  1212. '看.*?最新章节到长风文学',
  1213. '本文由首发',
  1214. '章节更新最快',
  1215. '顶点小说.23us.。',
  1216. '\\(顶点小说\\)',
  1217. '看最新最全',
  1218. 'R1152',
  1219. '\\.n√et',
  1220. '中文网',
  1221. '更新最快',
  1222. ]
  1223. },
  1224. {siteName: '笔下阁',
  1225. url: "^https?://www\\.bixiage\\.com/\\w+/\\d+/\\d+/\\d+\\.html",
  1226. titleReg: "(.*)最新章节免费在线阅读_(.*)_笔下阁",
  1227. indexSelector: ".read_tools a:contains('返回目录')",
  1228. prevSelector: ".read_tools a:contains('上一页')",
  1229. nextSelector: ".read_tools a:contains('下一页')",
  1230. contentReplace: [
  1231. "本书最新免费章节请访问|请记住本站的网址|请使用访问本站",
  1232. "看更新最快的.*www.bixiage.com",
  1233. "笔下阁为您提供全文字小说.*",
  1234. "如果你觉得笔下阁不错.*",
  1235. "本篇是小说.*章节内容,如果你发现内容错误.*"
  1236. ]
  1237. },
  1238. {siteName: '双德小说网',
  1239. url: "^https?://www\\.shuangde\\.cc/.*\\.html",
  1240. bookTitleSelector: '.title > h2 > a',
  1241. contentRemove: '.title, div[align="center"]',
  1242. },
  1243. {siteName: '爱尚小说网',
  1244. url: '^https?://www.a240.com/read/\\d+/\\d+.html',
  1245. titleReg: '(.*) - (.*?) - 爱尚小说网',
  1246. titlePos: 1,
  1247. contentRemove: '.bottem, center',
  1248. contentReplace: '<!--章节内容开始-->'
  1249. },
  1250. {siteName: 'E度文学网',
  1251. url: '^https?://www.173ed.com/read/\\d+/\\d+.html',
  1252. contentRemove: 'a[href*="173e"]',
  1253. contentReplace: [
  1254. '全文字小说W.*?\\.com',
  1255. 'E度文学网更新最快',
  1256. 'www\\.♀173ed.com♀'
  1257. ]
  1258. },
  1259. {siteName: "3Z中文网",
  1260. url: "^https?://www\\.zzzcn\\.com\\/(3z\\d+/\\d+\\/|modules\\/article\\/App\\.php\\?aid=\\d+&cid=\\d+){1}$",
  1261. // titleReg: "(.*?)-(.*)TXT下载",
  1262. contentSelector: "#content3zcn",
  1263. indexSelector: "a:contains('返回目录')",
  1264. prevSelector: "a:contains('上 一 页')",
  1265. nextSelector: "a:contains('下 一 页'), a:contains('返回书架')",
  1266. contentReplace: [
  1267. /[{(][a-z\/.]+(?:首发文字|更新超快)[})]/ig,
  1268. "手机小说站点(wap.zzzcn.com)",
  1269. "一秒记住.*为您提供精彩小说阅读。",
  1270. ],
  1271. contentPatch: function(fakeStub){
  1272. fakeStub.find("a:contains('返回书架')").html("下 一 页").attr("href", fakeStub.find("a:contains('返回目录')").attr("href"));
  1273. fakeStub.find("#content3zcn").find(".titlePos, font.tips, a").remove();
  1274. }
  1275. },
  1276. {siteName: "比奇中文网",
  1277. url: "^https?://www\\.biqi\\.me/files/article/html/\\d+/\\d+/\\d+\\.html",
  1278. titleSelector: "#lbChapterName",
  1279. bookTitleSelector: "#TOPNAV td:first > a:last",
  1280. contentReplace: [
  1281. "http://www.biqi.me比奇中文网永久网址,请牢记!",
  1282. "www.biqi.me比奇中文网一直在为提高阅读体验而努力,喜欢请与好友分享!",
  1283. "[{【]比奇中文网首发www.biqi.me[}】]",
  1284. ]
  1285. },
  1286. {siteName: "书哈哈小说网",
  1287. url: "^https?://(?:read|www)\\.shuhaha\\.com/Html/Book/\\d+/\\d+/\\d+\\.html",
  1288. titleSelector: "#htmltimu",
  1289. bookTitleSelector: [".srcbox > a:nth-child(2)", /目录$/],
  1290. contentSelector: "#BookText",
  1291. contentRemove: 'a[href*="www.shuhaha.com"]',
  1292. contentReplace: [
  1293. '‘‘', '’’',
  1294. '(\\.shuh&amp;n)',
  1295. /<p[^>]*>(&nbsp;){4}网<\/p>/gi
  1296. ]
  1297. },
  1298. {siteName: "SF 轻小说",
  1299. url: '^https?://book.sfacg.com/Novel/\\d+/\\d+/\\d+/',
  1300. titleReg: '(.*?)-(.*?)-.*',
  1301. contentSelector: '#ChapterBody',
  1302. },
  1303. {siteName: "武林中文网",
  1304. url: '^https?://www\\.50zw\\.(com|co|la)/book_\\d+/\\d+\\.html',
  1305. bookTitleSelector: '.srcbox > a:last',
  1306. contentReplace: [
  1307. '更新最快【】',
  1308. '&lt;/dd&gt;',
  1309. '&lt;center&gt; &lt;fon color=red&gt;',
  1310. '一秒记住【武林中文网.*',
  1311. '武林中文网 www.*',
  1312. ]
  1313. },
  1314. {siteName: "乡村小说网",
  1315. url: '^https?://www\\.xiangcunxiaoshuo\\.com/shu/\\d+/\\d+\\.html',
  1316. // bookTitleSelector: '.read_m > .list',
  1317. titleReg: '(.*?)_(.*?)_.*_.*',
  1318. contentSelector: '.yd_text2',
  1319. contentReplace: [
  1320. '[wWw]+.23uS.(?:coM|com)',
  1321. '乡&amp;村&amp;.*?\\.co[mM]',
  1322. ]
  1323. },
  1324. {siteName: "杂书网",
  1325. url: "^https?://www\\.zashu\\.net/books/\\d+/\\d+/\\d+\\.html",
  1326. contentReplace: [
  1327. "吋煜牝咱.*?杂书网(?:杠杠的)?",
  1328. "吋煜牝咱看书神器",
  1329. "(?:吋煜牝咱|飝现洅咱|茇阺畱匝).*?[Cc]om",
  1330. "吋煜牝咱",
  1331. "飝现洅咱", "殢萾嘎匝",
  1332. "看小说“杂书网zashu.net”",
  1333. "手机站:m.zashu.net 电脑站:www.zashu.net",
  1334. ]
  1335. },
  1336. {siteName: "小说巴士",
  1337. url: "^https?://www\\.xs84\\.com/\\d+_\\d+/",
  1338. bookTitleSelector: ".con_top a:last",
  1339. contentReplace: [
  1340. "§推荐一个无广告的小说站.*? §",
  1341. "☆本站最快更新.*?☆",
  1342. "纯文字在线阅读.*?</br>",
  1343. "www.X S 8 4.com",
  1344. "《》 www.obr />",
  1345. "。。 w.2.obr",
  1346. "\\[w w w.x s.*?.c o m 小说.*?\\]",
  1347. "╂上.*?╂",
  1348. "\\*\\*顶\\*\\*点.{0,3}小说",
  1349. "___小.说.巴.士 www.xS84.com___",
  1350. ],
  1351. contentPatch: function() {
  1352. $('<script>')
  1353. .text('clearInterval(show);')
  1354. .appendTo('body')
  1355. .remove();
  1356. }
  1357. },
  1358. {siteName: "123言情",
  1359. url: '^https?://www\\.123yq\\.(com|org)/read/\\d+/\\d+/\\d+\\.shtml',
  1360. bookTitleSelector: '.con_top > a:last',
  1361. contentSelector: "#TXT",
  1362. contentRemove: '.bottem, .red, .contads, a',
  1363. },
  1364. {siteName: "热门小说网",
  1365. url: '^https?://www.remenxs.com/du_\\d+/\\d+/',
  1366. bookTitleSelector: 'section.readhead > div.read_t > div.lf > a:nth-child(2)',
  1367. nextSelector: '.pagego > font:contains("下一章") + a',
  1368. prevSelector: '.pagego > font:contains("上一章") + a',
  1369. contentSelector: ".yd_text2",
  1370. contentRemove: '.adrs, .con_w, a',
  1371. contentReplace: [
  1372. '您可以在百度里搜索“.*',
  1373. '为了方便下次阅读,你可以点击下方的.*'
  1374. ]
  1375. },
  1376.  
  1377. // === 内容补丁
  1378. {siteName: "给力文学小说阅读网",
  1379. url: "^https?://www\\.geiliwx\\.com/.*\\.shtml",
  1380. titleReg: "-?(.*)_(.*)最新章节_给力",
  1381. titlePos: 1,
  1382. contentRemove: 'h1, font[color], center',
  1383. contentReplace: [
  1384. "网站升级完毕!感谢对给力文学网的支持!",
  1385. "(百度搜索给力文学网更新最快最稳定\\)",
  1386. "【sogou,360,soso搜免费下载小说】",
  1387. "\\[乐\\]\\[读\\]小说.23.[Cc]m",
  1388. "给力文学网",
  1389. "看最快更新",
  1390. "小说网不跳字",
  1391. "\\.com",
  1392. "BAIDU_CLB_fillSlot\\(.*",
  1393. "--小-说-www-23wx-com",
  1394. "&nbsp;&nbsp;,请",
  1395. '\\.www\\.GEILIWX开心阅读每一天',
  1396. ],
  1397. contentPatch: function(d) {
  1398. if (!d.find('#content').length) {
  1399. var html = d.find('body').html();
  1400. var content = html.match(/<!--go-->([\s\S]*?)<!--over-->/i)[1];
  1401.  
  1402. content = $('<div id="content">').html(content);
  1403. if (content.find('#adright').size()) {
  1404. content = content.find('#adright');
  1405. }
  1406. content.appendTo(d.find('body'));
  1407. }
  1408. }
  1409. },
  1410.  
  1411. // ================== 采用 iframe 方式获取的 ====================
  1412. {siteName: "16K小说网",
  1413. url: "^https?://www\\.16kbook\\.org/Html/Book/\\d+/\\d+/\\d+\\.shtml$",
  1414. titleReg: '(\\S+) (.*)- 16K小说网',
  1415. useiframe: true,
  1416. contentRemove: '.bdlikebutton',
  1417. contentReplace: {
  1418. '(<center>)?<?img src..(http://www.16kbook.org)?(/tu/\\S+\\.jpg).(>| alt."\\d+_\\d+_\\d*\\.jpg" />)(</center>)?': "$3",
  1419. "/tu/shijie.jpg":"世界", "/tu/xiangdao.jpg":"想到", "/tu/danshi.jpg":"但是", "/tu/huilai.jpg":"回来", "/tu/yijing.jpg":"已经", "/tu/zhende.jpg":"真的", "/tu/liliang.jpg":"力量", "/tu/le.jpg":"了", "/tu/da.jpg":"大", "/tu/shengli.jpg":"胜利", "/tu/xiwang.jpg":"希望", "/tu/wandan.jpg":"完蛋", "/tu/de.jpg":"的",
  1420. "16kbook\\s*(首发更新|小说网)": "",
  1421. }
  1422. },
  1423. {siteName: "读读看",
  1424. url: "^https?://www\\.dudukan\\.net/html/.*\\.html$",
  1425. contentReplace: "看小说“就爱读书”|binhuo|www\\.92to\\.com",
  1426. useiframe: true,
  1427. mutationSelector: "#main",
  1428. mutationChildCount: 0,
  1429. },
  1430. {siteName: "读零零(有问题,只显示一半内容)",
  1431. url: "https?://www\\.du00\\.(?:com|cc)/read/\\d+/\\d+/[\\d_]+\\.html",
  1432. titleReg: "(.*?)(?:第\\d+段)?,(.*) - 读零零小说网",
  1433. titlePos: 1,
  1434. // prevSelector: "#footlink a:first",
  1435. // indexSelector: "#footlink a:contains('目录')",
  1436. // nextSelector: "#footlink a:last",
  1437. // 内容
  1438. contentSelector: "#pagecontent, .divimage",
  1439. // useiframe: true,
  1440. // mutationSelector: "#pagecontent",
  1441. // mutationChildCount: 2,
  1442. contentRemove: "font",
  1443. contentReplace: [
  1444. "读零零小说网欢迎您的光临.*?txt格式下载服务",
  1445. ",好看的小说:|本书最新免费章节请访问。",
  1446. "\\*文學馆\\*",
  1447. "\\(未完待续请搜索,小说更好更新更快!",
  1448. "www\\.DU00\\.com",
  1449. ],
  1450. checkSection: true
  1451. },
  1452. {siteName: "78小说网",
  1453. url: "^https?://www\\.78xs\\.com/article/\\d+/\\d+/\\d+.shtml$",
  1454. contentHandle: false,
  1455. titleReg: "(.*?) (?:正文 )?(.*) 78小说网",
  1456. indexSelector: "a:contains('目 录')",
  1457. prevSelector: "a:contains('上一章')",
  1458. nextSelector: "a:contains('下一章')",
  1459. contentSelector: "#content",
  1460. useiframe: true,
  1461. contentReplace: [
  1462. "//.*?78xs.*?//",
  1463. "\\(全文字小说更新最快\\)",
  1464. ],
  1465. contentPatch: function(fakeStub){
  1466. fakeStub.find('p.title').empty(); // 去掉内容中带的章节标题
  1467. }
  1468. },
  1469. {siteName: "151看书网",
  1470. url: "^https?://www\\.151kan\\.com/kan/.*\\.html",
  1471. contentSelector: "#msg",
  1472. useiframe: true,
  1473. mutationSelector: "#msg",
  1474. contentReplace: [
  1475. /[\/|]?www\.151(?:看|kan)\.com[\/|]?/ig,
  1476. /151看书网(?:纯文字)?/ig,
  1477. ]
  1478. },
  1479. {siteName: "就爱读书",
  1480. url: "^https?://www\\.92to\\.com/\\w+/\\w+/\\d+\\.html$",
  1481. titleReg: "(.*?)-(.*?)-",
  1482. useiframe: true,
  1483. timeout: 500,
  1484. contentReplace: "看小说.就爱.*"
  1485. },
  1486. {siteName: "书书网",
  1487. url: "^https?://www\\.shushuw\\.cn/shu/\\d+/\\d+\\.html",
  1488. titleReg: "(.*) (.*?) 书书网",
  1489. titlePos: 1,
  1490. useiframe: true,
  1491. timeout: 500,
  1492. contentReplace: "!~![\\s\\S]*"
  1493. },
  1494. {siteName: "找小说网",
  1495. url: "^https?://www\\.zhaoxiaoshuo\\.com/chapter-\\d+-\\d+-\\w+/",
  1496. titleReg: "(.*) - (.*) - 找小说网",
  1497. titlePos: 1,
  1498. useiframe: true,
  1499. timeout: 500,
  1500. contentRemove: "div[style]"
  1501. },
  1502. {siteName: "ABC小说网",
  1503. url: "^https?://www\\.bookabc\\.net/.*\\.html",
  1504. useiframe: true
  1505. },
  1506.  
  1507. // ============== 内容需要2次获取的 =========================
  1508. {siteName: "手打吧",
  1509. url: /^https?:\/\/shouda8\.com\/\w+\/\d+\.html/,
  1510. contentReplace: /[w\s\[\/\\\(]*.shouda8.com.*|(\/\/)?[全文字]?首发|手打吧|www.shou.*|\(w\/w\/w.shouda8.c\/o\/m 手、打。吧更新超快\)|小说 阅读网 www.xiaoshuoyd .com/ig,
  1511. contentPatch: function(fakeStub){
  1512. var scriptSrc = fakeStub.find('body').html().match(/outputContent\('(.*txt)'\)/)[1];
  1513. scriptSrc = "http://shouda8.com/ajax.php?f=http://shouda8.com/read" + scriptSrc;
  1514. fakeStub.find('#content').attr({
  1515. "class": 'reader-ajax',
  1516. src: scriptSrc
  1517. });
  1518. }
  1519. },
  1520. {siteName: "哈哈文学",
  1521. url: /^https?:\/\/www\.hahawx\.com\/.*htm/,
  1522. titleReg: /(.*?)-(.*?)-.*/,
  1523. contentSelector: "#chapter_content",
  1524. contentReplace: /(?:好书推荐|书友在看|其他书友正在看|好看的小说|推荐阅读):。|(?:www|www|book).*(?:com|net|org|com|net)|全文字阅读|无弹窗广告小说网|哈哈文学\(www.hahawx.com\)|souDU.org|Soudu.org|jīng彩推荐:/ig,
  1525. contentPatch: function(fakeStub){
  1526. var $content = fakeStub.find("#chapter_content");
  1527. var m = $content.find("script").text().match(/output\((\d+), "(\d+\.txt)"\);/);
  1528. if(m && m.length == 3){
  1529. var aid = m[1],
  1530. files = m[2];
  1531. var subDir = "/" + (Math.floor(aid / 1000) + 1),
  1532. subDir2 = "/" + (aid - Math.floor(aid / 1000) * 1000);
  1533. $content.attr({
  1534. class: "reader-ajax",
  1535. src: "http://r.xsjob.net/novel" + subDir + subDir2 + "/" + files,
  1536. charset: "gbk"
  1537. });
  1538. }
  1539. }
  1540. },
  1541. {siteName: "天天中文",
  1542. url: "^https?://www\\.ttzw\\.com/book/\\d+/\\d+\\.html",
  1543. titleSelector: "#chapter_title",
  1544. bookTitleSelector: ".fl.pl20 a:last",
  1545. contentSelector: "#text_area",
  1546. contentReplace: /www.ttzw.com|www.c66c.com|手机用户请到阅读。|<p>\s*a<\/p>/ig,
  1547. contentPatch: function(fakeStub) {
  1548. var m = fakeStub.find('#text_area script').text().match(/outputTxt\("(.*)"\);/);
  1549. if (m) {
  1550. fakeStub.find('#text_area').attr({
  1551. class: "reader-ajax",
  1552. src: unsafeWindow.getServer() + m[1],
  1553. charset: "gbk"
  1554. });
  1555. }
  1556. }
  1557. },
  1558.  
  1559. // ===========================================================
  1560. {siteName: "好看小說網",
  1561. url: "^https?://tw\\.xiaoshuokan\\.com/haokan/\\d+/\\d+\\.html",
  1562. contentSelector: ".bookcontent",
  1563. prevSelector: "a.redbutt:contains('上一頁')",
  1564. indexSelector: "a.redbutt:contains('返回章節目錄')",
  1565. nextSelector: "a.redbutt:contains('下一頁')",
  1566. contentReplace: "[a-z;&]*w.[xx]iaoshuokan.com 好看小說網[a-z;&族】)]*"
  1567. },
  1568. {siteName: "E品中文网",
  1569. url: "^https?://www\\.epzww\\.com/book/\\d+/\\d+",
  1570. titleReg: "(.*?),(.*?),",
  1571. contentSelector: "#showcontent",
  1572. },
  1573. {siteName: "飘天文学",
  1574. url: "^https?://www\\.piaotian\\.(net|com)/html/\\d+/\\d+/\\d+\\.html",
  1575. // titleReg: "(.*)最新章节,(.*),飘天文学",
  1576. bookTitleSelector: '#content > h1 > a',
  1577. contentSelector: "#content",
  1578. useiframe: true, // 否则 content 在 body 下面
  1579. contentRemove: "h1, table, .toplink",
  1580. contentReplace: [
  1581. /[{〖]请在百度搜索.*[}〗]|.(?:百度搜索飄天|无弹窗小说网).*\.Net.|\[飄天.*无弹窗小说网\]/ig,
  1582. '\\{飘天文学www.piaotian.net感谢各位书友的支持,您的支持就是我们最大的动力\\}',
  1583. '章节更新最快',
  1584. '支持网站发展,逛淘宝买东西.*',
  1585. '天才壹秒記住,為您提供精彩閱讀。.*'
  1586. ],
  1587. },
  1588. {siteName: "天使小说网",
  1589. url: "^https?://www\\.tsxs\\.cc/files/article/html/\\d+/\\d+/\\d+\\.html",
  1590. contentSelector: "#content"
  1591. },
  1592. {siteName: "紫雨阁小说网",
  1593. url: "^https?://www\\.ziyuge\\.com/\\w+/\\w+/\\d+/\\d+/\\d+\\.html",
  1594. titleReg: "(.*?)-正文-(.*?)-紫雨阁小说网",
  1595. contentSelector: ".reader_content",
  1596. nextSelector: "#divNext a",
  1597. prevSelector: "#divPrev a",
  1598. contentReplace: "\\(.*www.ziyuge.com.*\\)"
  1599. },
  1600. {siteName: "破风中文网",
  1601. url: "^https?://www\\.pofeng\\.net/xiaoshuo/\\d+/\\d+\\.html",
  1602. useiframe: true
  1603. },
  1604. {siteName: "读客吧",
  1605. url: "^https?://dukeba\\.com/book/\\d+/\\d+/\\d+\\.shtml",
  1606. useiframe: true,
  1607. contentSelector: "#content > div[style]",
  1608. contentRemove: "a, div[align]:has(font)",
  1609. },
  1610. {siteName: "一起阅",
  1611. url: "^https?://www\\.17yue\\.com/\\w+/\\d+/\\d+\\.html",
  1612. useiframe: true,
  1613. },
  1614. {siteName: "诺秋网",
  1615. url: "^https?://www\\.nuoqiu\\.com/static/\\d+/\\d+\\.html",
  1616. titleReg: "(.*) (.*) 诺秋网",
  1617. titlePos: 1,
  1618. useiframe: true,
  1619. contentReplace: "┏━━━━━━━━━━━━━━━━━━━━━━━━━┓[\\s\\S]+诺秋网文字更新最快……】@!!"
  1620. },
  1621. {siteName: "言情后花园",
  1622. url: "^https?://www\\.yqhhy\\.cc/\\d+/\\d+/\\d+\\.html",
  1623. titleReg: "(.*)-(.*)-.*-言情后花园",
  1624. titlePos: 1,
  1625. contentSelector: "#content",
  1626. contentRemove: "a, span[style], script",
  1627. contentReplace: "请记住本站: www.yqhhy.cc|更多,尽在言情后花园。"
  1628. },
  1629. {siteName: "六九中文",
  1630. url: "^https?://www.(?:69zw|kan7).com/\\w+/\\d+/\\d+/\\d+.html",
  1631. titleSelector: ".chapter_title",
  1632. bookTitleSelector: ".readhead h1",
  1633. contentSelector: ".yd_text2",
  1634. // titleReg: "(.*)?_(.*)-六九中文",
  1635. contentReplace: [
  1636. "[\\*]+本章节来源六九中文.*请到六九中文阅读最新章节[\\*]+|-\\\\[wW]+.*书友上传/-",
  1637. "\\\\请到 www.69zw.com 六\\*九.*?/",
  1638. "【 注册(不可用)会员可获私人书架,看书更方便!:】",
  1639. "首发<br />",
  1640. ]
  1641. },
  1642. {siteName: "免费小说阅读网",
  1643. titleReg: "(.*) , (.*) , 免费小说阅读网",
  1644. titlePos: 1,
  1645. url: "^https?://book\\.yayacms\\.com/\\w+/book_\\d+_\\d+.html",
  1646. contentRemove: "a, div[style]",
  1647. contentReplace: "http://book.YaYaCMS.com/.*|book.yayacms.com",
  1648. },
  1649. {siteName: "书农在线书库",
  1650. url: "^https?://www\\.shunong\\.com/yuedu/\\d+/\\d+/\\d+.html",
  1651. contentSelector: ".bookcontent",
  1652. },
  1653. {siteName: "努努书坊",
  1654. url: "^https?://(?:book\\.kanunu\\.org|www\\.kanunu8\\.com)/.*/\\d+\\.html",
  1655. titleReg: /(.*) - (.*) - 小说在线阅读 - .* - 努努书坊/,
  1656. titlePos: 1,
  1657. contentSelector: "table:eq(4) p",
  1658. indexSelector: "a[href^='./']",
  1659. },
  1660. {siteName: "五月中文网",
  1661. url: "^https?://5ycn\\.com/\\d+/\\d+/\\d+\\.html",
  1662. contentRemove: "div[align='center'], a",
  1663. },
  1664. {siteName: "笔下中文",
  1665. url: "^https?://www\\.bxzw\\.org/\\w+/\\d+/\\d+/\\d+\\.shtml",
  1666. contentRemove: "div[align='center'], center, #footlink1",
  1667. contentReplace: "www\\.bxzw\\.org|//无弹窗更新快//|\\(看精品小说请上.*\\)|\\(看.*最新更新章节.*\\)"
  1668. },
  1669. {siteName: "着笔中文网",
  1670. url: "^https?://.*zbzw\\.com/\\w+/\\d+\\.html",
  1671. contentReplace: "精彩小说尽在.*"
  1672. },
  1673. {siteName: "D586小说网",
  1674. url: '^https?://www\\.d586\\.com/',
  1675. contentSelector: ".yd_text2",
  1676. contentRemove: 'a',
  1677. contentReplace: [
  1678. '【www.13800100.com文字首发D586小说网】',
  1679. '【☆D586小说网☆//文字首发】.*'
  1680. ]
  1681. },
  1682. {siteName: "豌豆文学网",
  1683. url: "^https?://www.wandoou.com/book/\\d+/\\d+\\.html",
  1684. titleReg: '(.*?)最新章节-(.*)-.*无弹窗广告_豌豆文学网',
  1685. contentRemove: "center",
  1686. contentReplace: [
  1687. /[{(]<a href.*[})]|网欢迎广大书友光临阅读,.*/ig,
  1688. /[レ★]+.*(?:请支持)?豌(?:.|&amp;)?豆.?文.?学.*[レ★]+/ig,
  1689. /[((【]豌.?豆.?文.?学.*[))】]/ig,
  1690. /∷更新快∷∷纯文字∷|http:永久网址,请牢记!/ig,
  1691. /(?:{|\\|\/|\()*豌.?豆.?文.?学.?网.*?(?:高速更新|\\\/|})+/ig,
  1692. /更新最快最稳定|看小说“”/ig,
  1693. /&lt;strng&gt;.*?&lt;\/strng&gt;/ig,
  1694. /\(凤舞文学网\)|\( *\)|「启航文字」|79阅.读.网/ig,
  1695. /高速首发.*?本章节是.*/ig,
  1696. /百度搜索自从知道用百度搜索,妈妈再也不用担心我追不到最快更新了/ig,
  1697. ]
  1698. },
  1699. {siteName: "都来读小说网",
  1700. url: /^https?:\/\/www\.doulaidu\.com\/[^\/]+\/\d+\/\d+\.html/,
  1701. useiframe: true,
  1702. contentReplace: [
  1703. /www..+.(?:com|net)/ig,
  1704. /都来读小说网首发|www\.[a-z0-9]+\.(?:org|com)/ig,
  1705. ]
  1706. },
  1707. {siteName: "小说TXT",
  1708. url: /^https?:\/\/www\.xshuotxt\.com\//,
  1709. contentReplace: "\\(.*无弹窗全文阅读\\)",
  1710. contentPatch: function(fakeStub) {
  1711. fakeStub.find('#title a').remove();
  1712. }
  1713. },
  1714. {siteName: "疯狂中文网",
  1715. url: "^https?://www\\.fkzww\\.com/",
  1716. contentRemove: ".bottem, a[href='http://www.fkzww.com']",
  1717. contentReplace: [
  1718. /收藏【.*?疯狂中文网\)/ig,
  1719. ]
  1720. },
  1721. {siteName: "吾读小说网",
  1722. url: "^https?://www\\.5du5\\.com/book/.*\\.html",
  1723. contentReplace: '\\(吾读小说网 <a.*无弹窗全文阅读\\)'
  1724. },
  1725. {siteName: "UU看书",
  1726. url: "^https?://www\\.uukanshu\\.(?:com|net)/.*/\\d+/\\d+.html",
  1727. contentReplace: [
  1728. /* 替换以下
  1729. UU看书 www.uukanshu.net
  1730. 'UU看书 www.uukanshu.net '
  1731. 'UU看书 www.uukanshu.net'
  1732. 'UU看书 www.uukanshu.net'
  1733. 'UU看书 www.uukanshu.net '
  1734. 'UU看书www.uukanshu.net '
  1735. 'UU看书 www.uukanshu.net'
  1736. 'UU看书 www.uukanshu.net'
  1737. 'UU看书 www.uukanshu.net '
  1738. 'UU看书 www.uukanshu.net '
  1739. ‘UU看书 www.uukanshu.net ’
  1740. ‘UU看书 www.uukanshu.net ’
  1741. ‘UU看书 www.uukanshu.net ’
  1742. UU看书 www.uukanshu.net
  1743. */
  1744. /[UuUu]+看书\s*www.[UuUu]+[kk][aa][nn][ss][hh][UuUu].[nn][ee][tt]/g,
  1745. '[UU]*看书[(\\(].*?[)\\)]文字首发。',
  1746. '请记住本书首发域名:。笔趣阁手机版阅读网址:',
  1747. '\\(\\)',
  1748. ]
  1749. },
  1750. {siteName: "长风文学网",
  1751. url: "^https?://www\\.cfwx\\.net/files/article/html/\\d+/\\d+/\\d+\\.html",
  1752. titleSelector: '.title',
  1753. bookTitleSelector: '.linkleft > a:last',
  1754. contentReplace: [
  1755. '([^\\u4E00-\\u9FFF]+)长\\1风\\1文\\1学[^\\n]+t',
  1756. ]
  1757. },
  1758. {siteName: "云来阁",
  1759. url: "^https?://www\\.yunlaige\\.com/html/\\d+/\\d+/\\d+\\.html",
  1760. titleSelector: '.ctitle',
  1761. bookTitleSelector: '#hlBookName',
  1762. contentSelector: '#content',
  1763. contentRemove: '.bottomlink, a, .cad, .footer, .adbottom',
  1764. contentReplace: [
  1765. '[☆★◆〓『【◎◇].*?(?:yunlaige|云 来 阁|yunlaige).*?[☆◆★〓』】◎◇]',
  1766. '《更新最快小说网站:雲来阁http://WWW.YunLaiGe.COM》',
  1767. '【當你閱讀到此章節,請您移步到雲來閣閱讀最新章節,或者,雲來閣】',
  1768. '【看恐怖小说、玄幻小说、请大家登陆黑岩居http://www.heiyanju.com万本小说免费看】',
  1769. '【本书作者推荐:(?:百度搜索)?云来閣,免费观看本书最快的VIP章节】',
  1770. '搜索引擎搜索关键词\\s*云.来.阁,各种小说任你观看,破防盗章节',
  1771. '◢百度搜索雲来阁,最新最快的小说更新◣',
  1772. '\\(云来阁小说文学网www.yunlaige.com\\)',
  1773. '如您已阅读到此章节,请移步到.*',
  1774. '===百!?度搜索.*?新章节===',
  1775. '【最新更新】',
  1776. '值得您收藏。。',
  1777. '小说“小说章节',
  1778. '纯文字在线阅读本站域名',
  1779. '手机同步阅读请访问',
  1780. '±顶±点±小±说,ww',
  1781. '■dingddian小说,ww∨23w→■m',
  1782. 'w∨23w',
  1783. 'www23wxcom',
  1784. '¥℉頂¥℉点¥℉小¥℉',
  1785. '£∝頂£∝点£∝小£∝',
  1786. '篮。色。书。巴,',
  1787. '<!--\\?[\\(<]', // 提取内容后出现的注释标志,造成后面的内容没了
  1788. '看书&nbsp;&nbsp; 要?',
  1789. '喜欢网就上。',
  1790. '无弹窗小说,.*',
  1791. '本书最快更新网站请:.*',
  1792. ]
  1793. },
  1794. {siteName: "乐文小说网",
  1795. url: /^https?:\/\/www\.lwxs520\.com\/books\/\d+\/\d+\/\d+.html/,
  1796. siteExample: 'http://www.lwxs520.com/books/2/2329/473426.html',
  1797. bookTitleSelector: 'h2',
  1798. chapterTitleReplace: 'WwW.lwxs520.Com|乐文小说网',
  1799.  
  1800. contentRemove: '#content>:not(p)',
  1801. contentReplace: [
  1802. '看小说到乐文小说网www.lwxs520.com',
  1803. '喜欢乐文小说网就上www.*(?:COM|com)',
  1804. '爱玩爱看就来乐文小说网.*',
  1805. '\\(LWXS520。\\)',
  1806. 'M.LWxS520.com&nbsp;乐文移动网',
  1807. /乐文小说网值得.+/g,
  1808. '乐\\+文\\+小说&nbsp;Www.しwXs520.Com',
  1809. '乐文\s*小说 www.lwxs520.com',
  1810. '&乐&文&小说 \\{www\\}.\\{lw\\}\\{xs520\\}.\\{com\\}',
  1811. '<乐-文>小说www.しWXS520.com',
  1812. '-乐-文-小-说-www-lwxs520-com',
  1813. '?乐?文?小说 wwW.lWXs520. COM',
  1814. ';乐;文;小说 www.lw+xs520.com',
  1815. '小说&nbsp;wWw.Lwxs520.cOm',
  1816. 'www.LWXS520.com',
  1817. 'www.lwxs520.com 首发哦亲',
  1818. 'www.lwxs520.com',
  1819. /\(未完待续.+/g,
  1820. '\\P?[樂乐]\\P文\\P小\\P?说',
  1821. '》乐>文》小说',
  1822. '乐+文+小说',
  1823. '《乐<文《小说',
  1824. '樂文小說',
  1825. ':乐:文:小说',
  1826. '`乐`文`小说`',
  1827. '=乐=文=小说',
  1828. '@樂@文@小@说|',
  1829. ';乐;文;小说',
  1830. '︾樂︾文︾小︾说\\|',
  1831. '`乐`文`小说`',
  1832. '@乐@文@小说',
  1833. '[しlL][ωWw][χXXx][ssS]520',
  1834. 'lw+xs520',
  1835. '♂!',
  1836. '3w.',
  1837. '\\(\\)',
  1838. ]
  1839. },
  1840. {siteName: '我爱小说',
  1841. url: '^https?://www\\.woaixiaoshuo\\.com/xiaoshuo/\\d+/\\d+/\\d+\\.html',
  1842. bookTitleSelector: '#lbox > b',
  1843. contentSelector: '#readbox',
  1844. contentRemove: '#papgbutton, #content',
  1845. },
  1846. {siteName: "米花在线书库",
  1847. url: /book\.mihua\.net\/\w+\/\d+\/\d+\/.+\.html/,
  1848. titleSelector: "#title",
  1849. contentSelector: "#viewbook"
  1850. },
  1851. {siteName: "58小说网",
  1852. url: /^https?:\/\/(www|book)\.(58)?58xs\.com\/html\/\d+\/\d+\/\d+\.html/,
  1853. titleSelector: "h1",
  1854. indexSelector: "#footlink > a:eq(1)",
  1855. prevSelector: "#footlink > a:eq(0)",
  1856. nextSelector: "#footlink > a:eq(2)",
  1857. contentSelector: "#content",
  1858. contentRemove: ".f1, .c1"
  1859. },
  1860. {siteName: "天天美文网",
  1861. url: /www\.365essay\.com\/\w+\/.+.htm/,
  1862. titleSelector: ".title > h1",
  1863. contentSelector: "#zoomc td",
  1864. contentRemove: ".page-bottomc"
  1865. },
  1866. {siteName: "天涯武库",
  1867. url: /wx\.ty2016\.com\/.+\.html$/,
  1868. bookTitleSelector: "td[width='800'][height='25']>a[href='./']",
  1869. titleSelector: "strong>font",
  1870. indexSelector: "td a[href='./']",
  1871. nextSelector: "td[width='28%'] a",
  1872.  
  1873. contentSelector: "td[width='760'] p",
  1874. contentHandle: false,
  1875. },
  1876. {siteName: "黄金屋中文网",
  1877. url: /www\.hjwzw\.com\/Book\/Read\/\d+[,_]\d+$/,
  1878. titleSelector: "h1",
  1879. indexSelector: "td a[href='./']",
  1880. contentSelector: "#AllySite+div",
  1881. contentRemove: "b, b+p",
  1882. contentReplace: [
  1883. "请记住本站域名:"
  1884. ]
  1885. },
  1886. {siteName: "梦远书城",
  1887. url: /www\.my285\.com(?:\/\w+){3,5}\/\d+\.htm$/,
  1888. useiframe: true,
  1889. contentSelector: "table:eq(2) tr:eq(3)",
  1890. },
  1891. {siteName: "更新吧",
  1892. url: "^https?://www\\.gengxin8\\.com/read/\\d+/\\d+.html$",
  1893. bookTitleSelector: '.left a:last',
  1894. contentSelector: "#chaptertxt",
  1895. useiframe: true,
  1896. },
  1897. {siteName: "乐文小说网",
  1898. url: "^https?://www\\.365xs\\.org/books/\\d+/\\d+/\\d+\\.html",
  1899. titleSelector: ".kfyd h1",
  1900. bookTitleSelector: "ul.bread-crumbs a:last",
  1901. contentSelector: "#content",
  1902. // contentReplace: []
  1903. },
  1904. {siteName: "舞若小说网",
  1905. url: "^https?://www\\.wuruo\\.com/files/article/html/\\d+/\\d+/\\d+\\.html",
  1906. bookTitleSelector: ".text a:eq(1)",
  1907. contentSelector: "#zhengwen",
  1908. contentReplace: [
  1909. '【更多精彩小说请访问www.wuruo.com】',
  1910. '(www.wuruo.com舞若小说网首发)',
  1911. '【舞若小说网首发】',
  1912. ]
  1913. },
  1914. {siteName: "大书包小说网",
  1915. url: "^https?://www\\.dashubao\\.com?/book/\\d+/\\d+/\\d+\\.html",
  1916. bookTitleSelector: ".read_t > .lf > a:nth-child(3)",
  1917. contentSelector: ".yd_text2",
  1918. contentReplace: [
  1919. ]
  1920. },
  1921. {siteName: "爬书网",
  1922. url: "^https?://www\\.pashuw\\.com/BookReader/\\d+-\\d+/\\d+\\.html",
  1923. bookTitleSelector: "#paihangbang_select > a:last()",
  1924. nextSelector: "#next2 a",
  1925. prevSelector: "#prev2 a",
  1926. indexSelector: "#fhml2 a",
  1927. contentRemove: '.novel_bot',
  1928. },
  1929. {siteName: "闪文书库",
  1930. url: "^https?://read\\.shanwen\\.com/html/\\d+/\\d+/\\d+\\.html",
  1931. titleSelector: '.newstitle',
  1932. contentRemove: '#titlebottom',
  1933. contentReplace: [
  1934. '闪文网址中的.*?注册(不可用)会员</a>'
  1935. ]
  1936. },
  1937. {siteName: "品书网",
  1938. url: "^https?://www\\.vodtw\\.com/Html/Book/\\d+/\\d+/\\d+\\.html",
  1939. bookTitleSelector: '.srcbox > a:last()',
  1940. contentRemove: 'a',
  1941. contentReplace: [
  1942. '品书网 www.voDtw.com◇↓',
  1943. '品书网 www.vodtW.com',
  1944. '品 书 网 (w W W . V o Dtw . c o M)',
  1945. '复制网址访问\\s*http://[%\\d\\w]+'
  1946. ]
  1947. },
  1948. {siteName: "凤凰小说网",
  1949. url: "^https?://www\\.fhxs\\.com/read/\\d+/\\d+/\\d+\\.shtml",
  1950. bookTitleSelector: '.con_top > a:last()',
  1951. contentRemove: '.bottem',
  1952. contentReplace: [
  1953. ]
  1954. },
  1955. {siteName: "小说巴士",
  1956. url: "^https?://www\\.xsbashi\\.com/\\d+_\\d+/",
  1957. contentReplace: [
  1958. '全文阅读如您已阅读到此章[節节].*?,,,,',
  1959. '看小说首发推荐去眼快看书',
  1960. '最快更新,阅读请。___小/说/巴/士 Www.XSBASHI.coM___',
  1961. '___小/说/巴/士 www.XSBASHI.com___',
  1962. 'lala如您已阅读到此章節,請移步到.*?速记方法:,\\]',
  1963. 'lala如您已阅读到此章節.*?敬請記住我們新的網址筆-趣-閣',
  1964. '起舞电子书访问:. 。',
  1965. '≧哈,m\\.',
  1966. '\\[\\s*超多好看\\]',
  1967. '热门【首发】',
  1968. '===百度搜索.*?===',
  1969. '===\\*\\*小说巴士.*?===',
  1970. ]
  1971. },
  1972. {siteName: "思兔阅读",
  1973. url: "^https?://\\w+\\.sto\\.cc/book-\\d+-\\d+.html",
  1974. titleReg: "(.*?)_(.*?)_全文在線閱讀_思兔",
  1975. titlePos: 0,
  1976. //bookTitleSelector: "h1",
  1977. prevSelector: "a:contains('上壹頁'), a:contains('上壹页')",
  1978. nextSelector: "a:contains('下壹頁'), a:contains('下壹页')",
  1979. contentSelector: "div#BookContent",
  1980. contentRemove: 'span',
  1981. },
  1982. {siteName: "去读读",
  1983. url: "^https?://www\\.qududu\\.net/book/\\d+/\\d+/\\d+\\.html",
  1984. contentSelector: "#kui-page-read-txt",
  1985. },
  1986. {siteName: "33言情",
  1987. url: "^https?://www\\.33yq\\.com/read/\\d+/\\d+/\\d+\\.shtml",
  1988. contentRemove: 'a, .bottem, .red',
  1989. },
  1990. {siteName: "巫师图书馆.",
  1991. url: "^https?://www\\.54tushu\\.com/book_library/chaptershow/theId/\\d+\\.html",
  1992. bookTitleSelector: "#m-book-title",
  1993. titleSelector: "div.title",
  1994. prevSelector: "div.pageInfo a:first",
  1995. nextSelector: "div.pageInfo a:last",
  1996. indexSelector: "a[title='返回书页']",
  1997. useiframe: true,
  1998. timeout: 1000,
  1999. contentSelector: "div#ChapterContent",
  2000. contentPatch: function(fakeStub){
  2001. var bookTitle = fakeStub.find('meta[name="keywords"]').attr('content');
  2002. fakeStub.find('body').append('<div id="m-book-title">' + bookTitle + '</div>');
  2003. }
  2004. },
  2005.  
  2006. // ===== 特殊的获取下一页链接
  2007. {siteName: "看书啦",
  2008. url: "^https?://www.kanshu.la/book/\\w+/\\d+\\.shtml",
  2009. titleReg: "(.*)-(.*)-看书啦",
  2010. titlePos: 1,
  2011. nextUrl: function($doc){
  2012. var html = $doc.find('script:contains(next_page = ")').html();
  2013. var m = html.match(/next_page = "(.*?)";/);
  2014. if (m) return m[1];
  2015. },
  2016. prevUrl: function($doc){
  2017. var html = $doc.find('script:contains(preview_page = ")').html();
  2018. var m = html.match(/preview_page = "(.*?)";/);
  2019. if (m) return m[1];
  2020. }
  2021. },
  2022. {siteName: "书阁网",
  2023. url: "^https?://www\\.bookgew\\.com/Html/Book/\\d+/\\d+/\\d+\\.htm",
  2024. titleReg: "(.*)-(.*?)-书阁网",
  2025. titlePos: 1,
  2026. // titleSelector: ".newstitle",
  2027. nextUrl: function($doc){
  2028. var html = $doc.find('script:contains(nextpage=)').html();
  2029. var m = html.match(/nextpage="(.*?)";/);
  2030. if (m) return m[1];
  2031. },
  2032. prevUrl: function($doc) {
  2033. var html = $doc.find('script:contains(prevpage=)').html();
  2034. var m = html.match(/prevpage="(.*?)";/);
  2035. if (m) return m[1];
  2036. }
  2037. },
  2038.  
  2039. // {siteName: "雅文言情小说吧", // 一章分段
  2040. // url: "^https?://www\\.yawen8\\.com/\\w+/\\d+/\\d+\\.html",
  2041. // contentSelector: "#content .txtc"
  2042. // }
  2043.  
  2044. {siteName:'妙笔阁',
  2045. url: /^https?:\/\/www\.miaobige\.com\/.*\.html|^https?:\/\/www.(?:52dsm|banfusheng).com\/chapter\/\d+\/\d+.html/i,
  2046. siteExample:'http://www.miaobige.com/book/5_1586/1006320.html',
  2047. // 有的会提示防采集章节
  2048. fInit: function () {
  2049. $('<script>')
  2050. .text('$(document).unbind("contextmenu selectstart")')
  2051. .appendTo(document.body);
  2052. },
  2053.  
  2054. useiframe: true,
  2055. mutationSelector: '#content',
  2056. mutationChildCount: 1,
  2057. startLaunch: function($doc){
  2058. var $content = $doc.find('#content');
  2059.  
  2060. if ($content.text().match(/妙笔阁防盗模式:|小说阅读模式:/)) {
  2061. // 清空不完全的内容节点,通过 mutationSelector 等待内容 完全加载
  2062. $content.html('');
  2063. }
  2064. },
  2065. contentReplace: '妙笔阁,无弹窗,更新快,记住www.miaobige.com',
  2066. // contentPatch: function($doc){
  2067. // var $content = $doc.find('#content');
  2068. // var txt = $content.text();
  2069.  
  2070. // if (0 === txt.trim().indexOf('防采集章节,')) {
  2071. // var mNewLink = $content.html().match(/http:\/\/www\.miaobige\.com\/book\/(\d)_(\d+)\/(\d+)\.html/i);
  2072. // if (mNewLink) {
  2073. // $content .addClass(READER_AJAX)
  2074. // .attr({
  2075. // src: '/js/ajaxtxt.asp',
  2076. // charset: 'gbk'
  2077. // })
  2078. // .data('post', {
  2079. // sid: mNewLink[2],
  2080. // zid: mNewLink[3],
  2081. // cid: mNewLink[1]
  2082. // })
  2083. // .text('请等待加载…');
  2084. // }
  2085. // }
  2086. // },
  2087. // http://www.miaobige.com/read/11180/5216676.html 章节内容缺失(下面方式过于复杂,无效)
  2088. // contentPatchAsync: function($doc, callback) {
  2089. // var $content = $doc.find('#content');
  2090. // var txt = $content.text();
  2091.  
  2092. // if (txt.indexOf('妙笔阁防盗模式:') > -1) {
  2093. // // 很复杂。一串看不懂的 js 生成 $.post('/ajax/content/',{sid:11180,zid:15662893,cid:3},function(data){$('#content').html(data);});
  2094. // var $script = $doc.find('script:contains(H=~[])');
  2095. // if (!$script.length) {
  2096. // console.error('查找 script 失败');
  2097. // return
  2098. // }
  2099.  
  2100. // // 临时劫持
  2101. // var $ = {
  2102. // post: function(url, data, mCallback) {
  2103. // console.log('222222')
  2104. // $content.addClass(READER_AJAX)
  2105. // .attr({
  2106. // src: url,
  2107. // charset: 'UTF-8'
  2108. // })
  2109. // .data('post', data)
  2110. // .text('请等待加载…');
  2111.  
  2112. // callback()
  2113. // }
  2114. // };
  2115.  
  2116. // console.log('will eval script')
  2117. // debugger
  2118. // eval($script.text());
  2119.  
  2120. // // var funcStr = ''
  2121. // // var scriptFn = $script.text().trim().replace(/\(\);$/, '');
  2122. // // eval('funcStr = ' + scriptFn + '.toString()')
  2123. // } else {
  2124. // callback()
  2125. // }
  2126. // }
  2127. },
  2128.  
  2129. {siteName: '书海小说',
  2130. url: '^https?://www\\.shuhai\\.com/read/\\d+/\\d+\\.html',
  2131. bookTitleSelector: '.path2 a:nth-of-type(3)',
  2132. titleSelector: '.read_top h1',
  2133. prevSelector: '.read .read_dwn p a:nth-of-type(1)',
  2134. indexSelector: '.read .read_dwn p a:nth-of-type(2)',
  2135. nextSelector: '.read .read_dwn p a:nth-of-type(3)',
  2136. contentSelector: '.read .txt',
  2137. },
  2138. {siteName: "欢乐书客",
  2139. url: "^https?://www\\.hbooker\\.com/chapter/book_chapter_detail/\\d+",
  2140. bookTitleSelector: ".breakcrumb > a:last",
  2141. titleSelector: ".book-read-box .read-hd h3",
  2142. useiframe: true,
  2143. timeout: 500,
  2144. contentSelector: ".book-read-box .read-bd",
  2145. contentRemove: ".book-read-box .barrage, #J_BtnGuide, .book-read-box .read-bd i.num, .chapter i, .J_Num, .num, .book-read-box .read-hd p:nth-of-type(1) span",
  2146.  
  2147. indexSelector: ".book-read-page a.btn-list",
  2148. nextUrl: function ($doc){
  2149. return $doc.find('#J_BtnPageNext').attr('data-href');
  2150. },
  2151. prevUrl: function ($doc){
  2152. return $doc.find('#J_BtnPagePrev').attr('data-href');
  2153. },
  2154. },
  2155. {siteName: '棉花糖小说网',
  2156. url: '^https?://www\\.mht\\.la/\\d+/\\d+/\\d+\\.html',
  2157. bookTitleSelector: '.nav > a:nth-of-type(3)',
  2158. titleSelector: '.read_title h1',
  2159. prevSelector: '.pagego a:nth-of-type(1)',
  2160. indexSelector: '.pagego a:nth-of-type(2)',
  2161. nextSelector: '.pagego a:nth-of-type(3)',
  2162. contentSelector: '.content',
  2163. contentRemove: 'a, .contads',
  2164. contentReplace: [
  2165. '下载本书最新的txt电子书请点击:',
  2166. '本书手机阅读:',
  2167. '发表书评:',
  2168. '为了方便下次阅读,你可以在点击下方的.*谢谢您的支持!!',
  2169. '手机用户可访问wap.mianhuatang.la观看小说,跟官网同步更新.*',
  2170. ],
  2171. },
  2172. {siteName: '墨缘文学网',
  2173. url: '^https?://www\\.moyuanwenxue\\.com/xiaoshuo/\\d+/\\d+/\\d+\\.htm',
  2174. contentSelector: '#chapterContent',
  2175. contentReplace: [
  2176. {"ZHAN":"战"},
  2177. {"LU":"路"},
  2178. {"SHOU  QIANG":"手枪"},
  2179. {"si wang":"死亡"},
  2180. ],
  2181. },
  2182. // 必须先用键盘箭头翻页后变成 article\reader 的url后才不会有断章现象
  2183. {siteName: "格格党",
  2184. url: 'http://www\\.ggdown\\.com/modules/article/reader\\.php\\?aid=.*',
  2185. siteExample: 'http://www.ggdown.com/modules/article/reader.php?aid=41490&cid=13833393',
  2186. indexSelector: '.link.xb a:contains("返回列表")',
  2187. contentSelector: "#BookText",
  2188. contentReplace: [
  2189. '记住我们的网址噢。百度搜;格!!格!!党.或者直接输域名/g/g/d/o/w/n/./c/o/m',
  2190. ]
  2191. },
  2192. {siteName: "233言情",
  2193. url: 'http://233yq\\.com/xiaoshuo/.*/.*\\.html',
  2194. siteExample: 'http://233yq.com/xiaoshuo/UsRA_mfLLcU/cwsM8t2ibWE.html',
  2195. titleSelector: '.bname h1',
  2196. bookTitleSelector: '.b21 h3:first()',
  2197. contentSelector: ".cn",
  2198. contentRemove: '.bottem',
  2199. },
  2200. {siteName: "笔趣阁",
  2201. url: /^https?:\/\/www\.biquge\.com\.tw\/\d+_\d+\/\d+.html/,
  2202. siteExample: 'http://www.biquge.com.tw/17_17768/8280656.html',
  2203. contentSelector: "#content"
  2204. },
  2205. {siteName: '大主宰小说网',
  2206. url: 'www\\.daizhuzai\\.com/\\d+/\\d+\\.html',
  2207. bookTitleSelector: '.readbox article .info span:nth-of-type(1) a',
  2208. titleSelector: '.readbox article .title h1 a',
  2209. prevSelector: '.readbox .operate li:nth-of-type(1) a',
  2210. indexSelector: '.readbox .operate li:nth-of-type(2) a',
  2211. nextSelector: '.readbox .operate li:nth-of-type(3) a',
  2212. useiframe: true,
  2213. mutationSelector: "#chaptercontent",
  2214. mutationChildCount: 2,
  2215. timeout: 500,
  2216. contentSelector: '.readbox article .content',
  2217. contentRemove: '',
  2218. contentReplace: [
  2219. { '。&': '。' },
  2220. '△番茄小說○網☆',
  2221. '☆ 番茄○△小說網',
  2222. '番茄小說網☆',
  2223. ],
  2224. },
  2225. {siteName: "墨缘文学网",
  2226. url: "^http://www\\.mywenxue\\.com/xiaoshuo/\\d+/\\d+/\\d+\\.htm",
  2227. bookTitleSelector: '#htmltimu h1 a',
  2228. titleSelector: "#htmltimu h2 span",
  2229. prevSelector: ".papgbutton a:nth-of-type(1)",
  2230. indexSelector: ".papgbutton a:nth-of-type(2)",
  2231. nextSelector: ".papgbutton a:nth-of-type(3)",
  2232. useiframe: true,
  2233. contentSelector: '.contentbox > .contentbox',
  2234. contentRemove: "strong, a",
  2235. contentReplace: [
  2236. { 'ZHAN': '战' },
  2237. { 'SI议': '思议' },
  2238. { '意SI': '意思' },
  2239. { 'si wang': '死亡' },
  2240. { 'DING好': '定好' },
  2241. { '夺舍SHI': '夺舍式' },
  2242. { '招SHI': '招式' },
  2243. { '制SHI': '制式' },
  2244. { '正SHI': '正式' },
  2245. { '菜SHI': '菜式' },
  2246. { 'LU上': '路上' },
  2247. { '条LU': '条路' },
  2248. { '马LU': '马路' },
  2249. '更多请登录(不可用)墨缘文学网.*欢迎您的来访 &gt;&gt;&gt;',
  2250. '更多请登录(不可用)墨缘文学网.*欢迎您的来访\\[ .* \\]',
  2251. '\\( http.*墨缘文学网 \\)',
  2252. ],
  2253. },
  2254. {siteName: '大海中文',
  2255. url: 'http://www\\.dhzw\\.org/book/\\d+/\\d+/\\d+\\.html',
  2256. contentReplace: [
  2257. '恋上你看书网 630bookla.*',
  2258. ]
  2259. },
  2260. {siteName: '爱上书屋',
  2261. url: 'https?://www.23sw.net/\\d+/\\d+/\\d+.html',
  2262. titleReg: /(.*?) (.*?),/,
  2263. contentReplace: [
  2264. '\\[www.23sw.net\\]',
  2265. ]
  2266. },
  2267. {siteName: '书轩网',
  2268. url: '^https?://www.bookxuan.com/\\d+_\\d+/\\d+.html',
  2269. bookTitleSelector: '.con_top a:last',
  2270. contentReplace: [
  2271. { '&amp;quot;': '"', },
  2272. 'getreadset;',
  2273. // '&lt;div class=&quot;divimage&quot;&gt;&lt;img src=&quot;',
  2274. '&lt;div class="divimage"&gt;&lt;img src="',
  2275. ],
  2276. contentPatch: function($doc) {
  2277. $doc.find('#content[title="书,轩,网"]').remove();
  2278. }
  2279. },
  2280. {siteName: '大家读书院',
  2281. url: '^https?://www.dajiadu.net/files/article/html/\\d+/\\d+/\\d+.html',
  2282. contentSelector: '#content, #content1',
  2283. contentRemove: '.copy',
  2284. },
  2285. {siteName: '2k小说阅读网',
  2286. url: 'https?://www.2kxs.com/xiaoshuo/\\d+/\\d+/\\d+.html',
  2287. exampleUrl: 'http://www.2kxs.com/xiaoshuo/106/106185/23622820.html',
  2288. contentSelector: '.Text',
  2289. contentRemove: 'a, font, strong',
  2290. contentReplace: [
  2291. '2k小说阅读网',
  2292. ]
  2293. },
  2294.  
  2295. // 移动版
  2296. {siteName: "掌阅手机网",
  2297. url: "https?://wap\\.yc\\.ireader\\.com\\.cn/book/\\d+/\\d+/",
  2298. titleReg: "(.*?),.*?作品 - 掌阅小说网",
  2299. titlePos: 0,
  2300. titleSelector: "h4",
  2301. contentSelector: "div.text",
  2302. },
  2303.  
  2304. ];
  2305.  
  2306. // ===== 小说拼音字、屏蔽字修复 =====
  2307. // 运行在未替换 <br> 之前,.* 可能会造成全部替换
  2308. Rule.replace = {
  2309. // ===格式整理===
  2310. // "\\(|\\[|\\{|(|【|{":"(",
  2311. // "\\)|\\]|\\}|)|】|}":")",
  2312.  
  2313. // 需要?
  2314. ",": ",",
  2315. // ":": ":", "\\?":"?", // 会造成起点的图片无法替换
  2316.  
  2317. "\\*|*":"*",
  2318. "[wWwW]{3}":"www",
  2319. "w{3}(\u3001|\u3002)":"www.",
  2320. "[cCcC][oOoO][mMmM]":"com",
  2321. "[nNnN][eeEE][ttTT]":"net",
  2322. "[cCcC][nNnN]":"cn",
  2323. "(\\.|\u3001|\u3002)com":".com",
  2324. "(\\.|\u3001|\u3002)net":".net",
  2325. "(\\.|\u3001|\u3002)cn":".cn",
  2326. "[pPpP][sSsS][::]":"ps:",
  2327. "。{5,7}":"……","~{2,50}":"——","…{3,40}": "……","-{3,20}":"——",
  2328. //"。(,|,|。)": "。",
  2329. // "?(,|,)": "?",
  2330. //"”(,|,|。)": "”",
  2331. "@{3,}": "",
  2332.  
  2333. // === 段末的多余的r ===
  2334. "\\\\r<br>":"<br>",
  2335.  
  2336. // === 一些特殊的替换 ===
  2337. "\\[+CP.*(http://file.*\\.jpg)\\]+": "<img src='$1'>",
  2338. "『(.)』": "$1", // "『色』": "色",
  2339.  
  2340. // === 去广告 ===
  2341. "\\[搜索最新更新尽在[a-z\\.]+\\]": "",
  2342. "<a>手机用户请到m.qidian.com阅读。</a>": "",
  2343. ".{2,4}中文网欢迎广大书友": "",
  2344. "访问下载txt小说|◎雲來閣免费万本m.yunlaige.com◎":"",
  2345. "〖∷更新快∷无弹窗∷纯文字∷.*?〗": "",
  2346. '超快稳定更新小说[,,]':'', "本文由 。。 首发":"",
  2347. '”小说“小说章节更新最快': '',
  2348. '如果觉得好看,请把本站网址推荐给您的朋友吧!': '',
  2349. '本站手机网址:&nbsp;&nbsp;请互相通知向您QQ群【微博/微信】论坛贴吧推荐宣传介绍!': '',
  2350. "fqXSw\\.com":"", "\\.5du|\\.5du5\\.":"",
  2351. "\\[\\]":"",
  2352. "如果您觉得网不错就多多分享本站谢谢各位读者的支持": "",
  2353. "全文字无广告|\\(看书窝&nbsp;看书窝&nbsp;无弹窗全文阅读\\)": "",
  2354. "。。+[\\s ]*看最新最全小说": "",
  2355. "水印广告测试": "",
  2356. "\\(平南文学网\\)":"", "讀蕶蕶尐說網":"",
  2357. "比奇提示:如何快速搜自己要找的书籍":"", "《百度书名\\+比奇》即可快速直达":"",
  2358. "~无~错~小~说": "",
  2359.  
  2360. "\\(一秒记住小说界\\)|\\*一秒记住\\*":"",
  2361. "uutxt\\.org|3vbook\\.cn|www\\.qbwx\\.com|WWw\\.YaNkuai\\.com|www\\.btzw\\.com|www\\.23uS\\.com": "",
  2362. "txt53712/": "",
  2363. "\xa0{4,12}":"\xa0\xa0\xa0\xa0\xa0\xa0\xa0",
  2364.  
  2365. // === 通用去广告
  2366. "[wwW]{1,3}[.\\.]23uS[.\\.](?:coM|com)": "",
  2367.  
  2368. // === 星号屏蔽字还原 ===
  2369. // === 八九 ===
  2370. "十有(\\*{2})":"十有八九",
  2371. "十有bā'九":"十有八九",
  2372. "(\\*{2})不离十":"八九不离十",
  2373. "(\\*{2})点":"八九点",
  2374. "(\\*{2})个":"八九个",
  2375. "(\\*{2})岁":"八九岁",
  2376. "(\\*{2})成":"八九成",
  2377. "(\\*{2})年":"八九年",
  2378. "一八(\\*{2})":"一八八九",
  2379.  
  2380. // === SM ===
  2381. "G(\\*{2})":"GSM",
  2382.  
  2383. // === 情色 ===
  2384. "感(\\*{2})彩":"感情色彩",
  2385.  
  2386. // === 大法 ===
  2387. "强(\\*{2})u5B9D":"强大法宝",
  2388. "强(\\*{2})宝":"强大法宝",
  2389. "种魔(\\*{2})":"种魔大法",
  2390. "巨(\\*{2})":"巨大法",
  2391. "强(\\*{2})术":"强大法术",
  2392. "(\\*{2})师":"大法师",
  2393.  
  2394. // === 肉体 ===
  2395. "(\\*{2})凡胎": "肉体凡胎",
  2396. "夺取她的(\\*{2})":"夺取她的肉体",
  2397. "夺取他的(\\*{2})":"夺取他的肉体",
  2398. "(\\*{2})与精神":"肉体与精神",
  2399. "(\\*{2})素材":"肉体素材",
  2400. "(\\*{2})材料":"肉体材料",
  2401. "在(\\*{2})上":"在肉体上",
  2402.  
  2403. // === 赤裸 ===
  2404. "(\\*{4})着":"赤裸着",
  2405. "(\\*{2})裸":"赤裸裸",
  2406. "浑身(\\*{2})":"浑身赤裸",
  2407.  
  2408. // === 射 ===
  2409. "枪(\\*{4})":"枪发射",
  2410. "(\\*{4})而出":"喷射而出",
  2411. "光(\\*{2})":"光四射",
  2412.  
  2413. // === 鱼水 ===
  2414. "(\\*{2})之欢":"鱼水之欢",
  2415.  
  2416. // === 国军 ===
  2417. "(\\*{2})队":"国军队",
  2418. "(\\*{2})舰":"国军舰",
  2419. "(\\*{2})方":"国军方",
  2420.  
  2421. // === 露阴 ===
  2422. "暴(\\*{2})谋":"暴露阴谋",
  2423.  
  2424. // === 欲望 ===
  2425. "的(\\*{2})是无止境的":"的欲望是无止境的",
  2426. "邪恶的(\\*{2})":"邪恶的欲望",
  2427. "被(\\*{2})支配":"被欲望支配",
  2428. "掀桌的(\\*{2})":"掀桌的欲望",
  2429. "控制不住(\\*{2})":"控制不住欲望",
  2430. "求生的(\\*{2})":"求生的欲望",
  2431. "求生(\\*{2})":"求生欲望",
  2432. "购买(\\*{2})":"购买欲望",
  2433. "永无止境的(\\*{2})":"永无止境的欲望",
  2434. "(\\*{2})的发泄":"欲望的发泄",
  2435. "发泄(\\*{2})":"发泄欲望",
  2436. "杀戮(\\*{2})":"杀戮欲望",
  2437. "(\\*{2})和本能":"欲望和本能",
  2438.  
  2439. // === 呻吟 ===
  2440. "不堪重负的(\\*{2})":"不堪重负的呻吟",
  2441. "(\\*{2})声":"呻吟声",
  2442. "颤抖(\\*{2})":"颤抖呻吟",
  2443. "(\\*{2})颤抖":"呻吟颤抖",
  2444.  
  2445. // === 独立 ===
  2446. "宣布(\\*{2})":"宣布独立",
  2447. "(\\*{2})空间":"独立空间",
  2448.  
  2449. // === 荡漾 ===
  2450. "波纹(\\*{2})":"波纹荡漾",
  2451.  
  2452. // === 喘息 ===
  2453. "(\\*{2})之机":"喘息之机",
  2454.  
  2455. // === 大波 ===
  2456. "一(\\*{2})":"一大波",
  2457.  
  2458. // === 上供 ===
  2459. "(\\*{2})奉":"上供奉",
  2460.  
  2461. // === 奸淫 ===
  2462. "(\\*{2})掳掠":"奸淫掳掠",
  2463.  
  2464. // === 失身 ===
  2465. "有(\\*{2})份":"有失身份",
  2466.  
  2467. // === 六合 ===
  2468. "(\\*{2})八荒":"六合八荒",
  2469.  
  2470. // === 人祸 ===
  2471. "天灾(\\*{2})":"天灾人祸",
  2472.  
  2473. // === 轮红 ===
  2474. "一(\\*{2})日":"一轮红日",
  2475.  
  2476. // === 西藏 ===
  2477. "东躲(\\*{2})":"东躲西藏",
  2478.  
  2479. // === 被操 ===
  2480. "(\\*{2})纵":"被操纵",
  2481.  
  2482. // === 穷屌 ===
  2483. "(\\*{2})丝":"穷屌丝",
  2484.  
  2485. // === 销魂 ===
  2486. "(\\*{2})滋味":"销魂滋味",
  2487.  
  2488. // === 色水 ===
  2489. "血(\\*{2})晶":"血色水晶",
  2490.  
  2491. // === 偷用 ===
  2492. "偷(\\*{2})":"偷偷用",
  2493.  
  2494. // === 乳交 ===
  2495. "水(\\*{2})融":"水乳交融",
  2496.  
  2497.  
  2498. // === 多字替换 ===
  2499. "cao之过急":"操之过急", "chunguang大泄":"春光大泄",
  2500. "大公无si":"大公无私",
  2501. "fu道人家":"妇道人家", "放sōng'xià来":"放松下来",
  2502. "奸yin掳掠":"奸淫掳掠",
  2503. "空dangdang":"空荡荡",
  2504. "突发qing况": "突发情况",
  2505. "yin奉阳违":"阴奉阳违", "一yin一阳":"一阴一阳",
  2506.  
  2507. // === 双字替换 ===
  2508. "暧m[eè][iì]":"暧昧",
  2509. "bàn\\s*fǎ":"办法", "bucuo":"不错", "不liáng":"不良", "b[ěe]i(\\s|&nbsp;)*j[īi]ng":"北京","半shen": "半身", "b[ìi]j[ìi]ng":"毕竟", "报(了?)jing":"报$1警", "bèi'pò":"被迫", "包yǎng":"包养", "(?:biǎo|婊\\\\?)子":"婊子", "biǎo\\s*xiàn\\s*":"表现",
  2510. "chifan":"吃饭", "ch[oō]ngd[oò]ng":"冲动", "chong物":"宠物", "cao(练|作)":"操$1", "出gui":"出轨", "chu\\s*xian":"出现", "缠mian": "缠绵", "成shu": "成熟", "(?:赤|chi)\\s*lu[oǒ]": "赤裸", "春guang": "春光", "chun风":"春风", "chuang伴":"床伴", "沉mi":"沉迷", "沉lun":"沉沦", "刺ji":"刺激", "chao红":"潮红", "初chun":"初春", ""chi luo"":"赤裸",
  2511. "dān\\s*xīn":"当心", "dang校": "党校", "da子": "鞑子", "大tui":"大腿", "dǎ\\s*suàn":"打算", "dengdai":"等待", "电huà":"电话", "diao丝": "屌丝", "d[úu](?:\\s|&nbsp;|<br/>)*l[ìi]": "独立", "d[uú]\\s{0,2}c[áa]i":"独裁", "d?[iì]f[āa]ng":"地方", "d[ìi]\\s*d[ūu]":"帝都", "di国|帝guo":"帝国", "du[oò]落":"堕落", "坠luò":"坠落",
  2512. "f[ǎa]ngf[óo]":"仿佛", "fei踢": "飞踢", "feng流": "风流", "风liu": "风流", "f[èe]nn[ùu]":"愤怒", "fǎn\\s*yīng":"反应",
  2513. "gao潮": "高潮", "高氵朝":"高潮", "gāo\\s*xìng\\s*":"高兴", "干chai": "干柴", "勾yin":"勾引", "gu[oò]ch[ée]ng":"过程", "gu[āa]n\\s*x[iì]":"关系", "g[ǎa]nji[àa]o":"感觉", "国wu院":"国务院", "gù\\s*yì\\s*":"故意", "guofen":"过分",
  2514. "hā\\s*hā\\s*":"哈哈", "h[aǎ]ode":"好的", "hù士":"护士", "火qiang":"火枪", "há'guó":"韩国", "han住": "含住", "hai洛因": "海洛因", "红fen": "红粉", "火yao": "火药", "h[ǎa]oxi[àa]ng":"好像", "hu[áa]ngs[èe]":"黄色", "皇d[ìi]":"皇帝", "昏昏yu睡":"昏昏欲睡", "回dang":"回荡", "huí\\s*qù\\s*":"回去", "hé\\s*shì\\s*":"合适",
  2515. "jian(臣|细)":"奸$1", "奸yin":"奸淫", "jiànmiàn":"见面", "jian货":"贱货", "jing察":"警察", "j[ìi]nháng":"进行", "jīng\\s*guò":"经过", "ji烈":"激烈", "j[iì](nv|女)": "妓女", "jirou": "鸡肉", "ji者":"记者", "jì\\s*xù\\s*":"继续", "ju花":"菊花","j[īi]动":"激动", "jili[èe]":"激烈", "肌r[òo]u":"肌肉","ji射":"激射", "ji[ēe]ch[uù]":"接触", "jiù\\s*shì":"就是", "j[ùu]li[èe]": "剧烈", "jǐng惕": "警惕", "节cao":"节操", "浸yin":"浸淫", "jù\\s*jué\\s*":"拒绝", "jue色":"角色",
  2516. "k[ěe]n[ée]ng": "可能", "开bao": "开苞", "k[àa]o近": "靠近", "口wen":"口吻", "kankan":"看看",
  2517. "ling辱": "凌辱", "luan蛋": "卵蛋", "脸sè": "脸色", "lu出":"露出", "流máng":"流氓", "lun理":"伦理", "lì\\s*qì":"力气",
  2518. "m[ǎa]ny[ìi]":"满意", "m[ǎa]sh[àa]ng":"马上", "m[ée]iy[oǒ]u":"没有", "mei国": "美国", "m[íi]ngb[áa]i":"明白", "迷huan": "迷幻", "mi茫":"迷茫", "mó\\s*yàng":"模样", "m[íi]n\\s{0,2}zh[ǔu]": "民主", "迷jian": "迷奸", "mimi糊糊":"迷迷糊糊", "末(?:\\s|<br/?>)*ì":"末日", "面se":"面色", "mengmeng":"蒙蒙",
  2519. "nàme":"那么", "n[ǎa]o\\s*d[àa]i":"脑袋", "n[ée]ngg[oò]u":"能够", "nán\\s{0,2}hǎi": "那会", "内jian":"内奸", "[内內]y[iī]":"内衣", "内ku":"内裤",
  2520. "pi[áa]o客":"嫖客", "p[áa]ngbi[āa]n":"旁边",
  2521. "q[íi]gu[àa]i":"奇怪", "qing\\s*(ren|人)":"情人", "qin兽":"禽兽", "q[iī]ngch[uǔ]":"清楚", "què\\s*dìng":"确定", "球mi":"球迷", "青chun":"青春", "青lou":"青楼", "qingkuang":"情况", "qiang[ \\s]*jian":"强奸",
  2522. "re\\s*nao":"热闹", "r[úu]gu[oǒ]":"如果", "r[oó]ngy[ìi]":"容易", "ru(房|白色)": "乳$1", "rén员":"人员", "rén形":"人形", "人chao":"人潮", "renmen":"人名",
  2523. "上jiang":"上将", "she(门|术|手|程|击)":"射$1", "sudu":"速度", "shuijue":"睡觉", "shide":"是的", "sh[iì]ji[eè]":"世界", "sh[ií]ji[aā]n":"时间", "sh[ií]h[oò]u": "时候", "sh[ií]me":"什么", "si人":"私人", "shi女":"侍女", "shi身": "失身", "sh[ūu]j[ìi]":"书记", "shu女": "熟女", "shu[ \\s]?xiong":"酥胸", "(?:上|shang)chuang": "上床", "呻y[íi]n": "呻吟", "sh[ēe]ngzh[íi]": "生殖", "深gu": "深谷", "双xiu": "双修", "生r[ìi]": "生日", "si盐":"私盐", "shi卫":"侍卫", "si下":"私下", "sao扰":"骚扰", "shuang feng":"双峰",
  2524. "t[uū]r[áa]n":"突然", "tiaojiao": "调教", "偷qing":"偷情", "推dao": "推倒", "脱guang": "脱光", "t[èe]bi[ée]":"特别", "t[ōo]nggu[òo]":"通过", "同ju":"同居", "tian来tian去":"舔来舔去",
  2525. "w[ēe]ixi[ée]":"威胁", "wèizh[ìi]":"位置", "wei员":"委员", "w[èe]nti":"问题", "wèi\\s*dào\\s*":"味道", "wú\\s*nài":"无奈", "weilai":"未来",
  2526. "xiu长": "修长", "亵du": "亵渎", "xing福": "幸福", "小bo":"小波", "小niū":"小妞", "xiong([^a-z])":"胸$1", "小tui":"小腿", "xiang港":"香港", "xiàohuà":"笑话", "xiàn\\'zhì":"限制", "xiōng\\s*dì":"兄弟", "选zé":"选择",
  2527. "yì\\s*wài\\s*":"意外", "yin(冷|暗|谋|险|沉|沟|癸派|后)":"阴$1", "y[iī]y[àa]ng":"一样", "y[īi]di[ǎa]n":"一点", "yī\\s*zhèn":"一阵", "y[ǐi]j[īi]ng":"已经", "疑huo":"疑惑", "yí\\s*huò":"疑惑", "影mi":"影迷", "yin荡":"淫荡", "yin贼":"淫贼", "阳w[ěe]i": "阳痿", "yao头": "摇头", "yaotou": "摇头", "摇tou": "摇头", "yezhan": "野战", "you饵": "诱饵", "(?:you|诱)(?:惑|huo)": "诱惑", "you导": "诱导", "引you": "引诱", "you人": "诱人", "youshi":"有事", "you\\s*xiu":"优秀", "御yòng":"御用", "旖ni":"旖旎", "yu念":"欲念", "you敌深入":"诱敌深入", "影she":"影射", "牙qian":"牙签", "一yè情":"一夜情",
  2528. "z[iì]j[iǐ]": "自己","z[ìi](?:\\s|<br/?>|&nbsp;)*y[oó]u": "自由","zh[iī]d?[àa]u?o":"知道", "zixin":"自信", "zhì'fú":"制服", "zha药": "炸药", "zhan有": "占有", "zhè\\s*gè":"这个", "政f[ǔu]|zheng府": "政府", "zh[èe]ng\\s{0,2}f[uǔ]": "政府", "zong理":"总理", "zh[ōo]ngy[āa]ng": "中央", "中yang":"中央", "zu[oǒ]\\s*y[oò]u":"左右", "zhǔ\\s*dòng":"主动", "zh[oō]uw[ée]i":"周围", "中nan海":"中南海", "中j委":"中纪委", "中zu部":"中组部", "政zhi局":"政治局", "(昨|一|时|余)(?:<br/?>|&nbsp;|\\s)*ì":"$1日", "照she":"照射", "zhǔn\\s*bèi\\s*":"准备", "zhu义":"主义",
  2529.  
  2530. "</p>\\n<p>\\s*ì":"日",
  2531.  
  2532. '曹艹': '曹操',
  2533. 'JI昂': '激昂',
  2534. '□□无暇': '自顾无暇',
  2535. '法律/界': '法律界',
  2536. '人/类': '人类',
  2537. '恐怖/主义': '恐怖主义',
  2538. '颠/覆': '颠覆',
  2539. '民.事.司.法.裁.判': '民事司法裁判',
  2540. '南海/问题': '南海问题',
  2541. '圈圈/功': '法轮功',
  2542. '镇/压': '镇压',
  2543. '赤.裸': '赤裸',
  2544. '欲·望': '欲望',
  2545. 'nv真': '女真',
  2546. '土gai': '土改',
  2547. '狗·屎': '狗屎',
  2548. 'du立': '独立',
  2549. '发sao': '发骚',
  2550. '奸/夫/淫/妇': '奸夫淫妇',
  2551. '爱qing': '爱情',
  2552. '抚mo': '抚摸',
  2553. '神qing': '神情',
  2554. '公~务~员': '公务员',
  2555. '原着': '原著',
  2556. '□□部分': '高潮部分',
  2557. '角□□面': '角色情面',
  2558. '艹': '操',
  2559. '淫/靡/香/艳': '淫靡香艳',
  2560. '毒丨药': '毒药',
  2561. '登6': '登陆',
  2562. '天□□美': '天性爱美',
  2563. '双丨飞': '双飞',
  2564. '高chao': '高潮',
  2565. 'pi股': '屁股',
  2566. '情/趣': '情趣',
  2567. '情/欲': '情欲',
  2568. '炸/弹': '炸弹',
  2569. '赤/身': '赤身',
  2570. '果/体': '裸体',
  2571. 'zhong国': '中国',
  2572. '帝国#主义': '帝国主义',
  2573. '形形□□': '形形色色',
  2574. 'yuwang': '欲望',
  2575. 'shuangtui': '双腿',
  2576. '城/管': '城管',
  2577. '调丨教': '调教',
  2578. '银/行/卡': '银行卡',
  2579. '裸/体': '裸体',
  2580. '光/裸': '光裸',
  2581. '嫩/女': '嫩女',
  2582. '维/谷': '维谷',
  2583. '开□□谈': '开始交谈',
  2584. '破碎的□□': '破碎的呻吟',
  2585. 'pi霜': '砒霜',
  2586. 'ma醉': '麻醉',
  2587. '麻zui': '麻醉',
  2588. 'nue杀': '虐杀',
  2589. '后gong': '后宫',
  2590. '林荫dao': '林荫道',
  2591. '分/身': '分身',
  2592. '克/隆': '克隆',
  2593. '性/需要': '性需要',
  2594. '黑/帮': '黑帮',
  2595. '政-府': '政府',
  2596. '八/九': '八九',
  2597. '不~着~寸~缕': '不着寸缕',
  2598. '肉~体': '肉体',
  2599. '蹲□子': '蹲下身子',
  2600. 'ji情': '激情',
  2601. 'xie恶': '邪恶',
  2602. 'Z国': '中国',
  2603. '创/世': '创世',
  2604. '紫jin城': '紫禁城',
  2605. '□□在外': '裸露在外',
  2606. '光怪6离': '光怪陆离',
  2607. '邪/教': '邪教',
  2608. '粗bao': '粗暴',
  2609. 'yin邪': '淫邪',
  2610. '小biao砸': '小婊砸',
  2611.  
  2612. '牛1b': '牛b', '微1博': '微博', '内1衣': '内衣',
  2613. };
  2614.  
  2615. // 单字替换,可能会误替换,所以需要特殊处理
  2616. (function(){
  2617. var oneWordReplace = {
  2618. "b[āà]ng":"棒","bào":"爆","bà":"吧","bī":"逼","bō":"波", "biàn":"便",
  2619. "cāo": "操", "cǎo": "草", "cào": "操", "chāng": "娼", "chang": "娼", "cháo": "潮", "chā": "插", "chéng": "成", "chōu": "抽", "chuáng": "床", "chún": "唇", "chūn": "春", "cuō": "搓", "cū": "粗",
  2620. "dǎng": "党", "dàng": "荡", "dāo": "刀", "dòng": "洞", "diao": "屌", "diǎn": "点",
  2621. "fǎ": "法", "féi": "肥", "fù": "妇",
  2622. "guān": "官",
  2623. "hán": "含", "hóu": "喉", "hòu":"后", "h(u)?ā": "花", "huá": "华", "huì":"会", "huò": "惑", "hùn": "混", "hún": "魂",
  2624. "jiǔ": "九", "jīng": "精", "jìn": "禁", "jǐng": "警", "jiāng": "江", "jiān": "奸", "jiāo": "交", "jūn": "军", "jū": "拘", "jú": "局", "jī": "激", "激ān":"奸",
  2625. "kù": "裤", "kàn": "看",
  2626. "[1l]àng": "浪", "liáo": "撩", "liú":"流", "lì":"莉", "liè":"烈", "[1l]uàn":"乱", "lún":"伦", "luǒ":"裸", "lòu":"露", "[l1]ù":"露", "lǜ":"绿", "liàn":"练",
  2627. "mǎi": "买", "mài": "卖", "máo": "毛", "mā": "妈", "méng": "蒙", "mén": "门", "miè": "灭", "mí": "迷", "mì": "蜜", "mō": "摸", "miàn":"面",
  2628. "nǎi": "奶", "nèn": "嫩", "niào": "尿", "niē": "捏", "nòng": "弄", "nǚ": "女",
  2629. "pào": "炮", "piàn": "片", "pò":"破",
  2630. "qi[āa]ng": "枪", "qíng": "情", "qīn": "亲", "qiú": "求", "quán": "全", "qù":"去",
  2631. "rén":"人", "rì": "日", "rǔ": "乳",
  2632. "sǎ":"洒", "sāo":"骚", "sǎo": "骚", "sè": "色", "shā": "杀", "shēn":"呻", "shén":"神", "shè": "射", "shǐ": "屎", "shì": "侍", "sǐ": "死", "sī": "私", "shǔn": "吮", "sǔn": "吮", "sū": "酥", "shào":"绍",
  2633. "tān":"贪", "tiǎn": "舔", "tǐng":"挺", "tǐ": "体", "tǒng": "捅", "tōu": "偷", "tou": "偷", "tuǐ": "腿", "tūn": "吞", "tún": "臀", "tiáo":"调", "tài":"态", "tào":"套",
  2634. "wēn": "温", "wěn": "吻",
  2635. "xiǎo":"小", "xiào":"笑", "xìng": "性", "xiōng": "胸", "xī": "吸", "xí": "习", "xì":"系", "xìn":"信", "xué": "穴", "xuè": "穴", "xùe": "穴", "xuan":"宣", "xiàng":"象",
  2636. "yāng":"央", "yàn":"艳", "yīn":"阴", "yào": "药", "yé": "爷", "yòu": "诱", "zàng": "脏", "yù": "欲", "yín": "淫", "yì":"意", "yà":"讶",
  2637. "zhēn":"针", "zēn":"针", "zhà":"炸", "zhèng":"政", "zǒu": "走", "zuì":"罪", "zuò":"做", "zhōng":"中",
  2638.  
  2639. "ri":"日", "se":"色", "yu":"欲", "xing":"性",
  2640. "jing":"精", "ting":"挺",
  2641. };
  2642.  
  2643. var replaceOthers = {
  2644. // ===误替换还原===
  2645. "碧欲": "碧玉", "美欲": "美玉","欲石": "玉石","惜欲": "惜玉","宝欲": "宝玉",
  2646. "品性": "品行", "德性": "德行",
  2647. "波ok": "book", "波SS": "BOSS",
  2648.  
  2649. // ===其他修正===
  2650. "弥俩": "你俩",
  2651. "妳": "你",
  2652. "圞|垩|卝|龘":"",
  2653. "大6": "大陆",
  2654. };
  2655.  
  2656. _.each(oneWordReplace, function(value, key) {
  2657. Rule.replace['([^a-z\\s])' + key + '(?![a-z])'] = '$1' + value;
  2658. });
  2659.  
  2660. _.extend(Rule.replace, replaceOthers);
  2661. })();
  2662.  
  2663. // ===== 全局移除,在替换 <br> 为 \n 之后 =====
  2664. Rule.replaceAll = [
  2665. // 长文字替换
  2666. // 排序代码:newArr = arr.sort((a, b) => { var diff = a.charCodeAt(1) - b.charCodeAt(1); if (diff == 0) return b.length - a.length; return diff; })
  2667. "\\(跪求订阅、打赏、催更票、月票、鲜花的支持!\\)",
  2668. "\\(?未完待续请搜索飄天文學,小说更好更新更快!",
  2669. "\\(跪求订阅、打赏、催更票、月票、鲜花的支持!",
  2670. "\\(看小说到网\\)",
  2671. "\\(未完待续。\\)",
  2672. "\\(本章完\\)",
  2673. "16977小游戏每天更新好玩的小游戏,等你来发现!",
  2674. "(800小说网 www.800Book.net 提供Txt免费下载)最新章节全文阅读-..-",
  2675. "(800小说网 www.800Book.net 提供Txt免费下载)",
  2676. "\\[800\\]\\[站页面清爽,广告少,",
  2677. "\\[看本书最新章节请到求书 .\\]",
  2678. "(\\s*君子聚义堂)",
  2679. "readx;",
  2680. "txt电子书下载/",
  2681. "txt全集下载",
  2682. "txt小说下载",
  2683. "\\|优\\|优\\|小\\|说\\|更\\|新\\|最\\|快\\|www.uuxs.cc\\|",
  2684. "\\|每两个看言情的人当中,就有一个注册(不可用)过可°乐°小°说°网的账号。",
  2685. "思ˊ路ˋ客,更新最快的!",
  2686. "恋上你看书网 630bookla ,最快更新.*",
  2687. ",举报后维护人员会在两分钟内校正章节内容,请耐心等待,并刷新页面。",
  2688. "追书必备",
  2689. "-优-优-小-说-更-新-最-快-www.UUXS.CC-",
  2690. "-优-优-小-说-更-新-最-快x",
  2691. "来可乐网看小说",
  2692. "纯文字在线阅读本站域名手机同步阅读请访问",
  2693. "本文由  首发",
  2694. "樂文小说",
  2695. '最快更新无错小说阅读,请访问 请收藏本站阅读最新小说!',
  2696. "最新章节全文阅读看书神器\\.yankuai\\.",
  2697. "最新章节全文阅读(..首发)",
  2698. "最新章节全文阅读【首发】",
  2699. "最新章节全文阅读",
  2700. "看本书最新章节请到800小说网(www.800book.net)",
  2701. "(本章未完,请翻页)",
  2702. "手机用户请浏览m.biqugezw.com阅读,更优质的阅读体验。",
  2703. "手机用户请浏览阅读,更优质的阅读体验。",
  2704. "手机最省流量无广告的站点。",
  2705. "手机看小说哪家强手机阅",
  2706. "如果你喜欢本站[〖]?一定要记住[】]?(?:网址|地址)哦",
  2707. "看清爽的小说就到",
  2708. "请用搜索引擎(?:搜索关键词)?.*?完美破防盗章节,各种小说任你观看",
  2709. "完美破防盗章节,请用搜索引擎各种小说任你观看",
  2710. "破防盗章节,请用搜索引擎各种小说任你观看",
  2711. "(?:搜索引擎)?各种小说任你观看,破防盗章节",
  2712. "章节错误,点此举报\\(免注册(不可用)\\)",
  2713. "热门小说最新章节全文阅读.。 更新好快。",
  2714. "【阅读本书最新章节,请搜索800】",
  2715. "亲,百度搜索眼&amp;快,大量小说免费看。",
  2716. "亲,眼&快,大量小说免费看。",
  2717. '下载免费阅读器!!',
  2718. '笔趣阁&nbsp;.,最快更新.*最新章节!',
  2719. '请大家搜索(书迷楼)看最全!更新最快的小说',
  2720. '更新快无广告。',
  2721.  
  2722. // 复杂规则的替换
  2723. '(看小说到|爱玩爱看就来|就爱上|喜欢)?(\\s|<|>|&| |[+@@=:;``%?》《〈︾-])?[乐樂](\\s|&lt;|&gt;|&amp;|&nbsp;|[+@@=:;``%?》《〈︾-])?[文].*?[说說][网]?[|]?(.*(3w|[wωWw]{1,3}|[Mm]).*[mMm])?[}。\\s]?(乐文小说)?',
  2724. '(本文由|小说)?(\\s| )?((3w|[wWw]{1,3}|[Mm]).)?\\s?[lしlL][wωWw][xχXx][sSs][55][22][00].*[mMm][|\\s]?(首发(哦亲)?)?',
  2725. '([『【↑△↓@︾]+[\u4E00-\u9FA5]){2,6}[】|]',
  2726.  
  2727. // 包含 \P 的替换
  2728. '\\P{1,2}[顶頂].{1,3}[点小].*?o?[mw,]',
  2729. '\\P.?长.{1,2}风.{1,2}文.{1,2}学.*?[tx]',
  2730. '\\P无.错.*?[cC][oO][mM]',
  2731. '[;\\(]顶.{0,2}点.小说',
  2732. '2长2风2文2学,w¢$',
  2733. '》长>风》',
  2734.  
  2735. // 包含 .* 的,可能有多余的替换
  2736. '看无防盗章节的小说,请用搜索引擎搜索关键词.*',
  2737. '(?:完美)?破防盗章节,请用搜索引擎搜索关键词.*',
  2738. '破防盗完美章节,请用搜索引擎.*各种小说任你观看',
  2739. '如您已(?:閱讀|阅读)到此章节.*?敬请记住我们新的网址\\s*。',
  2740. '↗百度搜:.*?直达网址.*?↖',
  2741. "[:《〈|~∨∟∑]{1,2}长.{1,2}风.*?et",
  2742. '\\[限时抢购\\].*',
  2743. '支持网站发展.逛淘宝买东西就从这里进.*',
  2744. 'ps[::]想听到更多你们的声音,想收到更多你们的建议,现在就搜索微信公众号“qdread”并加关注,给.*?更多支持!',
  2745. '(?:ps[::])?看《.*?》背后的独家故事.*?告诉我吧!',
  2746. '(?天上掉馅饼的好活动.*?微信公众号!)?',
  2747. '(微信添加.*qdread微信公众号!)',
  2748. 'jiemei如您已阅读到此章节,请移步到.*?\\[ads:本站换新网址啦,速记方法:,.\\]',
  2749. '.*关注微信公众号.*',
  2750. '一秒记住.*',
  2751.  
  2752. // 短文字替换
  2753. '\\[txt全集下载\\]',
  2754. '\\[\\s*超多好看小说\\]',
  2755. '⊙四⊙五⊙中⊙文☆→',
  2756. '\\[ads:本站换新网址啦,速记方法:.*?\\]',
  2757. '[》《|~]无(?:.|&gt;)错(?:.|&gt;)小说',
  2758. '`无`错`小说`www.``com', '+无+错+小说+3w++',
  2759. '\\|优\\|优\\|小\\|说\\|更\\|新\\|最\\|快X',
  2760. '▲∴', '8,ww←',
  2761. /www.23+?[Ww][Xx].[Cc]om/ig,
  2762. /热门推荐:、+/g,
  2763. /h2&gt;/g,
  2764. '[《〈》>\\+|~[\\]]无\\1错\\1', '》无>错》',
  2765.  
  2766. '女凤免费小说抢先看', '女凤小说网全文字 无广告',
  2767. '乐文小说网?', '《乐〈文《小说', '乐文移动网', '頂点小说', '頂點小說',
  2768. '追小说哪里快去眼快',
  2769. '\\[书库\\].\\[774\\]\\[buy\\].kuai',
  2770.  
  2771. /'ads_wz_txt;',|百度搜索|无弹窗小说网|更新快无弹窗纯文字|高品质更新|小说章节更新最快|\(百度搜.\)|全文字手打|“”&nbsp;看|无.弹.窗.小.说.网|追书网|〖∷∷无弹窗∷纯文字∷ 〗/g,
  2772. ];
  2773.  
  2774.  
  2775. // 自定义的
  2776. Rule.customRules = [];
  2777. Rule.customReplace = {};
  2778.  
  2779. Rule.parseCustomReplaceRules = function(str) {
  2780. var arr = str.split(/\n/);
  2781. var rules = {};
  2782. _.each(arr, function(b) {
  2783. var pos = b.indexOf('=');
  2784. if (pos === -1) return;
  2785.  
  2786. var key = b.substring(0, pos),
  2787. value = b.substring(pos + 1, b.length);
  2788. rules[key] = value;
  2789. });
  2790. return rules;
  2791. };
  2792.  
  2793.  
  2794. var getBooleanConfig = function(configName, defaultValue) {
  2795. var config = GM_getValue(configName);
  2796. if(config === undefined) {
  2797. GM_setValue(configName, defaultValue);
  2798. config = defaultValue;
  2799. }
  2800. return config;
  2801. };
  2802.  
  2803. var Config = {
  2804. getDisableAutoLaunch: function() { // 强制手动启用模式
  2805. return getBooleanConfig("disable_auto_launch", false);
  2806. },
  2807. setDisableAutoLaunch: function(bool) {
  2808. GM_setValue("disable_auto_launch", bool);
  2809. },
  2810.  
  2811. // 按键调用会遇到问题: Greasemonkey 访问违规:unsafeWindow 无法调用 GM_getValue
  2812. // 故改成这种形式
  2813. copyCurTitle: getBooleanConfig("copyCurTitle", true),
  2814. setCopyCurTitle: function (bool) {
  2815. this.copyCurTitle = !!bool;
  2816. GM_setValue("copyCurTitle", !!bool);
  2817. },
  2818.  
  2819. get cn2tw() {
  2820. if (_.isUndefined(this._cn2tw)) {
  2821. this._cn2tw = getBooleanConfig('cn2tw', Config.lang === 'zh-TW' ? true : false);
  2822. }
  2823. return this._cn2tw;
  2824. },
  2825. set cn2tw(bool) {
  2826. GM_setValue('cn2tw', bool);
  2827. this._cn2tw = bool;
  2828. },
  2829.  
  2830. get booklink_enable() { // booklink.me 跳转的自动启动
  2831. return getBooleanConfig("booklink_enable", true);
  2832. },
  2833. set booklink_enable(bool) {
  2834. GM_setValue("booklink_enable", bool);
  2835. },
  2836.  
  2837. get debug() { // 调试
  2838. if (_.isUndefined(this._debug)) {
  2839. this._debug = getBooleanConfig("debug", false);
  2840. }
  2841. return this._debug;
  2842. },
  2843. set debug(bool) {
  2844. this._debug = bool;
  2845. GM_setValue("debug", bool);
  2846. toggleConsole(bool);
  2847. },
  2848.  
  2849. get addToHistory() {
  2850. if (_.isUndefined(this._addToHistory)) {
  2851. this._addToHistory = getBooleanConfig("add_nextpage_to_history", true);
  2852. }
  2853. return this._addToHistory;
  2854. },
  2855. set addToHistory(bool) {
  2856. this._addToHistory = bool;
  2857. GM_setValue("add_nextpage_to_history", bool);
  2858. },
  2859.  
  2860. get dblclickPause() {
  2861. return getBooleanConfig('dblclick_pause', true);
  2862. },
  2863. set dblclickPause(bool) {
  2864. GM_setValue('dblclick_pause', bool);
  2865. },
  2866.  
  2867. get remain_height() { // 距离底部多少高度(px)开始加载下一页
  2868. if(_.isUndefined(this._remain_height)){
  2869. this._remain_height = parseInt(GM_getValue("remain_height"), 10) || 400;
  2870. }
  2871. return this._remain_height;
  2872. },
  2873. set remain_height(val) {
  2874. this._remain_height = val;
  2875. GM_setValue("remain_height", val);
  2876. },
  2877.  
  2878. get lang() {
  2879. if (_.isUndefined(this._lang)) {
  2880. this._lang = GM_getValue("lang") || ((navigator.language === "zh-TW" || navigator.language === "zh-HK") ? "zh-TW" : "zh-CN");
  2881. }
  2882. return this._lang;
  2883. },
  2884. set lang(val) {
  2885. this._lang = val;
  2886. GM_setValue("lang", val);
  2887. },
  2888.  
  2889. get font_family() {
  2890. return GM_getValue("font_family") || "微软雅黑,宋体,黑体,楷体".uiTrans();
  2891. },
  2892. set font_family(val) {
  2893. GM_setValue("font_family", val);
  2894. },
  2895.  
  2896. get font_size() { // 字体大小
  2897. return GM_getValue("font_size") || "18px";
  2898. },
  2899. set font_size(val) {
  2900. GM_setValue("font_size", val);
  2901. },
  2902.  
  2903. get text_line_height(){
  2904. return GM_getValue("text_line_height") || "2em";
  2905. },
  2906. set text_line_height(val){
  2907. GM_setValue("text_line_height", val);
  2908. },
  2909.  
  2910. get content_width() { // 内容宽度
  2911. return GM_getValue("content_width") || "800px";
  2912. },
  2913. set content_width(val) {
  2914. GM_setValue("content_width", val);
  2915. },
  2916.  
  2917. get extra_css() {
  2918. return GM_getValue("extra_css", "");
  2919. },
  2920. set extra_css(val) {
  2921. GM_setValue("extra_css", val);
  2922. },
  2923.  
  2924. get customSiteinfo() {
  2925. return GM_getValue('custom_siteinfo', '[]');
  2926. },
  2927. set customSiteinfo(val) {
  2928. GM_setValue('custom_siteinfo', val);
  2929. },
  2930.  
  2931. get customReplaceRules() {
  2932. var rules = GM_getValue('custom_replace_rules', 'b[āà]ng=棒\n『(.)』=$1');
  2933.  
  2934. return rules;
  2935. },
  2936. set customReplaceRules(val) {
  2937. GM_setValue('custom_replace_rules', val);
  2938. },
  2939.  
  2940. get skin_name() {
  2941. return GM_getValue("skin_name") || "缺省皮肤".uiTrans();
  2942. },
  2943. set skin_name(val) {
  2944. GM_setValue("skin_name", val);
  2945. },
  2946.  
  2947. get menu_list_hiddden() {
  2948. return getBooleanConfig("menu_list_hiddden", false);
  2949. },
  2950. set menu_list_hiddden(bool) {
  2951. GM_setValue("menu_list_hiddden", bool);
  2952. },
  2953.  
  2954. get hide_footer_nav() {
  2955. return getBooleanConfig("hide_footer_nav", true);
  2956. },
  2957. set hide_footer_nav(bool) {
  2958. GM_setValue("hide_footer_nav", bool);
  2959. UI.hideFooterNavStyle(bool);
  2960. },
  2961.  
  2962. get hide_preferences_button() {
  2963. return getBooleanConfig("hide_preferences_button", false);
  2964. },
  2965. set hide_preferences_button(bool) {
  2966. GM_setValue('hide_preferences_button', bool);
  2967. },
  2968.  
  2969. // === 快捷键
  2970.  
  2971. // 安静模式切换快捷键
  2972. get quietModeKey() {
  2973. if (this._quietModeKey) {
  2974. return this._quietModeKey;
  2975. }
  2976. this._quietModeKey = GM_getValue('quietModeKey') || 'q';
  2977.  
  2978. return this._quietModeKey;
  2979. },
  2980. set quietModeKey(keyCode) {
  2981. this._quietModeKey = keyCode;
  2982. GM_setValue('quietModeKey', keyCode);
  2983. },
  2984.  
  2985. // 打开设置窗口的快捷键
  2986. get openPreferencesKey() {
  2987. if (this._openPreferencesKey) {
  2988. return this._openPreferencesKey;
  2989. }
  2990. this._openPreferencesKey = GM_getValue('open_preferences_key') || 's';
  2991.  
  2992. return this._openPreferencesKey;
  2993. },
  2994. set openPreferencesKey(keyCode) {
  2995. this._openPreferencesKey = keyCode;
  2996. GM_setValue('open_preferences_key', keyCode);
  2997. },
  2998.  
  2999. // 隐藏左侧章节列表的快捷键
  3000. get hideMenuListKey() { // 默认为 c
  3001. // 'C'.charCodeAt(0) = 67
  3002. if (this._hideMenuListKey) {
  3003. return this._hideMenuListKey;
  3004. }
  3005. this._hideMenuListKey = GM_getValue('hide_menulist_key') || 'c';
  3006.  
  3007. return this._hideMenuListKey;
  3008. },
  3009. set hideMenuListKey(key) {
  3010. this._hideMenuListKey = key;
  3011. GM_setValue("hide_menulist_key", key);
  3012. },
  3013.  
  3014. get picNightModeCheck() {
  3015. return getBooleanConfig('picNightModeCheck', true);
  3016. },
  3017. set picNightModeCheck(bool) {
  3018. GM_setValue('picNightModeCheck', bool);
  3019. },
  3020.  
  3021. get split_content() {
  3022. if (_.isUndefined(this._split_content)) {
  3023. this._split_content = GM_getValue('split_content', true);
  3024. }
  3025. return this._split_content;
  3026. },
  3027. set split_content(bool) {
  3028. this._split_content = bool;
  3029. GM_setValue('split_content', bool);
  3030. },
  3031.  
  3032. get scrollAnimate() {
  3033. return GM_getValue('scrollAnimate', false);
  3034. },
  3035. set scrollAnimate(bool) {
  3036. GM_setValue('scrollAnimate', bool);
  3037. },
  3038. };
  3039.  
  3040.  
  3041. var uiTrans = {
  3042. "将小说网页文本转换为繁体。\n\n注意:内置的繁简转换表,只收录了简单的单字转换,启用本功能后,如有错误转换的情形,请利用脚本的自订字词取代规则来修正。\n例如:「千里之外」,会错误转换成「千里之外」,你可以加入规则「千里之外=千里之外」来自行修正。": "將小說網頁文字轉換為繁體。\n\n注意:內建的繁簡轉換表,只收錄了簡單的單字轉換,啟用本功能後,如有錯誤轉換的情形,請利用腳本的自訂字詞取代規則來修正。\n例如:「千里之外」,會錯誤轉換成「千裡之外」,你可以加入規則「千裡之外=千里之外」來自行修正。",
  3043. "图片章节用夜间模式没法看,这个选项在启动时会自动切换到缺省皮肤": "圖片章節無法以夜間模式觀看,這個選項在啟動時會自動切換到預設佈景",
  3044. "通过快捷键切换或在 Greasemonkey 用户脚本命令处打开设置窗口": "通過熱鍵切換或在 Greasemonkey 使用者腳本命令處開啟設定視窗",
  3045. "隐藏后通过快捷键或 Greasemonkey 用户脚本命令处调用": "隱藏後通過熱鍵或 Greasemonkey 使用者腳本命令處調用",
  3046. "一行一个,每行第一个 = 为分隔符\n需要刷新页面生效": "一行一條規則,每一行第一個 = 為分隔符\n(需重新載入頁面才能生效)",
  3047. "错误:没有找到下一页的内容,使用右键翻到下一页": "錯誤:沒有找到下一頁的內容,使用右鍵翻到下一頁",
  3048. "左键滚动,中键打开链接(无阅读模式)": "左鍵捲動畫面至該章節,中鍵開啟連結(無閱讀模式)",
  3049. "请输入切换左侧章节列表的快捷键:": "請輸入切換左側章節列表的熱鍵:",
  3050. "详见脚本代码的 Rule.specialSite": "詳見腳本代碼的 Rule.specialSite",
  3051. "booklink.me 点击的网站强制启用": "booklink.me 點擊的網站強制啟用",
  3052. "部分选项需要刷新页面才能生效": "部份選項需重新載入頁面才能生效",
  3053. "取消本次设定,所有选项还原": "取消本次設定,所有選項還原",
  3054. "不影响 booklink.me 的启用": "不影響 booklink.me 的啟用",
  3055. "请输入打开设置的快捷键:": "請輸入開啟設定視窗的熱鍵:",
  3056. "微软雅黑,宋体,黑体,楷体": "Microsoft YaHei,新細明體,PMingLiU,MingLiU,細明體,標楷體",
  3057. "夜间模式的图片章节检测": "夜間模式的圖片章節檢測",
  3058. "点击显示隐藏章节列表": "點此以顯示或隱藏章節列表",
  3059. "添加下一页到历史记录": "加入下一頁到歷史記錄",
  3060. "booklink 自动启用": "booklink 自動啟用",
  3061. "Enter 键打开目录": "Enter 鍵開啟目錄",
  3062. "隐藏左侧章节列表": "隱藏左側章節列表",
  3063. "小说阅读脚本设置":"小說閱讀腳本設定",
  3064. "已到达最后一页": "已到達最後一頁",
  3065. "正在载入下一页": "正在載入下一頁",
  3066. "通过快捷键切换": "通過熱鍵切換",
  3067. "隐藏底部导航栏": "隱藏底部導航列",
  3068. "隐藏左侧导航条": "隱藏左側章節列表彈出鈕",
  3069. "主页链接没有找到": "未找到主頁連結",
  3070. "自定义站点规则": "自訂網站規則",
  3071. "自定义替换规则": "自訂字詞取代規則",
  3072. "网页:转繁体": "網頁:轉繁體",
  3073. "双击暂停翻页": "雙擊暫停翻頁",
  3074. "隐藏设置按钮": "隱藏設定按鈕",
  3075. "强制手动启用": "強制手動啟用",
  3076. "调用阅读器": "調用閱讀器",
  3077. "自定义样式": "自訂樣式",
  3078. "界面语言": "介面語言",
  3079. "打开目录": "開啟本書目錄頁",
  3080. "自动翻页": "自動翻頁",
  3081. "缺省皮肤": "預設佈景",
  3082. "暗色皮肤": "暗色佈景",
  3083. "夜间模式": "夜間模式",
  3084. "夜间模式1": "夜間模式1",
  3085. "夜间模式2": "夜間模式2",
  3086. "橙色背景": "橙色背景",
  3087. "绿色背景": "綠色背景",
  3088. "绿色背景2": "綠色背景2",
  3089. "蓝色背景": "藍色背景",
  3090. "棕黄背景": "棕黃背景",
  3091. "经典皮肤": "經典背景",
  3092. "阅读模式": "閱讀模式",
  3093. "调试模式": "偵錯模式",
  3094. "反馈地址": "反饋與討論",
  3095. "安静模式": "安靜模式",
  3096. "√ 确认": "√ 確定",
  3097. "X 取消": "X 取消",
  3098. "上一页": "上一頁",
  3099. "下一页": "下一頁",
  3100. "状态": "狀態",
  3101. "已经": "已經",
  3102. "暂停": "暫停",
  3103. "启用": "啟用",
  3104. "退出": "離開",
  3105. "测试": "測試",
  3106. "距离": "距離",
  3107. "加载": "載入",
  3108. "字体": "字型",
  3109. "行高": "行距",
  3110. "行宽": "版面寬度",
  3111. "目录": "目錄"
  3112. };
  3113.  
  3114. if(!String.prototype.uiTrans){
  3115. Object.defineProperty(String.prototype, 'uiTrans', {
  3116. value: function(){
  3117. var _this = this.valueOf(), key, regexp;
  3118. if(Config.lang !== 'zh-TW') return _this;
  3119. if(uiTrans.hasOwnProperty(_this)) return uiTrans[_this];
  3120. for (key in uiTrans) {
  3121. regexp = new RegExp(key, 'g');
  3122. _this = _this.replace(regexp, uiTrans[key]);
  3123. }
  3124. return _this;
  3125. },
  3126. enumerable: false
  3127. });
  3128. }
  3129.  
  3130. //------------------- 辅助函数 ----------------------------------------
  3131.  
  3132. var nullFn = function() {};
  3133.  
  3134. // Check if is GM 2.x
  3135. if (typeof exportFunction == 'undefined') {
  3136. // For GM 1.x backward compatibility, should work.
  3137. var exportFunction = (function(foo, scope, defAs) {
  3138. scope[defAs.defineAs] = foo;
  3139. }).bind(unsafeWindow);
  3140. }
  3141.  
  3142. var C;
  3143. toggleConsole(Config.debug);
  3144.  
  3145. function toggleConsole(debug) {
  3146. if (debug) {
  3147. C = console;
  3148. } else {
  3149. C = {
  3150. log: nullFn,
  3151. debug: nullFn,
  3152. error: nullFn,
  3153. group: nullFn,
  3154. groupCollapsed: nullFn,
  3155. groupEnd: nullFn,
  3156. time: nullFn,
  3157. timeEnd: nullFn,
  3158. };
  3159. }
  3160. }
  3161.  
  3162. function L_getValue(key) { // 个别用户禁用本地存储会报错
  3163. try {
  3164. return localStorage.getItem(key);
  3165. } catch (e) {}
  3166. }
  3167.  
  3168. function L_setValue(key, value) {
  3169. try {
  3170. localStorage.setItem(key, value);
  3171. } catch (e) {}
  3172. }
  3173.  
  3174. function L_removeValue(key) {
  3175. try {
  3176. localStorage.removeItem(key);
  3177. } catch (e) {}
  3178. }
  3179.  
  3180.  
  3181. function parseHTML(str) {
  3182. var doc;
  3183. try {
  3184. // firefox and chrome 30+,Opera 12 会报错
  3185. doc = new DOMParser().parseFromString(str, "text/html");
  3186. } catch (ex) {}
  3187.  
  3188. if (!doc) {
  3189. doc = document.implementation.createHTMLDocument("");
  3190. doc.querySelector("html").innerHTML = str;
  3191. }
  3192. return doc;
  3193. }
  3194.  
  3195. function toRE(obj, flag) {
  3196. if (obj instanceof RegExp) {
  3197. return obj;
  3198. } else {
  3199. return new RegExp(obj, (flag || 'ig'));
  3200. }
  3201. }
  3202.  
  3203. function toReStr(str) { // 处理字符串,否则可能会无法用正则替换
  3204. return str.replace(/[()\[\]{}|+.,^$?\\*]/g, "\\$&");
  3205. }
  3206.  
  3207. function wildcardToRegExpStr(urlstr) {
  3208. if (urlstr.source) return urlstr.source;
  3209. var reg = urlstr.replace(/[()\[\]{}|+.,^$?\\]/g, "\\$&").replace(/\*+/g, function(str){
  3210. return str === "*" ? ".*" : "[^/]*";
  3211. });
  3212. return "^" + reg + "$";
  3213. }
  3214.  
  3215. function getUrlHost(url) {
  3216. var a = document.createElement('a');
  3217. a.href = url;
  3218. return a.host;
  3219. }
  3220.  
  3221. // 模板
  3222. $.nano = function(template, data) {
  3223. return template.replace(/\{([\w\.]*)\}/g, function(str, key) {
  3224. var keys = key.split("."),
  3225. v = data[keys.shift()];
  3226. try {
  3227. for (var i = 0, l = keys.length; i < l; i++) v = v[keys[i]];
  3228. } catch (e) {}
  3229. return (typeof v !== "undefined" && v !== null) ? v : "";
  3230. });
  3231. };
  3232.  
  3233. // jQuery text 完全匹配. e.g. a:econtains('最新章节')
  3234. $.expr[":"].econtains = function(obj, index, meta, stack) {
  3235. return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase();
  3236. };
  3237.  
  3238. /* jshint ignore: start */
  3239.  
  3240. function $x(aXPath, aContext) {
  3241. var nodes = [];
  3242. var doc = document;
  3243. aContext = aContext || doc;
  3244.  
  3245. try {
  3246. var results = doc.evaluate(aXPath, aContext, null,
  3247. XPathResult.ANY_TYPE, null);
  3248. var node;
  3249. while (node = results.iterateNext()) {
  3250. nodes.push(node);
  3251. }
  3252. } catch (ex) {}
  3253.  
  3254. return nodes;
  3255. }
  3256.  
  3257. Function.prototype.getMStr = function() { // 多行String
  3258. var lines = new String(this);
  3259. lines = lines.substring(lines.indexOf("/*") + 3, lines.lastIndexOf("*/"));
  3260. return lines;
  3261. };
  3262.  
  3263. if (typeof String.prototype.startsWith != 'function') {
  3264. String.prototype.startsWith = function(str) {
  3265. return this.slice(0, str.length) == str;
  3266. };
  3267. }
  3268.  
  3269. if (typeof String.prototype.endsWith != 'function') {
  3270. String.prototype.endsWith = function(str) {
  3271. return this.slice(-str.length) == str;
  3272. };
  3273. }
  3274.  
  3275. if (!String.prototype.includes) {
  3276. String.prototype.includes = function(search, start) {
  3277. 'use strict';
  3278. if (typeof start !== 'number') {
  3279. start = 0;
  3280. }
  3281. if (start + search.length > this.length) {
  3282. return false;
  3283. } else {
  3284. return this.indexOf(search, start) !== -1;
  3285. }
  3286. };
  3287. }
  3288.  
  3289.  
  3290. function saveAs(data, filename) {
  3291. if(!filename) filename = 'console.json'
  3292.  
  3293. if (typeof data == 'object') {
  3294. data = JSON.stringify(data, undefined, 4);
  3295. }
  3296.  
  3297. var blob = new Blob([data], { type: 'application/octet-stream' });
  3298. var url = window.URL.createObjectURL(blob);
  3299. var saveas = document.createElement('a');
  3300. saveas.href = url;
  3301. saveas.style.display = 'none';
  3302. document.body.appendChild(saveas);
  3303. saveas.download = filename;
  3304. saveas.click();
  3305. setTimeout(function() {
  3306. saveas.parentNode.removeChild(saveas);
  3307. }, 1000)
  3308. document.addEventListener('unload', function() {
  3309. window.URL.revokeObjectURL(url);
  3310. });
  3311. }
  3312.  
  3313. /*
  3314. * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
  3315. */
  3316. jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;return 0==b?c:1==(b/=e)?c+d:(g||(g=.3*e),h<Math.abs(d)?(h=d,f=g/4):f=g/(2*Math.PI)*Math.asin(d/h),-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c)},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;return 0==b?c:1==(b/=e)?c+d:(g||(g=.3*e),h<Math.abs(d)?(h=d,f=g/4):f=g/(2*Math.PI)*Math.asin(d/h),h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c)},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;return 0==b?c:2==(b/=e/2)?c+d:(g||(g=e*.3*1.5),h<Math.abs(d)?(h=d,f=g/4):f=g/(2*Math.PI)*Math.asin(d/h),1>b?-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:.5*h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+d+c)},easeInBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return e/2>b?.5*jQuery.easing.easeInBounce(a,2*b,0,d,e)+c:.5*jQuery.easing.easeOutBounce(a,2*b-e,0,d,e)+.5*d+c}});
  3317.  
  3318. /* jshint ignore: end */
  3319.  
  3320.  
  3321. var UI = {
  3322. tpl_footer_nav: '\
  3323. <div class="chapter-footer-nav">\
  3324. <a class="prev-page" href="{prevUrl}">上一页</a> | \
  3325. <a class="index-page" href="{indexUrl}" title="Enter 键打开目录">目录</a> | \
  3326. <a class="next-page" style="color:{theEndColor}" href="{nextUrl}">下一页</a>\
  3327. </div>\
  3328. '.uiTrans(),
  3329. skins: {},
  3330.  
  3331. init: function(){
  3332. $('<link rel="stylesheet" class="noRemove">')
  3333. .attr('src', Res.CSS_FONT_AWESOME)
  3334. .appendTo('head');
  3335.  
  3336. UI.refreshMainStyle();
  3337.  
  3338. UI.refreshSkinStyle(Config.skin_name, true);
  3339.  
  3340. UI.refreshExtraStyle(Config.extra_css);
  3341.  
  3342. UI.fixMobile();
  3343.  
  3344. // 初始变量
  3345. UI.$menu = $('#menu');
  3346. UI.$menuBar = $('#menu-bar');
  3347. UI.$content = $('#mynovelreader-content');
  3348. UI.$preferencesBtn = $('#preferencesBtn');
  3349.  
  3350. // 初始化是否隐藏
  3351. if(Config.hide_footer_nav){
  3352. UI.hideFooterNavStyle(true);
  3353. }
  3354.  
  3355. // UI.toggleQuietMode(); // 初始化安静模式
  3356. UI.hideMenuList(Config.menu_list_hiddden); // 初始化章节列表是否隐藏
  3357. UI.hidePreferencesButton(Config.hide_preferences_button); // 初始化设置按钮是否隐藏
  3358. },
  3359. refreshMainStyle: function(){
  3360. var mainCss = Res.CSS_MAIN
  3361. .replace("{font_family}", Config.font_family)
  3362. .replace("{font_size}", UI.calcContentFontSize(Config.font_size))
  3363. .replace("{title_font_size}", UI.calcTitleFontSize(Config.font_size))
  3364. .replace("{content_width}", Config.content_width)
  3365. .replace("{text_line_height}", Config.text_line_height)
  3366. .replace("{menu-bar-hidden}", Config.menu_bar_hidden ? "display:none;" : "");
  3367.  
  3368. if(UI.$mainStyle){
  3369. UI.$mainStyle.text(mainCss);
  3370. return;
  3371. }
  3372.  
  3373. UI.$mainStyle = $('<style id="main">')
  3374. .text(mainCss)
  3375. .appendTo('head');
  3376. },
  3377. hideFooterNavStyle: function(hidden){
  3378. var navStyle = $("#footer_nav_css");
  3379. if(hidden) {
  3380. if(navStyle.length === 0) {
  3381. $('<style>')
  3382. .attr("id", "footer_nav_css")
  3383. .text(".chapter-footer-nav { display: none; }")
  3384. .appendTo('head');
  3385. }
  3386. } else {
  3387. navStyle.remove();
  3388. }
  3389. },
  3390. hideMenuList: function(hidden){
  3391. if(typeof(hidden) === "undefined"){
  3392. hidden = !UI.menu_list_hiddden;
  3393. }
  3394.  
  3395. if(hidden){
  3396. UI.$menu.addClass('hidden');
  3397. UI.$content.css("margin-left", "");
  3398. }else{
  3399. UI.$menu.removeClass('hidden');
  3400. UI.$content.css("margin-left", "320px");
  3401. }
  3402. UI.menu_list_hiddden = hidden;
  3403. },
  3404. hidePreferencesButton: function(hidden) {
  3405. hidden = _.isUndefined(hidden) ? Config.hide_preferences_button : hidden;
  3406.  
  3407. UI.$preferencesBtn.toggle(!hidden);
  3408. },
  3409. hideMenuBar: function(hidden) {
  3410. hidden = _.isUndefined(hidden) ? Config.menu_bar_hidden : hidden;
  3411.  
  3412. UI.$menuBar.toggle(!hidden);
  3413. },
  3414. refreshSkinStyle: function(skin_name, isFirst){
  3415. var $style = $("#skin_style");
  3416. if($style.length === 0){
  3417. $style = $('<style id="skin_style">').appendTo('head');
  3418. }
  3419.  
  3420. // 图片章节夜间模式会变的无法看
  3421. if (isFirst && skin_name.indexOf('夜间'.uiTrans()) != -1 && Config.picNightModeCheck) {
  3422. setTimeout(function(){
  3423. var img = $('#mynovelreader-content img')[0];
  3424. // console.log(img.width, img.height)
  3425. if (img && img.width > 500 && img.height > 1000) {
  3426. $style.text(UI.skins['缺省皮肤'.uiTrans()]);
  3427. return;
  3428. }
  3429. }, 200);
  3430. }
  3431.  
  3432. $style.text(UI.skins[skin_name]);
  3433. },
  3434. refreshExtraStyle: function(css){
  3435. var style = $("#extra_style");
  3436. if(style.length === 0){
  3437. style = $('<style id="extra_style">').appendTo('head');
  3438. }
  3439.  
  3440. style.text(css);
  3441. },
  3442. toggleQuietMode: function() {
  3443. this._isQuietMode = !this._isQuietMode;
  3444. var selector = '#menu-bar, #menu, #preferencesBtn, .readerbtn';
  3445.  
  3446. if (this.$_quietStyle) {
  3447. this.$_quietStyle.remove();
  3448. this.$_quietStyle = null;
  3449. }
  3450.  
  3451. if (this._isQuietMode) {
  3452. $(selector).addClass("quiet-mode");
  3453.  
  3454. if (!isChrome) { // firefox 下隐藏滚动条
  3455. this.$_quietStyle = $('<style>')
  3456. .text('scrollbar {visibility:collapse !important; } body {overflow: hidden !important; overflow-x: hidden !important;}')
  3457. .appendTo('head');
  3458. }
  3459. } else {
  3460. $(selector).removeClass("quiet-mode");
  3461. }
  3462. },
  3463. addButton: function(){
  3464. GM_addStyle('\
  3465. .readerbtn {\
  3466. position: fixed;\
  3467. right: 10px;\
  3468. bottom: 10px;\
  3469. z-index: 2247483648;\
  3470. padding: 20px 5px;\
  3471. width: 50px;\
  3472. height: 20px;\
  3473. line-height: 20px;\
  3474. text-align: center;\
  3475. border: 1px solid;\
  3476. border-color: #888;\
  3477. border-radius: 50%;\
  3478. background: rgba(0,0,0,.5);\
  3479. color: #FFF;\
  3480. font: 12px/1.5 "微软雅黑","宋体",Arial;\
  3481. cursor: pointer;\
  3482. }\
  3483. ');
  3484.  
  3485. $("<div>")
  3486. .addClass("readerbtn")
  3487. .html(App.isEnabled ? "退出".uiTrans() : "阅读模式".uiTrans())
  3488. .mousedown(function(event){
  3489. if(event.which == 1){
  3490. App.toggle();
  3491. }else if(event.which == 2){
  3492. event.preventDefault();
  3493. L_setValue("mynoverlreader_disable_once", true);
  3494.  
  3495. var url = App.activeUrl || App.curPageUrl;
  3496. App.openUrl(url);
  3497. }
  3498. })
  3499. .appendTo('body');
  3500. },
  3501. calcContentFontSize: function(fontSizeStr) {
  3502. var m = fontSizeStr.match(/([\d\.]+)(px|r?em|pt)/);
  3503. if(m) {
  3504. var size = m[1],
  3505. type = m[2];
  3506. return parseFloat(size, 10) + type;
  3507. }
  3508.  
  3509. m = fontSizeStr.match(/([\d\.]+)/);
  3510. if (m) {
  3511. return parseFloat(m[1], 10) + 'px';
  3512. }
  3513.  
  3514. return "";
  3515. },
  3516. calcTitleFontSize: function(fontSizeStr){
  3517. var m = fontSizeStr.match(/([\d\.]+)(px|r?em|pt)/);
  3518. if(m) {
  3519. var size = m[1],
  3520. type = m[2];
  3521. return parseFloat(size, 10) * 1.8 + type;
  3522. }
  3523.  
  3524. m = fontSizeStr.match(/([\d\.]+)/);
  3525. if (m) {
  3526. return parseFloat(m[1], 10) * 1.8 + 'px';
  3527. }
  3528.  
  3529. return "";
  3530. },
  3531. fixMobile: function(){ // 自适应网页设计
  3532. var meta = document.createElement("meta");
  3533. meta.setAttribute("name", "viewport");
  3534. meta.setAttribute("content", "width=device-width, initial-scale=1");
  3535. document.head.appendChild(meta);
  3536. },
  3537. preferencesShow: function(event){
  3538. if($("#reader_preferences").length){
  3539. return;
  3540. }
  3541.  
  3542. UI._loadBlocker();
  3543.  
  3544. UI.$prefs = $('<div id="reader_preferences">')
  3545. .css('cssText', 'position:fixed; top:12%; left:30%; width:500px; z-index:300000;')
  3546. .append(
  3547. $('<style>').text(Res.preferencesCSS))
  3548. .append(
  3549. $('<div class="body">').html(Res.preferencesHTML))
  3550. .appendTo('body');
  3551.  
  3552. UI.preferencesLoadHandler();
  3553. },
  3554. _loadBlocker: function() {
  3555. UI.$blocker = $('<div>').attr({
  3556. id: 'uil_blocker',
  3557. style: 'position:fixed;top:0px;left:0px;right:0px;bottom:0px;background-color:#000;opacity:0.5;z-index:100000;'
  3558. }).appendTo('body');
  3559. },
  3560. hide: function(){
  3561. if(UI.$prefs) UI.$prefs.remove();
  3562. if(UI.$blocker) UI.$blocker.remove();
  3563. UI.$prefs = null;
  3564. UI.$blocker = null;
  3565. },
  3566. preferencesLoadHandler: function(){
  3567. var $form = $("#preferences");
  3568.  
  3569. // checkbox
  3570. $form.find("#enable-cn2tw").get(0).checked = Config.cn2tw;
  3571. $form.find("#disable-auto-launch").get(0).checked = Config.getDisableAutoLaunch();
  3572. $form.find("#booklink-enable").get(0).checked = Config.booklink_enable;
  3573. $form.find("#debug").get(0).checked = Config.debug;
  3574. $form.find("#quietMode").get(0).checked = Config.isQuietMode;
  3575. $form.find("#pic-nightmode-check").get(0).checked = Config.picNightModeCheck;
  3576. $form.find("#copyCurTitle").get(0).checked = Config.copyCurTitle;
  3577.  
  3578. $form.find("#hide-menu-list").get(0).checked = Config.menu_list_hiddden;
  3579. $form.find("#hide-footer-nav").get(0).checked = Config.hide_footer_nav;
  3580. $form.find("#hide-preferences-button").get(0).checked = Config.hide_preferences_button;
  3581. $form.find("#add-nextpage-to-history").get(0).checked = Config.addToHistory;
  3582. $form.find("#enable-dblclick-pause").get(0).checked = Config.dblclickPause;
  3583.  
  3584. $form.find("#font-family").get(0).value = Config.font_family;
  3585. $form.find("#font-size").get(0).value = Config.font_size;
  3586. $form.find("#content_width").get(0).value = Config.content_width;
  3587. $form.find("#text_line_height").get(0).value = Config.text_line_height;
  3588. $form.find("#split_content").get(0).checked = Config.split_content;
  3589. $form.find("#scroll_animate").get(0).checked = Config.scrollAnimate;
  3590.  
  3591. $form.find("#remain-height").get(0).value = Config.remain_height;
  3592. $form.find("#extra_css").get(0).value = Config.extra_css;
  3593. $form.find("#custom_siteinfo").get(0).value = Config.customSiteinfo;
  3594. UI._rules = $form.find("#custom_replace_rules").get(0).value = Config.customReplaceRules;
  3595.  
  3596. // 界面语言
  3597. var $lang = $form.find("#lang");
  3598. $("<option>").text("zh-CN").appendTo($lang);
  3599. $("<option>").text("zh-TW").appendTo($lang);
  3600. $lang.val(Config.lang).change(function(){
  3601. var key = $(this).find("option:selected").text();
  3602. Config.lang = key;
  3603. });
  3604.  
  3605. // 皮肤
  3606. var $skin = $form.find("#skin");
  3607. for(var key in UI.skins){
  3608. $("<option>").text(key).appendTo($skin);
  3609. }
  3610. $skin.val(Config.skin_name).change(function(){
  3611. var key = $(this).find("option:selected").text();
  3612. UI.refreshSkinStyle(key);
  3613. Config.skin_name = key;
  3614. });
  3615.  
  3616. // 字体大小等预览
  3617. var preview = _.debounce(function(){
  3618. switch(this.id){
  3619. case "font-size":
  3620. var contentFontSize = UI.calcContentFontSize(this.value);
  3621. var titleFontSize = UI.calcTitleFontSize(this.value);
  3622. if(titleFontSize) {
  3623. UI.$content.css("font-size", contentFontSize);
  3624. UI.$content.find("h1").css("font-size", titleFontSize);
  3625. }
  3626. break;
  3627. case "font-family":
  3628. UI.$content.css("font-family", this.value);
  3629. break;
  3630. case "content_width":
  3631. UI.$content.css("width", this.value);
  3632. break;
  3633. case "text_line_height":
  3634. UI.$content.css("line-height", this.value);
  3635. break;
  3636. default:
  3637. break;
  3638. }
  3639. }, 300);
  3640. $form.on("input", "input", preview);
  3641.  
  3642. // 初始化设置按键
  3643. $form.find("#quietModeKey").get(0).value = Config.quietModeKey;
  3644. $form.find("#openPreferencesKey").get(0).value = Config.openPreferencesKey;
  3645. $form.find("#setHideMenuListKey").get(0).value = Config.hideMenuListKey;
  3646.  
  3647. // 点击事件
  3648. $form.on('click', 'input:checkbox, input:button', function(event){
  3649. UI.preferencesClickHandler(event.target);
  3650. });
  3651. },
  3652. cleanPreview: function() {
  3653. UI.$content.find("h1").css("font-size", "");
  3654.  
  3655. // 恢复初始设置(有误操作)
  3656. // UI.$content.removeAttr('style');
  3657. },
  3658. preferencesClickHandler: function(target){
  3659. var key;
  3660. switch (target.id) {
  3661. case 'close_button':
  3662. UI.preferencesCloseHandler();
  3663. break;
  3664. case 'save_button':
  3665. UI.preferencesSaveHandler();
  3666. break;
  3667. case 'debug':
  3668. Config.debug = !Config.debug;
  3669. toggleConsole(Config.debug);
  3670. break;
  3671. case 'quietMode':
  3672. UI.toggleQuietMode(target.checked);
  3673. break;
  3674. case 'hide-menu-list':
  3675. UI.hideMenuList(target.checked);
  3676. break;
  3677. case 'hide-preferences-button':
  3678. UI.hidePreferencesButton(target.checked);
  3679. if (target.checked) {
  3680. alert('隐藏后通过快捷键或 Greasemonkey 用户脚本命令处调用'.uiTrans());
  3681. }
  3682. break;
  3683. case 'hide-footer-nav':
  3684. break;
  3685. case 'quietModeKey':
  3686. key = prompt('请输入打开设置的快捷键:'.uiTrans(), Config.quietModeKey);
  3687. if (key) {
  3688. Config.quietModeKey = key;
  3689. $(target).val(key);
  3690. }
  3691. break;
  3692. case 'openPreferencesKey':
  3693. key = prompt('请输入打开设置的快捷键:'.uiTrans(), Config.openPreferencesKey);
  3694. if (key) {
  3695. Config.openPreferencesKey = key;
  3696. $(target).val(key);
  3697. }
  3698. break;
  3699. case 'setHideMenuListKey':
  3700. key = prompt('请输入切换左侧章节列表的快捷键:'.uiTrans(), Config.hideMenuListKey);
  3701. if (key) {
  3702. Config.hideMenuListKey = key;
  3703. $(target).val(key);
  3704. }
  3705. break;
  3706. case 'saveAsTxt':
  3707. UI.preferencesCloseHandler();
  3708. App.saveAsTxt();
  3709. break;
  3710. default:
  3711. break;
  3712. }
  3713. },
  3714. preferencesCloseHandler: function(){
  3715. UI.cleanPreview();
  3716.  
  3717. UI.hide();
  3718. },
  3719. preferencesSaveHandler: function(){
  3720. var $form = $("#preferences");
  3721.  
  3722. Config.setDisableAutoLaunch($form.find("#disable-auto-launch").get(0).checked);
  3723.  
  3724. Config.cn2tw = $form.find("#enable-cn2tw").get(0).checked;
  3725. Config.booklink_enable = $form.find("#booklink-enable").get(0).checked;
  3726. Config.isQuietMode = $form.find("#quietMode").get(0).checked;
  3727. Config.debug = $form.find("#debug").get(0).checked;
  3728. Config.picNightModeCheck = $form.find("#pic-nightmode-check").get(0).checked;
  3729. Config.setCopyCurTitle($form.find("#copyCurTitle").get(0).checked);
  3730.  
  3731. Config.addToHistory = $form.find("#add-nextpage-to-history").get(0).checked;
  3732. Config.dblclickPause = $form.find("#enable-dblclick-pause").get(0).checked;
  3733.  
  3734. var skinName = $form.find("#skin").find("option:selected").text();
  3735. Config.skin_name = skinName;
  3736. UI.refreshSkinStyle(skinName);
  3737.  
  3738. Config.font_family = $form.find("#font-family").get(0).value;
  3739. UI.$content.css("font-family", Config.font_family);
  3740.  
  3741. Config.font_size = $form.find("#font-size").get(0).value;
  3742. Config.text_line_height = $form.find("#text_line_height").get(0).value;
  3743. Config.content_width = $form.find("#content_width").get(0).value;
  3744. Config.remain_height = $form.find("#remain-height").get(0).value;
  3745. Config.split_content = $form.find("#split_content").get(0).checked;
  3746. Config.scrollAnimate = $form.find("#scroll_animate").get(0).checked;
  3747.  
  3748. Config.menu_list_hiddden = $form.find("#hide-menu-list").get(0).checked;
  3749. UI.hideMenuList(Config.menu_list_hiddden);
  3750.  
  3751. Config.hide_footer_nav = $form.find("#hide-footer-nav").get(0).checked;
  3752. Config.hide_preferences_button = $form.find("#hide-preferences-button").get(0).checked;
  3753.  
  3754. var css = $form.find("#extra_css").get(0).value;
  3755. UI.refreshExtraStyle(css);
  3756. Config.extra_css = css;
  3757.  
  3758. Config.customSiteinfo = $form.find("#custom_siteinfo").get(0).value;
  3759.  
  3760. // 自定义替换规则直接生效
  3761. var rules = $form.find("#custom_replace_rules").get(0).value;
  3762. Config.customReplaceRules = rules;
  3763. if (rules != UI._rules) {
  3764. var contentHtml = App.oArticles.join('\n');
  3765. if (rules) {
  3766. // 转换规则
  3767. rules = Rule.parseCustomReplaceRules(rules);
  3768. // 替换
  3769. contentHtml = Parser.prototype.replaceHtml(contentHtml, rules);
  3770. }
  3771.  
  3772. UI.$content.html(contentHtml);
  3773.  
  3774. App.resetCache();
  3775.  
  3776. UI._rules = rules;
  3777. }
  3778.  
  3779. // 重新载入样式
  3780. UI.cleanPreview();
  3781. UI.refreshMainStyle();
  3782.  
  3783. UI.hide();
  3784. },
  3785. openHelp: function() {
  3786.  
  3787. },
  3788. notice: function (htmlText, ms){
  3789. var $noticeDiv = $("#alert");
  3790. if (!ms) {
  3791. ms = 1666;
  3792. }
  3793.  
  3794. clearTimeout(UI.noticeDivto);
  3795. $noticeDiv.find("p").html(htmlText);
  3796. $noticeDiv.fadeIn("fast");
  3797.  
  3798. UI.noticeDivto = setTimeout(function(){
  3799. $noticeDiv.fadeOut(500);
  3800. }, ms);
  3801.  
  3802. return $noticeDiv;
  3803. }
  3804. };
  3805.  
  3806. UI.message = (function() {
  3807.  
  3808. function notice(html, duration, noticeType, onClose) {
  3809. if (typeof duration === 'undefined')
  3810. duration = 2000;
  3811.  
  3812. var closeMessage = function() {
  3813. UI.$messageDiv.remove();
  3814. UI.$messageDiv = null;
  3815.  
  3816. if (typeof onClose === 'function') {
  3817. onClose();
  3818. }
  3819. };
  3820.  
  3821. if (!UI.$messageDiv) {
  3822. var iconHtml = ''
  3823. if (noticeType === 'loading') {
  3824. iconHtml = '<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>'
  3825. }
  3826.  
  3827. UI.$messageDiv = $('<div id="message" class="noRemove">' + iconHtml + '<span id="content"></span></div>')
  3828. .appendTo('body');
  3829. UI.$messageDivContent = UI.$messageDiv.find('#content');
  3830.  
  3831. if (duration == 0) {
  3832. UI.$messageDiv.on('click', closeMessage);
  3833. }
  3834. }
  3835.  
  3836. UI.$messageDivContent.html(html)
  3837.  
  3838. if (duration > 0) {
  3839. clearTimeout(UI._messageTimeId);
  3840. UI._messageTimeId = setTimeout(closeMessage, duration)
  3841. }
  3842. }
  3843.  
  3844. return {
  3845. loading: function(html, duration, onClose) {
  3846. notice(html, duration, 'loading', onClose)
  3847. }
  3848. }
  3849. })()
  3850.  
  3851. UI.skins["缺省皮肤".uiTrans()] = "";
  3852. UI.skins["暗色皮肤".uiTrans()] = "body { color: #666; background-color: rgba(0;0;0;.1); }\
  3853. .title { color: #222; }";
  3854. UI.skins["白底黑字".uiTrans()] = "body { color: black; background-color: white;}\
  3855. .title { font-weight: bold; border-bottom: 0.1em solid; margin-bottom: 1.857em; padding-bottom: 0.857em;}";
  3856. UI.skins["夜间模式".uiTrans()] = "body { color: #939392; background: #2d2d2d; } #preferencesBtn { background: white; } #mynovelreader-content img { background-color: #c0c0c0; } .chapter.active div{color: #939392;}";
  3857. UI.skins["夜间模式1".uiTrans()] = "body { color: #679; background-color: black; } #preferencesBtn img { background-color: white !important; } .title { color: #3399FF; background-color: #121212; }";
  3858. UI.skins["夜间模式2".uiTrans()] = "body { color: #AAAAAA; background-color: #121212; } #preferencesBtn img { background-color: white; } #mynovelreader-content img { background-color: #c0c0c0; } .title { color: #3399FF; background-color: #121212; } body a { color: #E0BC2D; } body a:link { color: #E0BC2D; } body a:visited { color:#AAAAAA; } body a:hover { color: #3399FF; } body a:active { color: #423F3F; }";
  3859. UI.skins["夜间模式(多看)".uiTrans()] = "body { color: #4A4A4A; background: #101819; } #preferencesBtn { background: white; } #mynovelreader-content img { background-color: #c0c0c0; }";
  3860.  
  3861. UI.skins["橙色背景".uiTrans()] = "body { color: #24272c; background-color: #FEF0E1; }";
  3862. UI.skins["绿色背景".uiTrans()] = "body { color: black; background-color: #d8e2c8; }";
  3863. UI.skins["绿色背景2".uiTrans()] = "body { color: black; background-color: #CCE8CF; }";
  3864. UI.skins["蓝色背景".uiTrans()] = "body { color: black; background-color: #E7F4FE; }";
  3865. UI.skins["棕黄背景".uiTrans()] = "body { color: black; background-color: #C2A886; }";
  3866. UI.skins["经典皮肤".uiTrans()] = "body { color: black; background-color: #EAEAEE; } .title { background-color: #f0f0f0; }";
  3867.  
  3868.  
  3869. var fontawesomeWoff = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff";
  3870.  
  3871. var Res = {
  3872. CSS_MAIN: '@font-face {\n font-family: "FontAwesome";\n src: url({fontawesomeWoff});\n font-weight: normal;\n font-style: normal;\n}\nbody > a { display:none !important; }\n.hidden {\n display: none;\n}\n.quiet-mode {\n display: none;\n}\nbody {\n background: #F3F2EE;\n color: #1F0909;\n padding: 0px;\n margin: 0px;\n font-family: "Microsoft YaHei UI", 微软雅黑, 新宋体, 宋体, arial;\n}\na { color: #065488; }\na:link { text-decoration: none; }\n#mynovelreader-content {\n width: {content_width};\n font-size: {font_size};\n font-family: {font_family};\n line-height: {text_line_height};\n margin-left:auto;\n margin-right:auto;\n padding-bottom: 15px;\n}\n#mynovelreader-content img{\n max-width: 100%;\n}\narticle {\n margin-top: 55px;\n word-wrap: break-word;\n}\narticle h1 {\n clear: both;\n line-height: 50px;\n font-size: {title_font_size};\n font-weight: normal;\n margin: 25px -20px;\n padding: 0 20px 10px;\n border-bottom: 1px solid rgba(0,0,0,.25);\n font-weight: normal;\n text-transform: none;\n}\narticle li {\n list-style: none;\n}\n.chapter-footer-nav {\n text-align:center;\n font-size:0.9em;\n margin:-10px 0px 30px 0px;\n}\n#loading {\n color: white;\n text-align: center;\n font: 12px "微软雅黑", "宋体", "Times New Roman", "Verdana";\n margin-top: 20px;\n margin-left: auto;\n margin-right: auto;\n width: 376px;\n height: 32px;\n line-height: 32px;\n border-radius: 20px;\n border: 1px solid #666;\n background-color: #333;\n}\n#loading img {\n vertical-align: middle;\n}\n#loading a {\n color: white;\n}\n#preferencesBtn{\n position: fixed;\n top: 10px;\n right: 10px;\n z-index: 1597;\n}\n#alert {\n position: fixed;\n z-index: 100;\n float: auto;\n width: auto;\n height: auto;\n top: 10px;\n left: 500px;\n background: rgba(215, 240, 253, 0.65);\n color: #2d7091;\n border: 1px solid rgba(45,112,145,0.3);\n border-radius: 4px;\n}\n#alert p {\n font-size: 15px;\n margin: 6px;\n}\n#message {\n position: fixed;\n z-index: 1010;\n width: auto;\n height: auto;\n top: 10px;\n left: 500px;\n padding: 8px 16px;\n border-radius: 4px;\n box-shadow: 0 2px 8px rgba(0,0,0,.2);\n background: #fff;\n display: inline-block;\n pointer-events: all;\n font-size: 12px;\n}\n#message .fa-spinner {\n font-size: 13px;\n margin-right: 4px;\n}\n#message p {\n margin: 0;\n}\nimg.blockImage {clear: both;float: none;display: block;margin-left: auto;margin-right: auto;}\n#menu-bar {\n border: solid rgba(0, 100, 255, .9);\n border-width: 3px 2px 3px 0px;\n position: fixed;\n left: 0px;\n top: 40%;\n height: 100px;\n width: 2px;\n z-index: 199;\n {menu-bar-hidden}\n}\n#menu-bar {\n top: 0px;\n height: 100%;\n width: 1px;\n background: transparent;\n border: none;\n}\n#menu {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 100;\n width: 270px;\n max-width: 100%;\n background: #333;\n overflow-y: auto;\n}\n#menu:after {\n content: "";\n display: block;\n position: absolute;\n top: 46px;\n bottom: 0;\n right: 0;\n width: 1px;\n background: rgba(0,0,0,0.6);\n box-shadow: 0 0 5px 2px rgba(0,0,0,0.6);\n}\n#header{\n color: #777;\n margin-top: 0;\n border-top: 1px solid rgba(0,0,0,0.3);\n background: #404040;\n box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);\n text-shadow: 0 1px 0 rgba(0,0,0,0.5);\n padding: 10px 12px;\n text-transform: uppercase;\n font-weight: bold;\n font-size: 20px;\n}\n#header a {\n color: #777777;\n}\n#divider {\n position: relative;\n z-index: 300;\n border-top: 1px solid rgba(255,255,255,0.01);\n border-bottom: 1px solid rgba(0,0,0,0.3);\n margin: 0;\n height: 4px;\n background: rgba(0,0,0,0.2);\n box-shadow: 0 1px 0 rgba(255,255,255,0.05), inset 0 1px 3px rgba(0,0,0,0.3);\n}\n#chapter-list {\n position: relative;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 200;\n margin: 0;\n padding: 0;\n cursor: pointer;\n list-style: none;\n overflow-y: auto;\n}\n.chapter {\n list-style: none;\n}\n.chapter:last-child {\n border-bottom: 1px solid rgba(0,0,0,0.3);\n box-shadow: 0 1px 0 rgba(255,255,255,0.05);\n}\n.chapter div {\n color: #ccc;\n font-size: 15px;\n padding: 8px 20px;\n border-top: 1px solid rgba(0,0,0,0.3);\n box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);\n text-shadow: 0 1px 0 rgba(0,0,0,0.5);\n display: block;\n text-decoration: none;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n cursor: pointer;\n}\n.chapter div:before {\n content: "\\f105";\n width: 20px;\n margin-left: -10px;\n float: left;\n font-family: "FontAwesome" !important;\n text-align: center;\n}\n.chapter div:hover {\n background: #404040;\n color: #fff;\n outline: 0;\n}\n.chapter.active div {\n background: #1a1a1a;\n color: #fff;\n font-size: 16px;\n box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);\n}\n::-webkit-scrollbar {\n height: 9px !important;\n width: 9px !important;\n}\n::-webkit-scrollbar-thumb {\n background-color: #7D7D7D !important;\n border-radius: 3px !important;\n}\n::-webkit-scrollbar-track-piece {\n background-color: rgba(0,0,0,.25) !important;\n}\n'
  3873. .replace('{fontawesomeWoff}', fontawesomeWoff),
  3874. CSS_FONT_AWESOME: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',
  3875.  
  3876. preferencesHTML: '<form id="preferences" name="preferences">\n <div id="setting_table1">\n <span id="top-buttons">\n <input title="部分选项需要刷新页面才能生效" id="save_button" value="√ 确认" type="button">\n <input title="取消本次设定,所有选项还原" id="close_button" value="X 取消" type="button">\n </span>\n <div class="form-row">\n <label>\n 界面语言<select id="lang">\n </select>\n </label>\n <label title="将小说网页文本转换为繁体。\\n\\n注意:内置的繁简转换表,只收录了简单的单字转换,启用本功能后,如有错误转换的情形,请利用脚本的自订字词取代规则来修正。\\n例如:「千里之外」,会错误转换成「千里之外」,你可以加入规则「千里之外=千里之外」来自行修正。">\n <input type="checkbox" id="enable-cn2tw" name="enable-cn2tw"/>网页:转繁体\n </label>\n <label id="quietMode" class="right" title="隐藏其他,只保留正文,适用于全屏状态下">\n <input class="key" type="button" id="quietModeKey"/>安静模式\n </label>\n </div>\n <div class="form-row">\n <label title="不影响 booklink.me 的启用">\n <input type="checkbox" id="disable-auto-launch" name="disable-auto-launch"/>强制手动启用\n </label>\n <label title="booklink.me 点击的网站强制启用">\n <input type="checkbox" id="booklink-enable" name="booklink-enable"/>booklink 自动启用\n </label>\n <label>\n <input type="checkbox" id="debug" name="debug"/>调试模式\n </label>\n <a href="https://gf.qytechs.cn/scripts/292-my-novel-reader/feedback" target="_blank">反馈地址</a>\n </div>\n <div class="form-row">\n <label title="图片章节用夜间模式没法看,这个选项在启动时会自动切换到缺省皮肤">\n <input type="checkbox" id="pic-nightmode-check" name="pic-nightmode-check"/>\n 夜间模式的图片章节检测\n </label>\n <label>\n <input type="checkbox" id="copyCurTitle"/>\n 打开目录复制当前标题\n </label>\n </div>\n <div class="form-row">\n <label title="通过快捷键切换">\n <input type="checkbox" id="hide-menu-list"/>隐藏左侧章节列表\n </label>\n <label>\n <input type="checkbox" id="hide-footer-nav"/>隐藏底部导航栏\n </label>\n <label class="right" title="导出之后的所有章节">\n <input type="button" id="saveAsTxt" value="存为 txt(测试)" />\n </label>\n </div>\n <div class="form-row">\n <label>\n 左侧导航栏切换快捷键:\n </label>\n <input class="key" type="button" id="setHideMenuListKey" />\n <label title="通过快捷键切换或在 Greasemonkey 用户脚本命令处打开设置窗口">\n <input type="checkbox" id="hide-preferences-button"/>隐藏设置按钮\n </label>\n <input class="key" type="button" id="openPreferencesKey"/>\n </div>\n <div class="form-row">\n <label>\n 距离底部\n <input type="textbox" id="remain-height" name="remain-height" size="5"/>\n px 加载下一页\n </label>\n <label>\n <input type="checkbox" id="add-nextpage-to-history"/>添加下一页到历史记录\n </label>\n <label>\n <input type="checkbox" id="enable-dblclick-pause"/>双击暂停翻页\n </label>\n </div>\n <div class="form-row">\n <label>\n <select id="skin">\n </select>\n </label>\n <label>\n 字体\n <input type="textbox" id="font-family" style="min-width:200px;"/>\n </label>\n <br/><br/>\n <label>\n 字体大小\n <input type="textbox" id="font-size" name="font-size" size="6"/>\n </label>\n <label>\n 行高\n <input type="textbox" id="text_line_height" size="6"/>\n </label>\n <label>\n 行宽\n <input type="textbox" id="content_width" size="6"/>\n </label>\n </div>\n <div class="form-row">\n <label title="把一大块未分段的内容文本按照句号分段">\n <input type="checkbox" id="split_content"/>对一坨内容进行强制分段\n </label>\n <label>\n <input type="checkbox" id="scroll_animate"/>章节滚动效果\n </label>\n </div>\n <div class="form-row">\n <div class="prefs_title">自定义样式</div>\n <textarea id="extra_css" class="prefs_textarea" placeholder="自定义样式"></textarea>\n </div>\n </div>\n <div id="setting_table2">\n <div class="form-row" title="详见脚本代码的 Rule.specialSite">\n <div class="prefs_title">自定义站点规则</div>\n <textarea id="custom_siteinfo" class="prefs_textarea" placeholder="自定义站点规则" />\n </div>\n <div class="form-row" title="一行一个,每行的第一个 = 为分隔符。\\n保存后生效">\n <div class="prefs_title">自定义替换规则</div>\n <textarea id="custom_replace_rules" class="prefs_textarea" placeholder="b[āà]ng=棒" />\n </div>\n </div>\n</form>'
  3877. .uiTrans().replace(/\\n/g, '\n'),
  3878.  
  3879. preferencesCSS: '.body {\n color:#333;\n margin: 0 auto;\n background: white;\n padding: 10px;\n height: 420px;\n overflow-y: auto;\n }\n #top-buttons {\n background: none repeat scroll 0% 0% rgb(255, 255, 255);\n display: block;\n position: absolute;\n top: -35px;\n border-right: 12px solid rgb(224, 224, 224);\n border-top: 12px solid rgb(224, 224, 224);\n border-left: 12px solid rgb(224, 224, 224);\n text-align: center;\n }\n input {\n font-size: 12px;\n margin-right: 3px;\n vertical-align: middle;\n }\n .form-row {\n overflow: hidden;\n padding: 8px 12px;\n margin-top: 3px;\n font-size: 11px;\n }\n .form-row label {\n padding-right: 10px;\n }\n .form-row input {\n vertical-align: middle;\n margin-top: 0px;\n }\n textarea, .form-row input {\n padding: 2px 4px;\n border: 1px solid #e5e5e5;\n background: #fff;\n border-radius: 4px;\n color: #666;\n -webkit-transition: all linear .2s;\n transition: all linear .2s;\n }\n textarea {\n width: 100%;\n overflow: auto;\n vertical-align: top;\n }\n textarea:focus, input:focus {\n border-color: #99baca;\n outline: 0;\n background: #f5fbfe;\n color: #666;\n }\n .prefs_title {\n font-size: 12px;\n font-weight: bold;\n }\n .prefs_textarea {\n font-size: 12px;\n margin-top: 5px;\n height: 100px;\n }\n .right {\n float: right;\n }',
  3880. };
  3881.  
  3882.  
  3883. function Parser(){
  3884. this.init.apply(this, arguments);
  3885. }
  3886.  
  3887. Parser.prototype = {
  3888. constructor: Parser,
  3889. get contentTxt() { // callback 才有用
  3890. var text = $('<div>').html(this.content).text().trim();
  3891.  
  3892. // 解决第二个段落和第一个锻炼合在一起的问题
  3893. text = text.replace(/([^\n])  /, '$1\n  ');
  3894.  
  3895. return text;
  3896. },
  3897.  
  3898. init: function (info, doc, curPageUrl) {
  3899. this.info = info || {};
  3900. this.doc = doc;
  3901. this.$doc = $(doc);
  3902. this.curPageUrl = curPageUrl || doc.URL;
  3903. this._curPageHost = getUrlHost(this.curPageUrl); // 当前页的 host,后面用到
  3904.  
  3905. // 设置初始值
  3906. this.isTheEnd = false;
  3907. this.isSection = false;
  3908. },
  3909. applyPatch: function(){
  3910. var contentPatch = this.info.contentPatch;
  3911. if(contentPatch){
  3912. try {
  3913. contentPatch.call(this, this.$doc);
  3914. C.log("Apply Content Patch Success.");
  3915. } catch (e) {
  3916. C.log("Error: Content Patch Error!", e);
  3917. }
  3918. }
  3919. },
  3920. applyAsyncPatch: function(callback) {
  3921. var contentPatch = this.info.contentPatchAsync;
  3922. if(contentPatch){
  3923. try {
  3924. contentPatch.call(this, this.$doc, callback.bind(this));
  3925. C.log("Apply Content Patch[Async] Success.");
  3926. } catch (e) {
  3927. C.log("Error: Content Patch[Async] Error!", e);
  3928. }
  3929. } else {
  3930. callback();
  3931. }
  3932. },
  3933. getAll: function(callback){
  3934. var self = this;
  3935.  
  3936. C.debug('开始解析页面');
  3937.  
  3938. this.applyPatch();
  3939.  
  3940. this.applyAsyncPatch(function() {
  3941. self.preProcessDoc(callback);
  3942. });
  3943.  
  3944. return this;
  3945. },
  3946. preProcessDoc: function(callback) {
  3947. var self = this;
  3948. var endFn = function(data) {
  3949. if (data) {
  3950. var div;
  3951. if (data.content) {
  3952. div = $('<div id="content"></div>').html(data.content);
  3953. } else if (data.html) {
  3954. div = $('<div></div>').html(data.html);
  3955. }
  3956.  
  3957. self.$doc.find('body').prepend(div);
  3958. }
  3959.  
  3960. self.parse();
  3961. callback(self);
  3962. };
  3963.  
  3964. if (!this.hasContent() && this.info.getContent) {
  3965. C.log('开始 info.getContent')
  3966. this.info.getContent.call(this, this.$doc, endFn);
  3967. } else {
  3968. // 特殊处理,例如起点
  3969. var ajaxScript = this.$doc.find('.' + READER_AJAX);
  3970. if (ajaxScript.length > 0) {
  3971. var url = ajaxScript.attr('src');
  3972. if(!url) return;
  3973. var charset = ajaxScript.attr('charset') || 'utf-8';
  3974.  
  3975. C.log('Ajax 获取内容: ', url, ". charset=" + charset);
  3976.  
  3977. var reqObj = {
  3978. url: url,
  3979. method: "GET",
  3980. overrideMimeType: "text/html;charset=" + charset,
  3981. headers: {},
  3982. onload: function(res){
  3983. var text = res.responseText;
  3984. text = text.replace(/document.write(ln)?\('/, "")
  3985. .replace("');", "")
  3986. .replace(/[\n\r]+/g, '</p><p>');
  3987.  
  3988. endFn({
  3989. content: text
  3990. });
  3991. }
  3992. };
  3993.  
  3994. // Jixun: Allow post data
  3995. var postData = ajaxScript.data('post');
  3996.  
  3997. if (postData) {
  3998. reqObj.method = 'POST';
  3999. reqObj.data = $.param(postData);
  4000. reqObj.headers['Content-Type'] = 'application/x-www-form-urlencoded';
  4001. }
  4002.  
  4003. GM_xmlhttpRequest(reqObj);
  4004. } else {
  4005. endFn();
  4006. }
  4007. }
  4008. },
  4009. parse: function() {
  4010. C.group('开始获取链接');
  4011. this.getPrevUrl();
  4012. this.getIndexUrl();
  4013. this.getNextUrl();
  4014. C.groupEnd();
  4015.  
  4016. C.group('开始获取标题');
  4017. this.getTitles();
  4018. C.groupEnd();
  4019.  
  4020. this.getContent();
  4021. },
  4022.  
  4023. hasContent: function() {
  4024. var $content;
  4025.  
  4026. // var $ajaxScript = this.$doc.find('.' + READER_AJAX);
  4027. // if ($ajaxScript.length > 0) {
  4028. // return true;
  4029. // }
  4030.  
  4031. if(this.info.contentSelector){
  4032. $content = this.$doc.find(this.info.contentSelector);
  4033. }
  4034.  
  4035. if (!$content || !$content.length) {
  4036. // 按照顺序选取
  4037. var selectors = Rule.contentSelectors;
  4038. for(var i = 0, l = selectors.length; i < l; i++){
  4039. $content = this.$doc.find(selectors[i]);
  4040. if($content.length){
  4041. C.log("自动查找内容选择器: " + selectors[i]);
  4042. break;
  4043. }
  4044. }
  4045. }
  4046.  
  4047. this.$content = $content;
  4048. // C.debug($content);
  4049.  
  4050. return $content.size() > 0;
  4051. },
  4052. // 获取书名和章节标题
  4053. getTitles: function(){
  4054. var info = this.info,
  4055. chapterTitle,
  4056. bookTitle,
  4057. docTitle = this.$doc.find("title").text();
  4058.  
  4059. // 获取章节标题
  4060. if (info.titleReg){
  4061. var matches = docTitle.match(toRE(info.titleReg, 'i'));
  4062. if(matches && matches.length >= 2){
  4063. var titlePos = ( info.titlePos || 0 ) + 1;
  4064. var chapterPos = (titlePos == 1) ? 2 : 1;
  4065.  
  4066. bookTitle = matches[titlePos];
  4067. chapterTitle = matches[chapterPos];
  4068. }
  4069.  
  4070. C.log("TitleReg:", info.titleReg, matches);
  4071. }
  4072.  
  4073. // 如果有 titleSelector 则覆盖
  4074. var tmpChapterTitle = this.getTitleFromInfo(info.titleSelector);
  4075. if (tmpChapterTitle) {
  4076. chapterTitle = tmpChapterTitle
  4077. }
  4078. if(!chapterTitle){
  4079. chapterTitle = this.autoGetChapterTitle(this.doc);
  4080. }
  4081. if (info.chapterTitleReplace) {
  4082. chapterTitle = chapterTitle.replace(toRE(info.chapterTitleReplace), '')
  4083. }
  4084.  
  4085. if (!bookTitle) {
  4086. bookTitle = this.getTitleFromInfo(info.bookTitleSelector);
  4087. }
  4088. if (!bookTitle) {
  4089. bookTitle = this.$doc.find(Rule.bookTitleSelector).text();
  4090. }
  4091. if (info.bookTitleReplace) {
  4092. bookTitle = bookTitle.replace(toRE(info.bookTitleReplace), '')
  4093. }
  4094.  
  4095. // 标题间增加一个空格,不准确,已注释
  4096. chapterTitle = chapterTitle
  4097. .replace(Rule.titleReplace, "")
  4098. .trim();
  4099. // .replace(/(第?\S+?[章节卷回])(.*)/, "$1 $2");
  4100.  
  4101. if (chapterTitle.startsWith(bookTitle)) {
  4102. chapterTitle = chapterTitle.replace(bookTitle, '').trim();
  4103. }
  4104.  
  4105. bookTitle = bookTitle.replace(/(?:最新章节|章节目录)$/, '');
  4106.  
  4107. docTitle = bookTitle ?
  4108. bookTitle + ' - ' + chapterTitle :
  4109. docTitle;
  4110.  
  4111. if (Config.cn2tw) {
  4112. bookTitle = this.convert2tw(bookTitle);
  4113. chapterTitle = this.convert2tw(chapterTitle);
  4114. docTitle = this.convert2tw(docTitle);
  4115. }
  4116.  
  4117. this.bookTitle = (bookTitle || '目录').trim();
  4118. this.chapterTitle = chapterTitle;
  4119. this.docTitle = docTitle;
  4120.  
  4121. C.log("Book Title: " + this.bookTitle);
  4122. C.log("Chapter Title: " + this.chapterTitle);
  4123. C.log("Document Title: " + this.docTitle);
  4124. },
  4125. getTitleFromInfo: function(selectorOrArray) {
  4126. var title = '';
  4127. if (!selectorOrArray) {
  4128. return '';
  4129. }
  4130.  
  4131. var selector,
  4132. replace;
  4133.  
  4134. if (_.isArray(selectorOrArray)) {
  4135. selector = selectorOrArray[0];
  4136. replace = selectorOrArray[1];
  4137. } else {
  4138. selector = selectorOrArray;
  4139. }
  4140.  
  4141. var $title = this.$doc.find(selector);
  4142. if (!$title.length) {
  4143. C.error('无法找到标题', selector, this.doc)
  4144. return '';
  4145. }
  4146.  
  4147. title = $title.remove().text().trim();
  4148.  
  4149. if (replace) {
  4150. title = title.replace(toRE(replace), '');
  4151. }
  4152.  
  4153. return title;
  4154. },
  4155. // 智能获取章节标题
  4156. autoGetChapterTitle: function (document) {
  4157. var
  4158. _main_selector = "h1, h2, h3",
  4159. _second_selector = "#TextTitle, #title, .ChapterName, #lbChapterName, div.h1",
  4160. _positive_regexp = Rule.titleRegExp,
  4161. // _positive_regexp = /第?\S+[章节卷回]|\d{2,4}/,
  4162. // _negative_regexp = /[上前下后][一]?[页张个篇章节步]/,
  4163. _title_remove_regexp = /最新章节|书书网/,
  4164. $doc = $(document),
  4165. _document_title = document.title ? document.title : $doc.find("title").text(),
  4166. _search_document_title = ' ' + _document_title.replace(/\s+/gi, ' ') + ' '
  4167. ;
  4168.  
  4169. var _headings = $doc.find(_main_selector);
  4170. // 加上 second selector 并去除包含的
  4171. $doc.find(_second_selector).each(function(){
  4172. if($(this).find(_main_selector).length === 0){
  4173. _headings.push(this);
  4174. }
  4175. });
  4176.  
  4177. var possibleTitles = {},
  4178. _heading_text;
  4179.  
  4180. C.groupCollapsed('自动查找章节标题');
  4181.  
  4182. $(_headings).each(function(){
  4183. var _heading = this,
  4184. _heading_text = _heading.textContent.trim();
  4185.  
  4186. if (_heading_text in possibleTitles) {
  4187. return;
  4188. }
  4189.  
  4190. C.group('开始计算 "' + _heading_text + '" 的得分');
  4191.  
  4192. // h1 为 1, h2 为 2
  4193. var
  4194. nodeNum = parseInt(_heading.nodeName.slice(1), 10) || 10,
  4195. score = 10 / nodeNum,
  4196. _heading_words = _heading_text.replace(/\s+/g, " ").split(" "),
  4197. _matched_words = ""
  4198. ;
  4199.  
  4200. C.log("初始得分:" + score);
  4201.  
  4202. // 后面这种是特殊的判断
  4203. if (_positive_regexp.test(_heading_text) || /\d{2,4}/.test(_heading_text)) {
  4204. score += 50;
  4205. }
  4206. // if(_negative_regexp.test(_heading_text)){
  4207. // score -= 100;
  4208. // }
  4209.  
  4210. C.log("符合正则计算后得分:" + score);
  4211.  
  4212. // count words present in title
  4213. for (var j = 0, _j = _heading_words.length; j < _j; j++) {
  4214. if (_search_document_title.indexOf(_heading_words[j]) > -1) {
  4215. _matched_words += _heading_words[j] + ' ';
  4216. }
  4217. }
  4218. score += _matched_words.length * 1.5;
  4219.  
  4220. C.log("跟页面标题比较后得分:" + score);
  4221.  
  4222. var _font_size_text = "",
  4223. _font_size_add_score = 0,
  4224. _heading_style = window.getComputedStyle(_heading, null);
  4225. if(_heading_style){
  4226. _font_size_text = _heading_style.getPropertyValue("font-size") || 0;
  4227. _font_size_add_score = parseInt(_font_size_text, 10) * 1.5;
  4228. }
  4229.  
  4230. score += _font_size_add_score;
  4231.  
  4232. C.log("计算大小后得分:" + score);
  4233.  
  4234. possibleTitles[_heading_text] = score;
  4235.  
  4236. C.groupEnd();
  4237. });
  4238.  
  4239. // 找到分数最高的值
  4240. var topScoreTitle,
  4241. score_tmp = 0;
  4242. for (_heading_text in possibleTitles) {
  4243. if (possibleTitles[_heading_text] > score_tmp) {
  4244. topScoreTitle = _heading_text;
  4245. score_tmp = possibleTitles[_heading_text];
  4246. }
  4247. }
  4248.  
  4249. var curTitle = topScoreTitle;
  4250. if (!curTitle) {
  4251. curTitle = _document_title;
  4252.  
  4253. // 下面的正则从
  4254. // Firefox-Firefox浏览器论坛-卡饭论坛 - 互助分享 - 大气谦和!
  4255. // 变为
  4256. // Firefox-Firefox浏览器论坛-卡饭论坛
  4257. curTitle = curTitle.replace(/\s-\s.*/i, "")
  4258. .replace(/_[^\[\]【】]+$/, "");
  4259. curTitle = curTitle.trim();
  4260. curTitle = curTitle.replace(_title_remove_regexp, '');
  4261. }
  4262.  
  4263. curTitle = curTitle.replace(Rule.titleReplace, "");
  4264.  
  4265. C.groupEnd();
  4266.  
  4267. return curTitle;
  4268. },
  4269.  
  4270. // 获取和处理内容
  4271. getContent: function(){
  4272. var self = this;
  4273.  
  4274. this.hasContent();
  4275.  
  4276. if (this.$content.size() <= 0) {
  4277. // callback(this);
  4278. console.error('没有找到内容', this.$doc);
  4279. return;
  4280. }
  4281.  
  4282. this.content = this.handleContentText(this.$content.html(), this.info);
  4283. },
  4284. handleContentText: function(text, info){
  4285. if(!text) return null;
  4286.  
  4287. // 贴吧的内容处理比较耗时间
  4288. C.group('开始内容处理');
  4289. C.time('内容处理');
  4290.  
  4291. var contentHandle = (typeof(info.contentHandle) == 'undefined') ? true : info.contentHandle;
  4292.  
  4293. // 拼音字、屏蔽字修复
  4294. if(contentHandle){
  4295. text = this.replaceHtml(text, Rule.replace);
  4296. }
  4297.  
  4298. /* Turn all double br's into p's */
  4299. text = text.replace(Rule.replaceBrs, '</p>\n<p>');
  4300. text = text.replace(/<\/p><p>/g, "</p>\n<p>");
  4301.  
  4302. text = this.normalizeContent(text);
  4303.  
  4304. // GM_setClipboard(text);
  4305.  
  4306. text = this.removeDump(text)
  4307.  
  4308. // 规则替换
  4309. if (info.contentReplace) {
  4310. text = this.replaceText(text, info.contentReplace);
  4311. }
  4312.  
  4313. // 移除文字广告等
  4314. text = this.replaceText(text, Rule.replaceAll);
  4315.  
  4316. // 去除内容中的标题
  4317. if(this.chapterTitle && Rule.titleRegExp.test(this.chapterTitle)){
  4318. try {
  4319. var reg = toReStr(this.chapterTitle).replace(/\s+/g, '\\s*');
  4320. reg = new RegExp(reg, 'ig');
  4321. text = text.replace(reg, "");
  4322. C.log('去除内容中的标题', reg);
  4323. } catch(e) {
  4324. console.error(e);
  4325. }
  4326. }
  4327.  
  4328. if (this.bookTitle) {
  4329. var regStr = '(' + toReStr(this.bookTitle) + '\\d*章)'
  4330. text = text.replace(new RegExp(regStr, 'ig'), "");
  4331. }
  4332.  
  4333. if (Config.cn2tw) {
  4334. text = this.convert2tw(text);
  4335. }
  4336.  
  4337. try {
  4338. text = this.contentCustomReplace(text);
  4339. } catch(ex) {
  4340. console.error('自定义替换错误', ex);
  4341. }
  4342.  
  4343. // 采用 DOM 方式进行处理
  4344. var $div = $("<div>").html(text);
  4345.  
  4346. // contentRemove
  4347. $div.find(Rule.contentRemove).remove();
  4348. if(info.contentRemove){
  4349. $div.find(info.contentRemove).remove();
  4350. }
  4351.  
  4352. // 给独立的文本加上 p
  4353. var $contents = $div.contents();
  4354. if ($contents.length === 1) { // 可能里面还包裹着一个 div
  4355. $contents = $contents.contents()
  4356. }
  4357. $contents.filter(function() {
  4358. return this.nodeType == 3 &&
  4359. this.textContent != '\n' &&
  4360. (!this.nextElementSibling || this.nextElementSibling.nodeName != 'A') &&
  4361. (!this.previousElementSibling || this.previousElementSibling.nodeName != 'A');
  4362. }).wrap('<p>');
  4363.  
  4364. // 删除无效的 p,排除对大块文本的判断
  4365. $div.find('p').filter(function() {
  4366. var $this = $(this);
  4367. if ($this.find('img').size()) // 排除有图片的
  4368. return false;
  4369.  
  4370. // 有效文本(排除注释、换行符、空白)个数为 0
  4371. return $this.contents().filter(function() {
  4372. return this.nodeType != 8 &&
  4373. !this.textContent.match(/^\s*$/);
  4374. }).size() == 0;
  4375. }).remove();
  4376.  
  4377. // 把一大块的文本分段
  4378. if (Config.split_content) {
  4379. var $p = $div.find('p'),
  4380. $newP;
  4381. if ($p.length == 0 ) {
  4382. $newP = $div;
  4383. } else if ($p.length == 1) {
  4384. $newP = $p;
  4385. }
  4386.  
  4387. if ($newP) {
  4388. $newP.replaceWith('<p>' + this.splitContent($newP.html()).join('</p>\n<p>') + '</p>');
  4389. }
  4390. }
  4391.  
  4392. if(contentHandle){
  4393. $div.filter('br').remove();
  4394.  
  4395. $div.find('*').removeAttr('style');
  4396. }
  4397.  
  4398. $div.find('p').removeAttr('class');
  4399.  
  4400. // 图片居中,所有图像?
  4401. // if(info.fixImage){
  4402. // $div.find("img").each(function(){
  4403. // this.className += " blockImage";
  4404. // });
  4405. // }
  4406.  
  4407. text = $div.html();
  4408.  
  4409. // 修复第一行可能是空的情况
  4410. text = text.replace(/(?:\s|&nbsp;)+<p>/, "<p>");
  4411.  
  4412. // 修复当行就一个字符的
  4413. text = text.replace(/<\/p><p>([。])/, "$1");
  4414.  
  4415. if(config.paragraphBlank){
  4416. text = text.replace(/<p>(?:\s|&nbsp;)+/g, "<p>")
  4417. .replace(/<p>/g, "<p>  ");
  4418. }
  4419.  
  4420. // 删除空白的、单个字符的 p
  4421. text = text.replace(Rule.removeLineRegExp, "");
  4422.  
  4423. C.timeEnd('内容处理');
  4424. C.groupEnd();
  4425.  
  4426. return text;
  4427. },
  4428. normalizeContent: function(text) {
  4429. text = text.trim()
  4430.  
  4431. if (text.startsWith('<')) return text;
  4432.  
  4433. // 修正 </p> 在另一行的情况
  4434. text = text.replace(/\n<\/p>/g, '</p>');
  4435.  
  4436. var lines = text.split('\n')
  4437. var firstLine = lines[0];
  4438. var lastLine = lines[lines.length - 1];
  4439.  
  4440. // 修正 p 不完整的情况
  4441. if (!firstLine.includes('<p>') && firstLine.includes('</p>')) {
  4442. text = '<p>' + text;
  4443. }
  4444. if (lastLine.includes('<p>') && !lastLine.includes('</p>')) {
  4445. text = text + '</p>';
  4446. }
  4447.  
  4448. return text;
  4449. },
  4450. /**
  4451. * 移除内容中大块的重复。
  4452. * 例如:http://www.wangshuge.com/books/109/109265/28265316.html
  4453. *
  4454. * @param {string} text 内容
  4455. * @return {string} 处理后的内容
  4456. */
  4457. removeDump: function(text) {
  4458. var newContent = text
  4459.  
  4460. var lines = text.split('\n');
  4461. var firstLine = lines[0];
  4462. // 有重复
  4463. if (firstLine.length > 10) {
  4464. // 因为 indexOf 只查找第一个
  4465. var dumpIndex = lines.slice(1).indexOf(firstLine) + 1;
  4466. if (dumpIndex >= config.dumpContentMinLength) {
  4467. var firstPart = lines.slice(0, dumpIndex).join('\n');
  4468. var restPart = lines.slice(dumpIndex).join('\n')
  4469. .replace(/^<\/p>\n/, '');
  4470. if (restPart.startsWith(firstPart)) {
  4471. newContent = restPart
  4472. }
  4473. }
  4474. }
  4475.  
  4476. return newContent;
  4477. },
  4478. replaceHtml: function(text, replaceRule) { // replaceRule 给“自定义替换规则直接生效”用
  4479. if (!replaceRule) {
  4480. replaceRule = Rule.replace;
  4481. }
  4482.  
  4483. // 先提取出 img
  4484. var imgs = {};
  4485. var i = 0;
  4486. text = text.replace(/<(img|a)[^>]*>/g, function(img){
  4487. imgs[i] = img;
  4488. return "{" + (i++) + "}";
  4489. });
  4490.  
  4491. // 修正拼音字等
  4492. text = this.contentReplacements(text, replaceRule);
  4493.  
  4494. // 还原图片
  4495. text = $.nano(text, imgs);
  4496.  
  4497. return text;
  4498. },
  4499. contentReplacements: function (text, rule) {
  4500. if (!text) return text;
  4501.  
  4502. for (var key in rule) {
  4503. text = text.replace(toRE(key, "ig"), rule[key]);
  4504. }
  4505. return text;
  4506. },
  4507. replaceText: function(text, rule){
  4508. var self = this;
  4509. switch(true) {
  4510. case _.isRegExp(rule):
  4511. text = text.replace(rule, '');
  4512. break;
  4513. case _.isString(rule):
  4514. // 还原简写
  4515. _.each(CHAR_ALIAS, function(value, key) {
  4516. rule = rule.replace(key, value);
  4517. });
  4518. var regexp = new RegExp(rule, 'ig');
  4519. text = text.replace(regexp, '');
  4520. break;
  4521. case _.isArray(rule):
  4522. rule.forEach(function(r){
  4523. text = self.replaceText(text, r);
  4524. });
  4525. break;
  4526. case _.isObject(rule):
  4527. var key;
  4528. for(key in rule){
  4529. text = text.replace(new RegExp(key, "ig"), rule[key]);
  4530. }
  4531. break;
  4532. }
  4533. return text;
  4534. },
  4535. convert2tw: function (text) {
  4536. if (!text) return text;
  4537.  
  4538. var ii, len, str;
  4539. str = text.split("");
  4540. len = str.length;
  4541. for (ii = 0; ii < len; ii++) {
  4542. str[ii] = cn2tw[str[ii]] || str[ii];
  4543. }
  4544.  
  4545. str = str.join("");
  4546.  
  4547. return str;
  4548. },
  4549. contentCustomReplace: function (text) {
  4550. if (!text) return text;
  4551.  
  4552. for (var key in Rule.customReplace) {
  4553. text = text.replace(new RegExp(key, 'ig'), Rule.customReplace[key]);
  4554. }
  4555. return text;
  4556. },
  4557. splitContent: function (text) { // 有些章节整个都集中在一起,没有分段,这个函数用于简易分段
  4558. if (text.indexOf('。') == -1) {
  4559. return [text];
  4560. }
  4561.  
  4562. var hasMark = false,
  4563. lines = []
  4564. charCotainer = [];
  4565.  
  4566. text.split('').forEach(function(c) {
  4567. charCotainer.push(c);
  4568.  
  4569. if (c == '“') {
  4570. hasMark = true;
  4571. } else if (c == '”') {
  4572. hasMark = false;
  4573. } else if (c == '。' && !hasMark) {
  4574. lines.push(charCotainer.join(''));
  4575. charCotainer = [];
  4576. }
  4577. });
  4578.  
  4579. return lines;
  4580. },
  4581.  
  4582. getIndexUrl: function(){
  4583. var url = '',
  4584. selector = this.info.indexSelector || this.info.indexUrl;
  4585.  
  4586. if (selector === false) {
  4587. this.indexUrl = url;
  4588. return url;
  4589. }
  4590.  
  4591. // 先尝试站点规则
  4592. if (selector && _.isFunction(selector)) {
  4593. url = selector(this.$doc);
  4594. } else if(this.info.indexSelector){
  4595. url = this.$doc.find(this.info.indexSelector);
  4596. }
  4597.  
  4598. // 再尝试通用规则
  4599. if (!url || !url.length) {
  4600. var selectors = Rule.indexSelectors;
  4601. var _indexLink;
  4602. // 按照顺序选取目录链接
  4603. for(var i = 0, l = selectors.length; i < l; i++){
  4604. _indexLink = this.$doc.find(selectors[i]);
  4605. if(_indexLink.length > 0){
  4606. url = _indexLink;
  4607. break;
  4608. }
  4609. }
  4610. }
  4611.  
  4612. if(url){
  4613. url = this.checkLinks(url);
  4614. C.log("找到目录链接: " + url);
  4615. }
  4616.  
  4617. if (!url) {
  4618. C.log("无法找到目录链接.");
  4619. }
  4620.  
  4621. this.indexUrl = url;
  4622. return url;
  4623. },
  4624. getNextUrl: function(){
  4625. var url = '',
  4626. selector = this.info.nextSelector || this.info.nextUrl;
  4627.  
  4628. if (selector === false) {
  4629. this.nextUrl = url;
  4630. return url;
  4631. }
  4632.  
  4633. // 先尝试站点规则
  4634. if (selector) {
  4635. if (_.isFunction(selector)) {
  4636. url = selector(this.$doc);
  4637. } else {
  4638. url = this.$doc.find(selector);
  4639. }
  4640.  
  4641. url = this.checkLinks(url);
  4642. }
  4643.  
  4644. // 再尝试通用规则
  4645. if (!url) {
  4646. url = this.$doc.find(Rule.nextSelector);
  4647. url = this.checkLinks(url);
  4648. }
  4649.  
  4650. if (url) {
  4651. C.log("找到下一页链接: " + url);
  4652. } else {
  4653. C.log("无法找到下一页链接");
  4654. }
  4655.  
  4656. this.nextUrl = url || '';
  4657. this.isTheEnd = !this.checkNextUrl(url);
  4658. if(this.isTheEnd){
  4659. this.theEndColor = config.end_color;
  4660. }
  4661.  
  4662. return url;
  4663. },
  4664. // 获取上下页及目录页链接
  4665. getPrevUrl: function(){
  4666. var url = '',
  4667. selector = this.info.prevSelector || this.info.prevUrl;
  4668.  
  4669. if (selector === false) {
  4670. this.prevUrl = url;
  4671. return url;
  4672. }
  4673.  
  4674. // 先尝试站点规则
  4675. if (selector) {
  4676. if (_.isFunction(selector)) {
  4677. url = selector(this.$doc);
  4678. } else {
  4679. url = this.$doc.find(selector);
  4680. }
  4681.  
  4682. url = this.checkLinks(url);
  4683. }
  4684.  
  4685. // 再尝试通用规则
  4686. if (!url) {
  4687. url = this.$doc.find(Rule.prevSelector);
  4688. url = this.checkLinks(url);
  4689. }
  4690.  
  4691. if (url) {
  4692. C.log("找到上一页链接: " + url);
  4693. } else {
  4694. C.log("无法找到上一页链接");
  4695. }
  4696.  
  4697. this.prevUrl = url || '';
  4698. return url;
  4699. },
  4700. checkNextUrl: function(url){
  4701. if (this.info.checkSection) {
  4702. if (/\/\d+_\d+\.html$/.test(this.curPageUrl)) {
  4703. this.isSection = true;
  4704. if(url == this.indexUrl){
  4705. return false;
  4706. }else{
  4707. return true;
  4708. }
  4709. }
  4710. }
  4711.  
  4712. // 跟 include 比较
  4713. var includeUrl = this.info.includeUrl || this.getIncludeUrl();
  4714. if (!toRE(includeUrl).test(url))
  4715. return false;
  4716.  
  4717. switch(true){
  4718. case url === '':
  4719. case Rule.nextUrlIgnore.some(function(re) { return toRE(re).test(url) }):
  4720. case url === this.indexUrl:
  4721. case url === this.prevUrl:
  4722. case url === this.curPageUrl:
  4723. case Rule.nextUrlCompare.test(this.prevUrl) && !Rule.nextUrlCompare.test(url):
  4724. return false;
  4725. default:
  4726. return true;
  4727. }
  4728. },
  4729. getIncludeUrl: function() {
  4730. var includeUrl = this.info.url;
  4731.  
  4732. if (!includeUrl && typeof GM_info !== 'undefined') {
  4733. var locationHref = location.href;
  4734. GM_info.script.includes.some(function(includeStr) {
  4735. var iUrl = wildcardToRegExpStr(includeStr);
  4736. if (toRE(iUrl).test(locationHref)) {
  4737. includeUrl = iUrl;
  4738. return true;
  4739. }
  4740. });
  4741. }
  4742.  
  4743. this.info.includeUrl = includeUrl;
  4744. return includeUrl;
  4745. },
  4746. checkLinks: function(links){
  4747. var self = this;
  4748. var url = '';
  4749.  
  4750. if (!links) return ''
  4751.  
  4752. if (_.isString(links)) {
  4753. return this.getFullHref(links);
  4754. }
  4755.  
  4756. links && links.each(function(){
  4757. url = $(this).attr("href");
  4758. if(!url || url.indexOf("#") === 0 || url.indexOf("javascript:") === 0)
  4759. return;
  4760.  
  4761. url = self.getFullHref(this);
  4762. return false;
  4763. });
  4764.  
  4765. return url;
  4766. },
  4767. getLinkUrl: function(linkOrUrl) {
  4768. // if (linkOrUrl && )
  4769. return linkOrUrl;
  4770. },
  4771. getFullHref: function(href) {
  4772. if(!href) return '';
  4773.  
  4774. if (!_.isString(href)) {
  4775. href = href.getAttribute('href');
  4776. }
  4777.  
  4778. if (href.indexOf('http://') === 0) {
  4779. return href;
  4780. }
  4781.  
  4782. var a = this.a;
  4783. if (!a) {
  4784. this.a = a = document.createElement('a');
  4785. }
  4786. a.href = href;
  4787.  
  4788. // // 检测 host 是否和 当前页的一致
  4789. // if (a.host != this._curPageHost) {
  4790. // a.host = this._curPageHost;
  4791. // }
  4792.  
  4793. return a.href;
  4794. },
  4795. };
  4796.  
  4797.  
  4798. var App = {
  4799. isEnabled: false,
  4800. parsedPages: {},
  4801. pageNum: 1,
  4802. paused: false,
  4803. curPageUrl: location.href,
  4804. requestUrl: null,
  4805. iframe: null,
  4806. remove: [],
  4807.  
  4808. init: function() {
  4809. if (["mynovelreader-iframe", "superpreloader-iframe"].indexOf(window.name) != -1) { // 用于加载下一页的 iframe
  4810. return;
  4811. }
  4812.  
  4813. // 手动调用
  4814. var readx = function() {
  4815. // 防止 unsafeWindow cannot call: GM_getValue
  4816. setTimeout(function() {
  4817. App.launch();
  4818. }, 0);
  4819. };
  4820. try {
  4821. exportFunction(readx, unsafeWindow, {defineAs: "readx"});
  4822. } catch(ex) {
  4823. console.error('无法定义 readx 函数');
  4824. }
  4825.  
  4826.  
  4827. App.loadCustomSetting();
  4828. App.site = App.getCurSiteInfo();
  4829.  
  4830. if (App.site.startLaunch) {
  4831. App.site.startLaunch($(document));
  4832. }
  4833.  
  4834. var autoLaunch = App.isAutoLaunch();
  4835.  
  4836. if (autoLaunch === -1) {
  4837. return;
  4838. } else if (autoLaunch) {
  4839. if (App.site.mutationSelector) { // 特殊的启动:等待js把内容生成完毕
  4840. App.addMutationObserve(document, App.launch);
  4841. } else if (App.site.timeout) { // 延迟启动
  4842. setTimeout(App.launch, App.site.timeout);
  4843. } else { // NoScript 下 setTimeout 没用?
  4844. App.launch();
  4845. }
  4846. } else {
  4847. UI.addButton();
  4848. }
  4849. },
  4850. loadCustomSetting: function() {
  4851. var customRules;
  4852. try {
  4853. customRules = eval(Config.customSiteinfo);
  4854. } catch (e) {
  4855. console.error('载入自定义站点配置错误', e);
  4856. }
  4857.  
  4858. if (_.isArray(customRules)) {
  4859. Rule.customRules = customRules;
  4860. C.log('载入自定义站点规则成功', customRules);
  4861. }
  4862.  
  4863. // load custom replace rules
  4864. Rule.customReplace = Rule.parseCustomReplaceRules(Config.customReplaceRules);
  4865.  
  4866. C.log('载入自定义替换规则成功', Rule.customReplace);
  4867. },
  4868. getCurSiteInfo: function() {
  4869. var rules = Rule.customRules.concat(Rule.specialSite);
  4870. var locationHref = location.href;
  4871.  
  4872. var info = _.find(rules, function(x) {
  4873. return toRE(x.url).test(locationHref);
  4874. });
  4875.  
  4876. if (!info) {
  4877. info = {};
  4878. C.log("没有找到规则,尝试自动模式。");
  4879. } else {
  4880. C.log("找到规则:", info);
  4881. }
  4882. return info;
  4883. },
  4884. isAutoLaunch: function() {
  4885. var locationHref = window.location.href,
  4886. locationHost = location.host,
  4887. referrer = document.referrer;
  4888.  
  4889. switch (true) {
  4890. case L_getValue("mynoverlreader_disable_once") == 'true':
  4891. L_removeValue("mynoverlreader_disable_once");
  4892. return false;
  4893. // case location.hostname == 'www.fkzww.net' && !document.title.match(/网文快讯/): // 啃书只自动启用一个地方
  4894. // return false;
  4895. case Config.booklink_enable && /booklink\.me/.test(referrer):
  4896. return true;
  4897. case locationHost == 'tieba.baidu.com':
  4898. var title = $('.core_title_txt').text();
  4899. if (title.match(Rule.titleRegExp)) {
  4900. return false;
  4901. } else {
  4902. return -1;
  4903. }
  4904. case Config.getDisableAutoLaunch():
  4905. return false;
  4906. case GM_getValue("auto_enable"):
  4907. case config.soduso && /www\.sodu\.so/.test(referrer):
  4908. return true;
  4909. default:
  4910. return false;
  4911. }
  4912. },
  4913. addMutationObserve: function(doc, callback) {
  4914. var shouldAdd = false;
  4915. var $doc = $(doc);
  4916.  
  4917. if ($doc.find(App.site.contentSelector).size()) {
  4918. shouldAdd = false;
  4919. } else {
  4920. var mutationSelector = App.site.mutationSelector;
  4921. var target = $doc.find(mutationSelector)[0];
  4922. if (target) {
  4923. var childCount = App.site.mutationChildCount;
  4924. if (childCount === undefined || target.children.length <= childCount) {
  4925. shouldAdd = true;
  4926. }
  4927. }
  4928. }
  4929.  
  4930. if (shouldAdd) {
  4931. var observer = new MutationObserver(function(mutations) {
  4932. var nodeAdded = mutations.some(function(x) {
  4933. return x.addedNodes.length > 0;
  4934. });
  4935.  
  4936. if (nodeAdded) {
  4937. observer.disconnect();
  4938. callback();
  4939. }
  4940. });
  4941.  
  4942. observer.observe(target, {
  4943. childList: true
  4944. });
  4945.  
  4946. C.log("添加 MutationObserve 成功:", mutationSelector);
  4947. } else {
  4948. callback();
  4949. }
  4950. },
  4951. launch: function() {
  4952. // 只解析一次,防止多次重复解析一个页面
  4953. if (document.body && document.body.getAttribute("name") == "MyNovelReader") {
  4954. return App.toggle();
  4955. }
  4956.  
  4957. if (!App.site) {
  4958. App.site = App.getCurSiteInfo();
  4959. }
  4960.  
  4961. if (App.site.startFilter) {
  4962. try {
  4963. App.site.startFilter();
  4964. C.log('run startFilter function success');
  4965. } catch (ex) {
  4966. console.error('运行 startFilter function 错误', ex);
  4967. }
  4968. }
  4969.  
  4970. var parser = new Parser(App.site, document);
  4971. var hasContent = !!parser.hasContent();
  4972. if (hasContent) {
  4973. document.body.setAttribute("name", "MyNovelReader");
  4974. App.parsedPages[window.location.href] = true;
  4975. parser.getAll(function(parser) {
  4976. App.processPage(parser);
  4977. });
  4978. } else {
  4979. console.error("当前页面没有找到内容");
  4980. }
  4981.  
  4982. // 初始化, 取消页面限制等
  4983. if (App.site.fInit)
  4984. App.site.fInit();
  4985. },
  4986. processPage: function(parser) {
  4987. // 对 Document 进行处理
  4988. document.body.innerHTML = '';
  4989. App.prepDocument();
  4990. App.initDocument(parser);
  4991.  
  4992. // cache vars
  4993. App.$doc = $(document);
  4994. App.$menuBar = App.$doc.find("#menu-bar");
  4995. App.$menu = App.$doc.find("#menu");
  4996. App.$content = App.$doc.find("#mynovelreader-content");
  4997. App.$loading = App.$doc.find("#loading");
  4998. App.$preferencesBtn = App.$doc.find("#preferencesBtn");
  4999.  
  5000. App.$menuHeader = App.$menu.find("#chapter-list");
  5001. App.$chapterList = App.$menu.find("#chapter-list");
  5002.  
  5003. App.indexUrl = parser.indexUrl;
  5004. App.prevUrl = parser.prevUrl; // 第一个上一页
  5005.  
  5006. App.oArticles = []; // 原始的内容,用于替换的无需刷新
  5007. App.parsers = [];
  5008.  
  5009. // 加入上一章的链接
  5010. if (parser.prevUrl) {
  5011. $("<li>")
  5012. .addClass('chapter')
  5013. .append(
  5014. $("<div>")
  5015. .attr({
  5016. "realHref": parser.prevUrl,
  5017. "onclick": "return false;"
  5018. })
  5019. .text("上一章".uiTrans())
  5020. )
  5021. .prependTo(App.$chapterList);
  5022. }
  5023.  
  5024. // 插入站点样式
  5025. if (App.site.style) {
  5026. GM_addStyle(App.site.style);
  5027. }
  5028.  
  5029. App.appendPage(parser, true);
  5030.  
  5031. App.registerControls();
  5032.  
  5033. // UI 的初始化
  5034. UI.init();
  5035.  
  5036. App.curFocusElement = $("article:first").get(0); // 初始化当前关注的 element
  5037. App.requestUrl = parser.nextUrl;
  5038. App.isTheEnd = parser.isTheEnd;
  5039.  
  5040. App.isEnabled = true;
  5041. UI.addButton();
  5042.  
  5043. // // 如果已经把当前焦点链接添加到历史记录,则滚动到顶部
  5044. // if (Config.addToHistory) {
  5045. // window.scrollTo(0, 0);
  5046. // }
  5047.  
  5048. // 有些图片网站高度随着图片加载而变长
  5049. setTimeout(App.scroll, 1000);
  5050.  
  5051. App.cleanAgain();
  5052.  
  5053. if (config.PRELOADER) {
  5054. App.doRequest();
  5055. }
  5056. },
  5057. prepDocument: function() {
  5058. window.onload = window.onunload = function() {};
  5059.  
  5060. // 破解右键限制
  5061. var doc = document;
  5062. var bd = doc.body;
  5063. bd.onclick = bd.ondblclick = bd.onselectstart = bd.oncopy = bd.onpaste = bd.onkeydown = bd.oncontextmenu = bd.onmousemove = bd.onselectstart = bd.ondragstart = doc.onselectstart = doc.oncopy = doc.onpaste = doc.onkeydown = doc.oncontextmenu = null;
  5064. doc.onclick = doc.ondblclick = doc.onselectstart = doc.oncontextmenu = doc.onmousedown = doc.onkeydown = function() {
  5065. return true;
  5066. };
  5067.  
  5068. doc = document.wrappedJSObject || document;
  5069. doc.onmouseup = null;
  5070. doc.onmousedown = null;
  5071. doc.oncontextmenu = null;
  5072.  
  5073. var arAllElements = document.getElementsByTagName('*');
  5074. for (var i = arAllElements.length - 1; i >= 0; i--) {
  5075. var elmOne = arAllElements[i];
  5076. elmOne = elmOne.wrappedJSObject || elmOne;
  5077. elmOne.onmouseup = null;
  5078. elmOne.onmousedown = null;
  5079. }
  5080.  
  5081. $(document).unbind("keypress");
  5082. $(document).unbind("keydown");
  5083.  
  5084. // remove body style
  5085. $('link[rel="stylesheet"], script').remove();
  5086. $('body')
  5087. .removeAttr('style')
  5088. .removeAttr('bgcolor');
  5089.  
  5090. $('style').filter(function() {
  5091. var $style = $(this);
  5092. if($style.text().indexOf('#cVim-link-container') != -1) { // chrome 的 cVim 扩展
  5093. return false;
  5094. }
  5095. return true;
  5096. }).remove();
  5097. },
  5098. initDocument: function(parser) {
  5099. document.title = parser.docTitle;
  5100. window.name = "MyNovelReader";
  5101. document.body.innerHTML = $.nano('<div id="container">\n <div id="menu-bar" title="点击显示隐藏章节列表"></div>\n <div id="menu">\n <div id="header" title="打开目录">\n <a href="{indexUrl}" target="_blank">{bookTitle}</a>\n </div>\n <div id="divider"></div>\n <ul id="chapter-list" title="左键滚动,中键打开链接(无阅读模式)">\n </ul>\n </div>\n <div id="mynovelreader-content"></div>\n <div id="loading" style="display:none"></div>\n <div id="preferencesBtn">\n <img style="width:16px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABwklEQVRIibVVzWrCQBAeQk/bdk+bm0aWDQEPHtwVahdavLU9aw6KAQ+SQ86Sa19Aqu0T9NafSw8ttOgr1CewUB9CBL3Yy26x1qRp0A8GhsnO9yUzmxmAhKjX68cAMAeAufK3C875FQAsAWCp/O3CsqyhFlB+Oti2/cAYewrD8FDHarXahWEYUy1gGMbUdd1z/TwMw0PG2JNt2/ex5IyxR02CEJpIKbuEkJGOrRshZCSl7CKEJjrGGHuIFMjlcs9RZElNcWxGEAQHGONxWnKM8TgIgoPYMkkpL9MKqNx4xNX8LyOEvMeSq5uxMZlz3vN9v+D7foFz3os6V61Wz36QNhqNUyHENaV0CACLTUnFYvF6/WVUbJPIglI6FELctFqtMiT59Ha7TdcFVCxJ6XYs0Gw2T1SJBlsq0ZxSOhBC3Hied/QjSTUoqsn9lSb3o879avI61FXbzTUFACiXy7v70Tqdzj7G+COtwJ+jIpPJvKYl12ZZ1kucwJs+iBD6lFJ2TdOMHB2mab7/a1xXKpW9fD5/6zjO3erCcV33PMnCcRwnfuHEYXVlZrPZQWqiKJRKpe8Bt5Ol73leCQBmADBTfiJ8AebTYCRbI3BUAAAAAElFTkSuQmCC"/>\n </div>\n <div id="alert" style="display: none;">\n <p id="App-notice"></p>\n </div>\n</div>'.uiTrans(), parser);
  5102. },
  5103. clean: function() {
  5104. $('body > *:not("#container, .readerbtn, .noRemove, #reader_preferences, #uil_blocker,iframe[name=\'mynovelreader-iframe\']")').remove();
  5105. $('link[rel="stylesheet"]:not(.noRemove)').remove();
  5106. $('body, #container').removeAttr('style').removeAttr('class');
  5107.  
  5108. if (unsafeWindow.jQuery && location.host.indexOf('qidian') > 0) {
  5109. unsafeWindow.jQuery(document).off("selectstart").off("contextmenu");
  5110. }
  5111. },
  5112. cleanAgain: function() {
  5113. // var host = location.host;
  5114. // if (!host.match(/qidian\.com|zongheng\.com/)) { // 只在起点、纵横等网站运行
  5115. // return;
  5116. // }
  5117.  
  5118. // 再次移除其它不相关的,起点,纵横中文有时候有问题
  5119. setTimeout(App.clean, 2000);
  5120. setTimeout(App.clean, 5000);
  5121. setTimeout(App.clean, 8000);
  5122. // TM 用 addEventListener('load') 有问题
  5123. window.onload = function() {
  5124. App.clean();
  5125. setTimeout(App.clean, 500);
  5126. };
  5127. },
  5128. toggle: function() {
  5129. if (App.isEnabled) { // 退出
  5130. GM_setValue("auto_enable", false);
  5131. L_setValue("mynoverlreader_disable_once", true);
  5132.  
  5133. location.href = App.activeUrl;
  5134. } else {
  5135. GM_setValue("auto_enable", true);
  5136. L_removeValue("mynoverlreader_disable_once");
  5137. App.isEnabled = true;
  5138. App.launch();
  5139. }
  5140. },
  5141. removeListener: function() {
  5142. C.log("移除各种事件监听");
  5143. App.remove.forEach(function(_remove) {
  5144. _remove();
  5145. });
  5146. },
  5147. appendPage: function(parser, isFirst) {
  5148. var chapter = $("article:last");
  5149. if (chapter.length && parser.isSection) { // 每次获取的不是一章,而是一节
  5150. var lastText = chapter.find("p:last").remove().text().trim();
  5151. var newPage = parser.content.replace(/<p>\s+/, "<p>" + lastText);
  5152.  
  5153. chapter
  5154. .find(".chapter-footer-nav").remove()
  5155. .end()
  5156. .append(newPage);
  5157.  
  5158. if (!Config.hide_footer_nav) {
  5159. chapter.append($.nano(UI.tpl_footer_nav, parser));
  5160. }
  5161.  
  5162. } else {
  5163. chapter = $("<article>")
  5164. .attr("id", "page-" + App.pageNum)
  5165. .append(
  5166. $("<h1>").addClass("title").text(parser.chapterTitle)
  5167. )
  5168. .append(parser.content)
  5169. .appendTo(App.$content);
  5170.  
  5171. if (!Config.hide_footer_nav) {
  5172. chapter.append($.nano(UI.tpl_footer_nav, parser));
  5173. }
  5174.  
  5175. // App.fixImageFloats(chapter.get(0));
  5176.  
  5177. // 添加到章节列表
  5178. var chapterItem = $("<li>")
  5179. .addClass('chapter')
  5180. .append(
  5181. $("<div>")
  5182. .attr({
  5183. href: "#page-" + App.pageNum,
  5184. "realHref": parser.curPageUrl,
  5185. onclick: "return false;",
  5186. title: parser.chapterTitle
  5187. })
  5188. .text(parser.chapterTitle)
  5189. )
  5190. .prependTo(App.$chapterList);
  5191.  
  5192. if (isFirst) {
  5193. chapterItem.addClass('active');
  5194. }
  5195.  
  5196. App.pageNum += 1;
  5197. App.resetCache();
  5198. }
  5199.  
  5200. App.oArticles.push(chapter[0].outerHTML);
  5201. App.parsers.push(parser);
  5202. },
  5203. resetCache: function() { // 更新缓存变量
  5204. App.menuItems = App.$chapterList.find("div");
  5205. App.scrollItems = $("article");
  5206. },
  5207. registerControls: function() {
  5208. // 内容滚动
  5209. var throttled = _.throttle(App.scroll, 200);
  5210. $(window).scroll(throttled);
  5211.  
  5212. App.registerKeys();
  5213.  
  5214. if (Config.dblclickPause) {
  5215. App.$content.on("dblclick", function() {
  5216. App.pauseHandler();
  5217. });
  5218. }
  5219.  
  5220. // 左侧章节列表
  5221. App.$menuHeader.click(function() {
  5222. App.copyCurTitle();
  5223. });
  5224.  
  5225. App.$menuBar.click(function() {
  5226. UI.hideMenuList();
  5227. });
  5228.  
  5229. App.$doc.on("mousedown", "#chapter-list div", function(event) {
  5230. switch (event.which) {
  5231. case 1:
  5232. var href = $(this).attr("href");
  5233. if (href) {
  5234. App.scrollToArticle($(href));
  5235. } else {
  5236. location.href = $(this).attr("realHref");
  5237. }
  5238. break;
  5239. case 2: // middle click
  5240. L_setValue("mynoverlreader_disable_once", true);
  5241. App.openUrl($(this).attr("realHref"));
  5242. break;
  5243. }
  5244. });
  5245.  
  5246. $("#preferencesBtn").click(function(event) {
  5247. event.preventDefault();
  5248. UI.preferencesShow();
  5249. });
  5250.  
  5251. GM_registerMenuCommand("小说阅读脚本设置".uiTrans(), UI.preferencesShow.bind(UI));
  5252. },
  5253. registerKeys: function() {
  5254. key('enter', function(event) {
  5255. if (UI.$prefs) {
  5256. return;
  5257. }
  5258.  
  5259. App.openUrl(App.indexUrl, "主页链接没有找到".uiTrans());
  5260. App.copyCurTitle();
  5261.  
  5262. event.stopPropagation();
  5263. event.preventDefault();
  5264. });
  5265.  
  5266. key('left', function(event) {
  5267. var scrollTop = $(window).scrollTop();
  5268. if (scrollTop === 0) {
  5269. location.href = App.prevUrl;
  5270. } else {
  5271. var offsetTop = $(App.curFocusElement).offset().top;
  5272. // 在视野窗口内
  5273. if (offsetTop > scrollTop && offsetTop < (scrollTop + $(window).height())) {
  5274. App.scrollToArticle(App.curFocusElement.previousSibling || 0);
  5275. } else {
  5276. App.scrollToArticle(App.curFocusElement);
  5277. }
  5278. }
  5279. return false;
  5280. });
  5281.  
  5282. key('right', function(event) {
  5283. if (App.getRemain() === 0) {
  5284. location.href = App.lastRequestUrl || App.requestUrl;
  5285. } else {
  5286. App.scrollToArticle(App.curFocusElement.nextSibling || App.$doc.height());
  5287. }
  5288.  
  5289. event.preventDefault();
  5290. event.stopPropagation();
  5291. return false;
  5292. });
  5293.  
  5294. key('esc', function(){
  5295. if (UI.$prefs) {
  5296. UI.hide();
  5297. return false;
  5298. }
  5299. });
  5300.  
  5301. key('shift+/', function() {
  5302. UI.openHelp();
  5303. return false;
  5304. });
  5305.  
  5306. key(Config.quietModeKey, function(){
  5307. UI.toggleQuietMode();
  5308. return false;
  5309. });
  5310.  
  5311. key(Config.hideMenuListKey, function(){
  5312. UI.hideMenuList();
  5313. return false;
  5314. });
  5315.  
  5316. key(Config.openPreferencesKey, function(){
  5317. UI.preferencesShow();
  5318. return false;
  5319. });
  5320. },
  5321. copyCurTitle: function() {
  5322. if (Config.copyCurTitle) {
  5323. var title = $(App.curFocusElement).find(".title").text()
  5324. .replace(/第?\S+章/, "").trim();
  5325.  
  5326. GM_setClipboard(title, "text");
  5327. }
  5328. },
  5329. scrollToArticle: function(elem) {
  5330. var offsetTop;
  5331. if (typeof elem == "number") {
  5332. offsetTop = elem;
  5333. } else {
  5334. offsetTop = $(elem).offset().top - parseInt($(elem).css("margin-top"), 10);
  5335. }
  5336.  
  5337. if (Config.scrollAnimate) {
  5338. $("html, body").stop().animate({
  5339. scrollTop: offsetTop
  5340. }, 750, "easeOutExpo");
  5341. } else {
  5342. $("html, body").stop().scrollTop(offsetTop);
  5343. }
  5344. },
  5345. openUrl: function(url, errorMsg) {
  5346. if (url) {
  5347. // ff30 Greasemonkey 会报错:Greasemonkey 访问违规:unsafeWindow 无法调用 GM_openInTab。新建脚本采用按键调用也这样。
  5348. setTimeout(function() {
  5349. GM_openInTab(url, false);
  5350. }, 0);
  5351. } else if (errorMsg) {
  5352. UI.notice(errorMsg);
  5353. }
  5354. },
  5355. pauseHandler: function() {
  5356. App.paused = !App.paused;
  5357. if (App.paused) {
  5358. UI.notice('<b>状态</b>:自动翻页<span style="color:red!important;"><b>暂停</b></span>'.uiTrans());
  5359. App.$loading.html('自动翻页已经<span style="color:red!important;"><b>暂停</b></span>'.uiTrans()).show();
  5360. } else {
  5361. UI.notice('<b>状态</b>:自动翻页<span style="color:red!important;"><b>启用</b></span>'.uiTrans());
  5362. App.scroll();
  5363. }
  5364. },
  5365. scroll: function() {
  5366. if (!App.paused && !App.working && App.getRemain() < Config.remain_height) {
  5367. if (App.tmpDoc) {
  5368. App.loaded(App.tmpDoc);
  5369. } else {
  5370. App.doRequest();
  5371. }
  5372. }
  5373.  
  5374. if (App.isTheEnd) {
  5375. App.$loading.html("已到达最后一页...".uiTrans()).show();
  5376. }
  5377.  
  5378. App.updateCurFocusElement();
  5379. },
  5380. updateCurFocusElement: function() { // 滚动激活章节列表
  5381. // Get container scroll position
  5382. var fromTop = $(window).scrollTop() + $(window).height() / 2;
  5383.  
  5384. // Get id of current scroll item
  5385. var cur = App.scrollItems.map(function() {
  5386. if ($(this).offset().top < fromTop)
  5387. return this;
  5388. });
  5389. // Get the id of the current element
  5390. cur = cur[cur.length - 1];
  5391. var id = cur ? cur.id : "";
  5392.  
  5393. if (App.lastId !== id) {
  5394. App.lastId = id;
  5395.  
  5396. var activeItem = App.menuItems.filter("[href=#" + id + "]"),
  5397. activeTitle = activeItem.text(),
  5398. activeUrl = activeItem.attr("realHref");
  5399.  
  5400. // Set/remove active class
  5401. App.menuItems.parent().removeClass("active");
  5402. activeItem.parent().addClass("active");
  5403.  
  5404. App.curFocusElement = cur;
  5405. App.activeUrl = activeUrl;
  5406.  
  5407. if (Config.addToHistory) {
  5408. var curNum = id.match(/\d+/)[0] - 1; // 当前是第几个
  5409. var curTitle = App.parsers[curNum].docTitle;
  5410. document.title = curTitle;
  5411.  
  5412. // TODO: 起点无法添加整个网址,只能添加后半部分。
  5413. var url = activeUrl.replace('http://read.qidian.com', '');
  5414. try {
  5415. unsafeWindow.history.pushState(null, curTitle, url);
  5416. } catch (e) {
  5417. console.error('添加下一页到历史记录失败', e);
  5418. }
  5419. }
  5420. }
  5421. },
  5422. getRemain: function() {
  5423. var scrollHeight = Math.max(document.documentElement.scrollHeight,
  5424. document.body.scrollHeight);
  5425. var remain = scrollHeight - window.innerHeight - window.scrollY;
  5426. return remain;
  5427. },
  5428. doRequest: function() {
  5429. App.working = true;
  5430. var nextUrl = App.requestUrl;
  5431. App.lastRequestUrl = App.requestUrl;
  5432.  
  5433. if (nextUrl && !App.isTheEnd && !(nextUrl in App.parsedPages)) {
  5434. App.parsedPages[nextUrl] = 0;
  5435. App.curPageUrl = App.requestUrl;
  5436. App.requestUrl = null;
  5437.  
  5438. var useiframe = App.site.useiframe;
  5439.  
  5440. App.$loading
  5441. .show()
  5442. .html("")
  5443. .append($("<img>").attr("src", "data:image/gif;base64,R0lGODlhEAAQAMQAAPf39+/v7+bm5t7e3tbW1s7OzsXFxb29vbW1ta2traWlpZycnJSUlIyMjISEhHt7e3Nzc2tra2NjY1paWlJSUkpKSkJCQjo6OjExMSkpKSEhIRkZGRAQEAgICAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBQAeACwAAAEADwAOAAAFdaAnet20GAUCceN4LQlyFMRATC3GLEqM1gIc6dFgPDCii6I2YF0eDkinxUkMBBAPBfLItESW2sEjiWS/ItqALJGgRZrNRtvWoDlxFqZdmbY0cVMdbRMWcx54eSMZExQVFhcYGBmBfxWPkZQbfi0dGpIYGiwjIQAh+QQJBQAeACwAAAEADwAOAAAFeKAnep0FLQojceOYQU6DIsdhtVoEywptEBRRZyKBQDKii+JHYGEkxE6LkyAMIB6KRKJpJQuDg2cr8Y7AgjHULCoQ0pUJZWO+uBGeDIVikbYyDgRYHRUVFhcsHhwaGhsYfhuHFxgZGYwbHH4iHBiUlhuYmlMbjZktIQAh+QQFBQAeACwAAAEADwAOAAAFe6Aneh1GQU9UdeOoTVIEOQ2zWG0mSVP0ODYF4iLq7HgaEaaRQCA4HsyOwhp1FgdDxFOZTDYt0cVQSHgo6PCIPOBWKmpRgdDGWCzQ8KUwOHg2FxcYYRwJdBAiGRgZGXkcC3MEjhkalZYTfBMtHRudnhsKcGodHKUcHVUeIQAh+QQJBQAeACwAAAEADwAOAAAFbKAnjp4kURiplmYEQemoTZMpuY/TkBVFVRtRJtJgMDoejaViWT0WiokHc2muMIoEY0pdiRCIgyeDia0OhoJnk8l4PemEh6OprxQFQkS02WiCIhd4HmoiHRx9ImkEA14ciISMBFJeSAQIEBwjIQAh+QQJBQAeACwAAAEADwAOAAAFd6Anel1WTRKFdeO4WRWFStKktdwFU3JNZ6MM5nLZiDQTCCTC4ghXrU7k4bB4NpoMpyXKNBqQa5Y7YiwWHg6WLFK4SWoW95JAMOAbI05xOEhEHWoaFyJ0BgYHWyIcHA4Fj48EBFYtGJKSAwMFFGQdEAgCAgcQih4hACH5BAkFAB4ALAAAAQAPAA4AAAV0oCeKG2ZVFtaNY6dh10lNU8Z2WwbLkyRpI85Gk+GQKr7JqiME3mYSjIe5WbE8GkhkMhVeR48HpLv5ihoOB9l4xTAYYw9nomCLOgzFoiJSEAoIFiIXCwkJC1YVAwMEfwUGBgeBLBMEAouOBxdfHA8HlwgRdiEAIfkECQUAHgAsAAABAA8ADgAABXOgJ4rdpmWZ1o0sZ2YYdlka63XuKVsVVZOuzcrDufQoQxzH1rFMJJiba8jaPCnSjW30lHgGhMJWBIl4D2DLNvOATDwPwSCxHHUgjseFOJAn1B4YDgwND0MTAWAFBgcICgsMUVwDigYICQt7NhwQCGELE1QhACH5BAkFAB4ALAAAAQAPAA4AAAV4oCeOHWdyY+p1JbdpWoam7fZmGYZtYoeZm46Ik7kYhZBBQ6PyWSoZj0FAuKg8mwrF4glQryIKZdL9gicTiVQw4Ko2aYrnwUbMehGJBOPhDAYECVYeGA8PEBNCHhOABgcJCgwNh0wjFQaOCAoLk1EqHBILmg8Vih4hACH5BAkFAB4ALAAAAQAPAA4AAAV6oCd6Hdmd5ThWCee+XCpOwTBteL6lnCAMLVFHQ9SIHgHBgaPyZDKYjcfwszQ9HMwl40kOriKLuDsggD2VtOcwKFibGwrFCiEUEjJSZTLhcgwGBwsYIhkUEhITKRYGCAkKDA0PiBJcKwoKCwwODxETRk0dFA8NDhIYMiEAIfkECQUAHgAsAAABAA8ADgAABXmgJ3rcYwhcN66eJATCsHEpOwXwQGw8rZKDGMIi6vBmokcswWFtNBvVQUdkcTJQj67AGmEyGU+hYOiKMGiP4oC4dDmXS1iCSDR+xYvFovF0FAoLDxgiGxYUFRY/FwsMDQ4PEhOTFH0jFw6QEBKcE5YrHRcTERIUGHghACH5BAkFAB4ALAAAAQAPAA4AAAV4oCd63GMAgfF04zgNQixjrVcJQz4QRLNxI06Bh7CILpkf0CMpGBLL0ebHWhwOl5qno/l5EGCtqAtUmMWeTNfzWCxoNU4maWs0Vq0OBpMBdh4ODxEaIhsXhxkjGRAQEhITExQVFhdRHhoTjo8UFBYbWnoUjhUZLCIhACH5BAkFAB4ALAAAAQAPAA4AAAV5oCd6HIQIgfFw42gZBDEMgjBMbXUYRlHINEFF1FEgEIqLyHKQJToeikLBgI44iskG+mAsMC0RR7NhNRqM8IjMejgcahHbM4E8Mupx2YOJSCZWIxlkUB0TEhIUG2IYg4tyiH8UFRaNGoEeGYgTkxYXGZhEGBWTGI8iIQA7"))
  5444. .append("<a href='" + nextUrl + "' title='点击打开下一页链接'>正在载入下一页".uiTrans() + (useiframe ? "(iframe)" : "") + "...</a>");
  5445.  
  5446. if (useiframe) {
  5447. App.iframeRequest(nextUrl);
  5448. } else {
  5449. App.httpRequest(nextUrl, App.httpRequestDone);
  5450. }
  5451. } else {
  5452. // App.$loading.html("<a href='" + App.curPageUrl + "'>无法使用阅读模式,请手动点击下一页</a>").show();
  5453. }
  5454. },
  5455. httpRequest: function(nextUrl, callback) {
  5456. if (!_.isFunction(callback)) {
  5457. callback = function() {}
  5458. }
  5459.  
  5460. C.log("获取下一页: " + nextUrl);
  5461. App.parsedPages[nextUrl] += 1;
  5462.  
  5463. GM_xmlhttpRequest({
  5464. url: nextUrl,
  5465. method: "GET",
  5466. overrideMimeType: "text/html;charset=" + document.characterSet,
  5467. timeout: config.xhr_time,
  5468. onload: function(res) {
  5469. var doc = parseHTML(res.responseText);
  5470. callback(doc, nextUrl);
  5471. },
  5472. ontimeout: function() {
  5473. callback(null, nextUrl);
  5474. }
  5475. });
  5476. },
  5477. httpRequestDone: function(doc, nextUrl) {
  5478. if (doc) {
  5479. App.beforeLoad(doc);
  5480. return;
  5481. }
  5482.  
  5483. if (App.parsedPages[nextUrl] >= 3) {
  5484. console.error('同一个链接已获取3次', nextUrl)
  5485. App.$loading.html("<a href='" + nextUrl + "'>无法获取下一页,请手动点击</a>").show();
  5486. return;
  5487. }
  5488.  
  5489. // 无内容再次尝试获取
  5490. console.error('连接超时, 再次获取');
  5491. App.httpRequest(nextUrl, App.httpRequestDone);
  5492. },
  5493. iframeRequest: function(nextUrl) {
  5494. C.log("iframeRequest: " + nextUrl);
  5495. if (!App.iframe) {
  5496. var i = document.createElement('iframe');
  5497. App.iframe = i;
  5498. i.name = 'mynovelreader-iframe';
  5499. i.width = '100%';
  5500. i.height = '0';
  5501. i.frameBorder = "0";
  5502. i.style.cssText = '\
  5503. margin:0!important;\
  5504. padding:0!important;\
  5505. visibility:hidden!important;\
  5506. ';
  5507. i.src = nextUrl;
  5508. i.addEventListener('load', App.iframeLoaded, false);
  5509. App.remove.push(function() {
  5510. i.removeEventListener('load', App.iframeLoaded, false);
  5511. });
  5512. document.body.appendChild(i);
  5513. } else {
  5514. App.iframe.contentDocument.location.replace(nextUrl);
  5515. }
  5516. },
  5517. iframeLoaded: function() {
  5518. var iframe = this;
  5519. var body = iframe.contentDocument.body;
  5520.  
  5521. if (body && body.firstChild) {
  5522. doc = iframe.contentDocument;
  5523.  
  5524. if (App.site.startLaunch) {
  5525. App.site.startLaunch($(doc));
  5526. }
  5527.  
  5528. var mutationSelector = App.site.mutationSelector;
  5529. if (mutationSelector) {
  5530. App.addMutationObserve(doc, function() {
  5531. App.beforeLoad(doc);
  5532. });
  5533. } else {
  5534. var timeout = App.site.timeout || 0;
  5535.  
  5536. setTimeout(function() {
  5537. App.beforeLoad(doc);
  5538. }, timeout);
  5539. }
  5540. }
  5541. },
  5542. beforeLoad: function(htmlDoc) {
  5543. if (config.PRELOADER) {
  5544. App.tmpDoc = htmlDoc;
  5545. App.working = false;
  5546. App.scroll();
  5547.  
  5548. // 预读图片
  5549. var existSRC = {};
  5550. $(App.tmpDoc).find('img').each(function() {
  5551. var isrc = $(this).attr('src');
  5552. if (!isrc || existSRC[isrc]) {
  5553. return;
  5554. } else {
  5555. existSRC[isrc] = true;
  5556. }
  5557. var img = document.createElement('img');
  5558. img.src = isrc;
  5559. });
  5560. } else {
  5561. App.loaded(htmlDoc);
  5562. }
  5563. },
  5564. loaded: function(doc) {
  5565. var parser = new Parser(App.site, doc, App.curPageUrl);
  5566. parser.getAll(function() {
  5567. App.addNextPage(parser);
  5568. });
  5569. App.tmpDoc = null;
  5570. },
  5571. addNextPage: function(parser) {
  5572. if (parser.content) {
  5573. App.appendPage(parser);
  5574.  
  5575. App.$loading.hide();
  5576. App.requestUrl = parser.nextUrl;
  5577. App.isTheEnd = parser.isTheEnd;
  5578.  
  5579. App.afterLoad();
  5580. } else {
  5581. App.removeListener();
  5582.  
  5583. App.$loading.html(
  5584. '<a href="' + App.curPageUrl + '">错误:没有找到下一页的内容。点击打开下一页链接。</a>'.uiTrans())
  5585. .show();
  5586. }
  5587.  
  5588. App.working = false;
  5589. },
  5590. afterLoad: function() {
  5591. App.tmpDoc = null;
  5592.  
  5593. if (config.PRELOADER) {
  5594. setTimeout(function(){
  5595. App.doRequest();
  5596. }, 200);
  5597. }
  5598. },
  5599. fixImageFloats: function(articleContent) {
  5600. if (!config.fixImageFloats) return;
  5601.  
  5602. articleContent = articleContent || document;
  5603.  
  5604. var imageWidthThreshold = Math.min(articleContent.offsetWidth, 800) * 0.55,
  5605. images = articleContent.querySelectorAll('img:not(.blockImage)');
  5606.  
  5607. for (var i = 0, il = images.length; i < il; i += 1) {
  5608. var image = images[i];
  5609.  
  5610. if (image.offsetWidth > imageWidthThreshold) {
  5611. image.className += " blockImage";
  5612. }
  5613. }
  5614. },
  5615.  
  5616. isSaveing: false,
  5617. saveAsTxt: function() {
  5618. if (App.site.useiframe) {
  5619. UI.notice('暂不支持', 3000);
  5620. return;
  5621. }
  5622.  
  5623. if (App.isSaveing) {
  5624. alert('正在保存,请稍后');
  5625. return;
  5626. }
  5627.  
  5628. App.isSaveing = true;
  5629.  
  5630. var chapters = [];
  5631. var fileName;
  5632.  
  5633. var toTxt = function(parser) {
  5634. var html = $.nano('{chapterTitle}\n\n{contentTxt}', parser);
  5635. chapters.push(html);
  5636.  
  5637. UI.message.loading('已下载 ' + chapters.length + ' 章', 0);
  5638. };
  5639. var finish = function() {
  5640. var allTxt = chapters.join('\n\n');
  5641. if (isWindows) {
  5642. allTxt = allTxt.replace(/\n/g, '\r\n');
  5643. }
  5644.  
  5645. saveAs(allTxt, fileName);
  5646. App.isSaveing = false;
  5647. };
  5648.  
  5649. var getOnePage = function (parser, nextUrl) {
  5650. var isEnd = false;
  5651. if (parser) {
  5652. toTxt(parser);
  5653. nextUrl = parser.nextUrl;
  5654. isEnd = parser.isTheEnd;
  5655. }
  5656.  
  5657. if (!nextUrl || isEnd) {
  5658. console.log('全部获取完毕');
  5659. finish();
  5660. return;
  5661. }
  5662.  
  5663. if (App.site.useiframe) {
  5664. // App.iframeRequest(nextUrl);
  5665. } else {
  5666. console.log('[存为txt]正在获取:', nextUrl)
  5667. App.httpRequest(nextUrl, function(doc) {
  5668. if (doc) {
  5669. var par = new Parser(App.site, doc, nextUrl);
  5670. par.getAll(getOnePage)
  5671. } else {
  5672. console.error('超时或连接出错');
  5673. finish();
  5674. }
  5675. });
  5676. }
  5677. };
  5678.  
  5679. App.parsers.forEach(toTxt);
  5680. // 保存后面的章节
  5681. var lastParser = App.parsers[App.parsers.length - 1];
  5682. fileName = lastParser.bookTitle + '.txt';
  5683. getOnePage(null, lastParser.nextUrl);
  5684. }
  5685. };
  5686.  
  5687. var BookLinkMe = {
  5688. clickedColor: "666666",
  5689.  
  5690. init: function() {
  5691.  
  5692. this.addUnreadButton();
  5693.  
  5694. // if (location.pathname.indexOf("/book-") === 0) {
  5695. // this.chapterPageAddTiebaLink();
  5696. // }
  5697. },
  5698. addUnreadButton: function(){ // 添加一键打开所有未读链接
  5699. var $parent = $('td[colspan="2"]:contains("未读"):first, td[colspan="2"]:contains("未讀"):first');
  5700. if(!$parent.length) return;
  5701.  
  5702. var openAllUnreadLinks = function(event){
  5703. event.preventDefault();
  5704.  
  5705. var links = $x('./ancestor::table[@width="100%"]/descendant::a[img[@alt="未读"]]', event.target);
  5706. links.forEach(function(link){
  5707. // 忽略没有盗版的
  5708. var chapterLink = link.parentNode.nextSibling.nextSibling.querySelector('a');
  5709. if (chapterLink.querySelector('font[color*="800000"]')) {
  5710. return;
  5711. }
  5712.  
  5713. if(isFirefox)
  5714. link.click();
  5715. else
  5716. GM_openInTab(link.href);
  5717.  
  5718. // 设置点击后的样式
  5719. // 未读左边的 1x 链接
  5720. link.parentNode.previousSibling.querySelector('font')
  5721. .setAttribute('color', BookLinkMe.clickedColor);
  5722. chapterLink.classList.add('mclicked');
  5723. });
  5724. };
  5725.  
  5726.  
  5727. $('<a>')
  5728. .attr({ href: 'javascript:;', title: '一键打开所有未读链接', style: 'width:auto;' })
  5729. .click(openAllUnreadLinks)
  5730. .append($('<img src="me.png" style="max-width: 20px;">'))
  5731. .appendTo($parent);
  5732. },
  5733. chapterPageAddTiebaLink: function() {
  5734. var link = $('font:contains("贴吧")').parent().get(0);
  5735. if (!link) return;
  5736.  
  5737. var tiebaUrl = 'http://tieba.baidu.com/f?kw=' + $('h1').text();
  5738. console.log('GM_xmlhttpRequest', tiebaUrl);
  5739. GM_xmlhttpRequest({
  5740. method: "GET",
  5741. url: tiebaUrl,
  5742. onload: function(response) {
  5743. var doc = parseHTML(response.responseText);
  5744. BookLinkMe.load(doc);
  5745. }
  5746. });
  5747. },
  5748. load: function(doc) {
  5749. var $data = $(doc).find('.threadlist_text > a').map(function() {
  5750. return {
  5751. title: $(this).text(),
  5752. url: 'http://tieba.baidu.com' + $(this).attr('href')
  5753. }
  5754. });
  5755.  
  5756. var trimTitle = function(title, strict) {
  5757. title = title.trim()
  5758. .replace(/\.\.\.$/, '');
  5759.  
  5760. if (strict) {
  5761. title = title.replace(/第.*?章\s*/, '');
  5762. }
  5763.  
  5764. // if (toNum) {
  5765. // title = title.replace(/[零一二三四五六七八九十百千万亿]+/, cnNum2ArabNum);
  5766. // }
  5767.  
  5768. return title;
  5769. };
  5770.  
  5771. var findUrl = function(sTitle) {
  5772. if (!sTitle) return;
  5773.  
  5774. var url;
  5775. $data.each(function(i, item) {
  5776. var tiebaTitle = item.title;
  5777. if (tiebaTitle.indexOf(trimTitle(sTitle)) > 0 ||
  5778. sTitle.indexOf(trimTitle(tiebaTitle, true)) > 0 // 包含贴吧标题的部分
  5779. ) {
  5780. url = item.url;
  5781. return true;
  5782. }
  5783. });
  5784.  
  5785. return url;
  5786. };
  5787.  
  5788. $('a:contains("搜索本章节")').each(function(){
  5789. var $this = $(this),
  5790. $thisLine = $this.parent().parent(),
  5791. chapterTitle = $thisLine.prev().find('a[href^="/jump.php"]:first').text();
  5792.  
  5793. var url = findUrl(chapterTitle);
  5794. if (url) {
  5795. $('<a>')
  5796. .attr({ target: '_blank', href: url })
  5797. .text('贴吧')
  5798. .appendTo($this.parent());
  5799. }
  5800. });
  5801. }
  5802. };
  5803.  
  5804. if (location.host.indexOf('booklink.me') > -1) {
  5805. BookLinkMe.init();
  5806. } else {
  5807. App.init();
  5808. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址