Skip to content

Commit

Permalink
fix: Allow parseXmlString when createNodeIterator is not available (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and Rodolphe Breton committed Nov 30, 2023
1 parent 55b9c20 commit d54d4d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/util/xml_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,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 d54d4d1

Please sign in to comment.