diff --git a/lib/util/xml_utils.js b/lib/util/xml_utils.js index 82ea12d27b..f1b5d2648f 100644 --- a/lib/util/xml_utils.js +++ b/lib/util/xml_utils.js @@ -384,6 +384,11 @@ shaka.util.XmlUtils = class { return null; } + // Cobalt browser doesn't support document.createNodeIterator. + if (!('createNodeIterator' in document)) { + return rootElem; + } + // SECURITY: Verify that the document does not contain elements from the // HTML or SVG namespaces, which could trigger script execution and XSS. const iterator = document.createNodeIterator(