From 466561f99f799bb517ae5c6e16f3160e58e06db9 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Mon, 5 Mar 2018 16:47:13 -0800 Subject: [PATCH] fix(polyfills): implement createHTMLDocument for jquery --- .../native/polyfills-browser.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) 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 4fb3e47fd..5b435a8c5 100644 --- a/react/features/base/lib-jitsi-meet/native/polyfills-browser.js +++ b/react/features/base/lib-jitsi-meet/native/polyfills-browser.js @@ -149,6 +149,38 @@ function _visitNode(node, callback) { document.cookie = ''; } + // document.implementation + // + // Required by: + // - jQuery + if (typeof document.implementation === 'undefined') { + document.implementation = {}; + } + + // document.implementation.createHTMLDocument + // + // Required by: + // - jQuery + if (typeof document.implementation.createHTMLDocument === 'undefined') { + document.implementation.createHTMLDocument = function(title = '') { + const htmlDocument + = new DOMParser().parseFromString( + ` + ${title} + + `, + 'text/xml'); + + Object.defineProperty(htmlDocument, 'body', { + get() { + return htmlDocument.getElementsByTagName('body')[0]; + } + }); + + return htmlDocument; + }; + } + // Element.querySelector // // Required by: