forked from MapComplete/MapComplete
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")
|
const el = document.createElement("a")
|
||||||
if (typeof this._href === "string") {
|
if (typeof this._href === "string") {
|
||||||
el.href = this._href
|
el.setAttribute("href", this._href)
|
||||||
} else {
|
} else {
|
||||||
this._href.addCallbackAndRun((href) => {
|
this._href.addCallbackAndRun((href) => {
|
||||||
el.href = href
|
el.setAttribute("href", href)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (this._newTab) {
|
if (this._newTab) {
|
||||||
el.target = "_blank"
|
el.target = "_blank"
|
||||||
}
|
}
|
||||||
if (this._download) {
|
if (this._download) {
|
||||||
el.download = this._download
|
el.setAttribute("download", this._download)
|
||||||
}
|
}
|
||||||
el.appendChild(embeddedShow)
|
el.appendChild(embeddedShow)
|
||||||
return el
|
return el
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue