Skip to content

Commit

Permalink
fix: Fix build Circle CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Kola-Kola committed Oct 11, 2021
1 parent 84d3af1 commit a9c049f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/bliinkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,22 @@ export const parseXML = (content) => {
if (typeof content !== 'string' || content.length === 0) return null

const parser = new DOMParser()
if (parser) {
const xml = (parser && parser.parseFromString && parser.parseFromString(content, 'text/xml')) || ''

if (window.DOMParser) {
const xml = (parser && parser.parseFromString && parser.parseFromString(content, 'text/xml'))

if (xml &&
xml.getElementsByTagName('VAST')[0] &&
xml.getElementsByTagName('VAST')[0].tagName === 'VAST') {
return xml
}
} else {
// eslint-disable-next-line no-undef
let xmlDoc = new ActiveXObject('Microsoft.XMLDOM')
xmlDoc.async = false
xmlDoc.loadXML(content)

return xmlDoc
}

return null
Expand Down

0 comments on commit a9c049f

Please sign in to comment.