Handle cases where className is a dictionary instead of string

This commit is contained in:
Jackson Harper 2022-11-01 12:16:29 +08:00
parent 54ad303ed7
commit 81c125ed50

View file

@ -2797,10 +2797,14 @@ Readability.prototype = {
},
_isOmnivoreNode: function(node) {
const prefix = '_omnivore'
var walk = node
while (walk) {
if (walk.className && walk.className.startsWith("_omnivore")) {
if (walk.className && walk.className.startsWith && walk.className.startsWith(prefix)) {
return true
}
if (walk.className && walk.className.hasOwnProperty && walk.className.hasOwnProperty(prefix)) {
return true
}
walk = walk.parentElement