fix: download disabled on some scores
This commit is contained in:
parent
52e1f9511c
commit
4eade0ad46
1 changed files with 6 additions and 3 deletions
|
@ -9,10 +9,13 @@ type BtnElement = HTMLButtonElement
|
||||||
|
|
||||||
const getBtnContainer = (): HTMLDivElement => {
|
const getBtnContainer = (): HTMLDivElement => {
|
||||||
const container = document.querySelectorAll('aside>section>section')[0]
|
const container = document.querySelectorAll('aside>section>section')[0]
|
||||||
return [...container.children].find((div) => {
|
const btnParent = [...container.children].find((div) => {
|
||||||
const b = div.querySelector('button, .button')
|
const b = div.querySelector('button, .button')
|
||||||
return b && b.outerHTML.replace(/\s/g, '').includes('Download')
|
const text = b ? b.outerHTML.replace(/\s/g, '') : ''
|
||||||
}) as HTMLDivElement
|
return text.includes('Download') || text.includes('Print')
|
||||||
|
}) as HTMLDivElement | null
|
||||||
|
if (!btnParent) throw new Error('btn parent not found')
|
||||||
|
return btnParent
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildDownloadBtn = () => {
|
const buildDownloadBtn = () => {
|
||||||
|
|
Loading…
Reference in a new issue