summaryrefslogtreecommitdiffstats
path: root/toolkit/components/reader/Readability-readerable.js
diff options
context:
space:
mode:
authorAscrod <32915892+Ascrod@users.noreply.github.com>2020-05-23 22:12:01 -0400
committerAscrod <32915892+Ascrod@users.noreply.github.com>2020-05-25 14:29:42 -0400
commit09bdffde5ed2c3d2eee455d3937bbba11da64eef (patch)
tree41d1c4cdb79413d0c88660f643f6245eeccb18a5 /toolkit/components/reader/Readability-readerable.js
parent4d373c1d360b29f94026b72c6f66e4ad313732cf (diff)
downloadUXP-09bdffde5ed2c3d2eee455d3937bbba11da64eef.tar
UXP-09bdffde5ed2c3d2eee455d3937bbba11da64eef.tar.gz
UXP-09bdffde5ed2c3d2eee455d3937bbba11da64eef.tar.lz
UXP-09bdffde5ed2c3d2eee455d3937bbba11da64eef.tar.xz
UXP-09bdffde5ed2c3d2eee455d3937bbba11da64eef.zip
Issue #361 - Update Readability from upstream.
(git rev 52ab9b5c8916c306a47b2119270dcdabebf9d203)
Diffstat (limited to 'toolkit/components/reader/Readability-readerable.js')
-rw-r--r--toolkit/components/reader/Readability-readerable.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/toolkit/components/reader/Readability-readerable.js b/toolkit/components/reader/Readability-readerable.js
index d0e1b8164..839d9fbf7 100644
--- a/toolkit/components/reader/Readability-readerable.js
+++ b/toolkit/components/reader/Readability-readerable.js
@@ -31,13 +31,16 @@
var REGEXPS = {
// NOTE: These two regular expressions are duplicated in
// Readability.js. Please keep both copies in sync.
- 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,
+ unlikelyCandidates: /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|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|content|main|shadow/i,
};
function isNodeVisible(node) {
- // Have to null-check node.style to deal with SVG and MathML nodes.
- return (!node.style || node.style.display != "none") && !node.hasAttribute("hidden");
+ // Have to null-check node.style and node.className.indexOf to deal with SVG and MathML nodes.
+ return (!node.style || node.style.display != "none")
+ && !node.hasAttribute("hidden")
+ //check for "fallback-image" so that wikimedia math images are displayed
+ && (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1));
}
/**