diff --git a/client/js/util/polyfill.js b/client/js/util/polyfill.js index 606d29d..51252c2 100644 --- a/client/js/util/polyfill.js +++ b/client/js/util/polyfill.js @@ -3,6 +3,19 @@ // fix iterating over NodeList in Chrome and Opera NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; +NodeList.prototype.querySelector = function(...args) { + for (let node of this) { + if (node.nodeType === 3) { + continue; + } + const result = node.querySelector(...args); + if (result) { + return result; + } + } + return null; +} + // non standard Node.prototype.prependChild = function(child) { if (this.firstChild) {