Skip to content

Commit

Permalink
fix: Allow parseXmlString when createNodeIterator is not available (#…
Browse files Browse the repository at this point in the history
…5805)

Related to #5804
  • Loading branch information
avelad authored and joeyparrish committed Feb 17, 2024
1 parent 2cab9a2 commit dd4b36f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/util/xml_utils.js
Expand Up @@ -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(
Expand Down

0 comments on commit dd4b36f

Please sign in to comment.