Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(polyfills): implement createHTMLDocument for jquery

Leonard Kim466561f99f79
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 4fb3e47fd1..5b435a8c52 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(
+ `<html>
+ <head><title>${title}</title></head>
+ <body></body>
+ </html>`,
+ 'text/xml');
+
+ Object.defineProperty(htmlDocument, 'body', {
+ get() {
+ return htmlDocument.getElementsByTagName('body')[0];
+ }
+ });
+
+ return htmlDocument;
+ };
+ }
+
// Element.querySelector
//
// Required by: