()
| 16 | nextDownloadSlotAt = fireAt + DOWNLOAD_STAGGER_MS; |
| 17 | |
| 18 | const trigger = () => { |
| 19 | const a = document.createElement('a'); |
| 20 | a.href = url; |
| 21 | a.download = filename; |
| 22 | document.body.appendChild(a); |
| 23 | a.click(); |
| 24 | document.body.removeChild(a); |
| 25 | setTimeout(() => URL.revokeObjectURL(url), DOWNLOAD_REVOKE_DELAY_MS); |
| 26 | }; |
| 27 | |
| 28 | if (fireAt === now) trigger(); |
| 29 | else setTimeout(trigger, fireAt - now); |