Bug 1472749 - fix reader mode on nytimes website (sync from github 7d03bec52d0a0c4b22d044e06af84abb15a9f02b), r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 10 Jul 2018 14:24:43 +0100
changeset 816215 d9682b4ae9898976ea45ffc238e60022e5e7ba9c
parent 816163 8719529f5d4d8e626e023700df2bad191baaf0b6
child 816216 a34a6f54da753e87e778e477f2760753ebf519b6
push id115778
push userbmo:mstriemer@mozilla.com
push dateTue, 10 Jul 2018 18:49:28 +0000
reviewersjaws
bugs1472749
milestone63.0a1
Bug 1472749 - fix reader mode on nytimes website (sync from github 7d03bec52d0a0c4b22d044e06af84abb15a9f02b), r=jaws
toolkit/components/reader/Readability.js
--- a/toolkit/components/reader/Readability.js
+++ b/toolkit/components/reader/Readability.js
@@ -113,17 +113,17 @@ Readability.prototype = {
   DEFAULT_TAGS_TO_SCORE: "section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","),
 
   // The default number of chars an article must have in order to return a result
   DEFAULT_CHAR_THRESHOLD: 500,
 
   // All of the regular expressions in use within readability.
   // Defined up here so we don't instantiate them repeatedly in loops.
   REGEXPS: {
-    unlikelyCandidates: /banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|foot|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
+    unlikelyCandidates: /-ad-|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|foot|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
     okMaybeItsACandidate: /and|article|body|column|main|shadow/i,
     positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,
     negative: /hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,
     extraneous: /print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,
     byline: /byline|author|dateline|writtenby|p-author/i,
     replaceFonts: /<(\/?)font[^>]*>/gi,
     normalize: /\s{2,}/g,
     videos: /\/\/(www\.)?(dailymotion|youtube|youtube-nocookie|player\.vimeo)\.com/i,