diff --git a/react/features/base/lib-jitsi-meet/native/polyfills-browser.js b/react/features/base/lib-jitsi-meet/native/polyfills-browser.js index 5b435a8c5..86e70ce15 100644 --- a/react/features/base/lib-jitsi-meet/native/polyfills-browser.js +++ b/react/features/base/lib-jitsi-meet/native/polyfills-browser.js @@ -195,6 +195,18 @@ function _visitNode(node, callback) { }; } + // Element.remove + // + // Required by: + // - lib-jitsi-meet ChatRoom#onPresence parsing + if (typeof elementPrototype.remove === 'undefined') { + elementPrototype.remove = function() { + if (this.parentNode !== null) { + this.parentNode.removeChild(this); + } + }; + } + // Element.innerHTML // // Required by: @@ -231,6 +243,31 @@ function _visitNode(node, callback) { } }); } + + // Element.children + // + // Required by: + // - lib-jitsi-meet ChatRoom#onPresence parsing + if (!elementPrototype.hasOwnProperty('children')) { + Object.defineProperty(elementPrototype, 'children', { + get() { + const nodes = this.childNodes; + const children = []; + let i = 0; + let node = nodes[i]; + + while (node) { + if (node.nodeType === 1) { + children.push(node); + } + i += 1; + node = nodes[i]; + } + + return children; + } + }); + } } // FIXME There is a weird infinite loop related to console.log and