Security: use safe 'setAttribute'
This commit is contained in:
parent
8d1ae657fc
commit
ac236199fc
1 changed files with 3 additions and 3 deletions
|
@ -53,17 +53,17 @@ export default class Link extends BaseUIElement {
|
|||
}
|
||||
const el = document.createElement("a")
|
||||
if (typeof this._href === "string") {
|
||||
el.href = this._href
|
||||
el.setAttribute("href", this._href)
|
||||
} else {
|
||||
this._href.addCallbackAndRun((href) => {
|
||||
el.href = href
|
||||
el.setAttribute("href", href)
|
||||
})
|
||||
}
|
||||
if (this._newTab) {
|
||||
el.target = "_blank"
|
||||
}
|
||||
if (this._download) {
|
||||
el.download = this._download
|
||||
el.setAttribute("download", this._download)
|
||||
}
|
||||
el.appendChild(embeddedShow)
|
||||
return el
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue